コード例 #1
0
        /// <summary>
        /// Serializes this instance of <see cref="SqlMigrationService" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="SqlMigrationService" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.Json.JsonNode) this._property.ToJson(null, serializationMode) : null, "properties", container.Add);
            AfterToJson(ref container);
            return(container);
        }
コード例 #2
0
        /// <summary>
        /// <c>AfterToJson</c> will be called after the json serialization has finished, allowing customization of the <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.Json.JsonObject container);
コード例 #3
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 <paramref name="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.DataMigration.Runtime.Json.JsonObject container, ref bool returnNow);
コード例 #4
0
        /// <summary>
        /// Serializes this instance of <see cref="SystemData" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="SystemData" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._createdBy.ToString()) : null, "createdBy", container.Add);
            AddIf(null != (((object)this._createdByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._createdByType.ToString()) : null, "createdByType", container.Add);
            AddIf(null != this._createdAt ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._lastModifiedBy.ToString()) : null, "lastModifiedBy", container.Add);
            AddIf(null != (((object)this._lastModifiedByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._lastModifiedByType.ToString()) : null, "lastModifiedByType", container.Add);
            AddIf(null != this._lastModifiedAt ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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);
        }
コード例 #5
0
        /// <summary>
        /// Serializes this instance of <see cref="SqlBackupSetInfo" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="SqlBackupSetInfo" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._backupSetId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._backupSetId.ToString()) : null, "backupSetId", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._firstLsn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._firstLsn.ToString()) : null, "firstLSN", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._lastLsn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._lastLsn.ToString()) : null, "lastLSN", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._backupType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._backupType.ToString()) : null, "backupType", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._listOfBackupFile)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray();
                    foreach (var __x in this._listOfBackupFile)
                    {
                        AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                    }
                    container.Add("listOfBackupFiles", __w);
                }
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._backupStartDate ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._backupStartDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", global::System.Globalization.CultureInfo.InvariantCulture)) : null, "backupStartDate", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._backupFinishDate ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._backupFinishDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", global::System.Globalization.CultureInfo.InvariantCulture)) : null, "backupFinishDate", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._isBackupRestored ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._isBackupRestored) : null, "isBackupRestored", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._hasBackupChecksum ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._hasBackupChecksum) : null, "hasBackupChecksums", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._familyCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._familyCount) : null, "familyCount", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._ignoreReason)
                {
                    var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray();
                    foreach (var __s in this._ignoreReason)
                    {
                        AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__s.ToString()) : null, __r.Add);
                    }
                    container.Add("ignoreReasons", __r);
                }
            }
            AfterToJson(ref container);
            return(container);
        }
コード例 #6
0
        /// <summary>
        /// Serializes this instance of <see cref="DataMigrationIdentity" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="DataMigrationIdentity" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName", container.Add);
            AddIf(null != (((object)this._sqlDbInstanceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sqlDbInstanceName.ToString()) : null, "sqlDbInstanceName", container.Add);
            AddIf(null != (((object)this._targetDbName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetDbName.ToString()) : null, "targetDbName", container.Add);
            AddIf(null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId", container.Add);
            AddIf(null != (((object)this._managedInstanceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._managedInstanceName.ToString()) : null, "managedInstanceName", container.Add);
            AddIf(null != (((object)this._sqlVirtualMachineName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sqlVirtualMachineName.ToString()) : null, "sqlVirtualMachineName", container.Add);
            AddIf(null != (((object)this._sqlMigrationServiceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sqlMigrationServiceName.ToString()) : null, "sqlMigrationServiceName", container.Add);
            AddIf(null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id", container.Add);
            AfterToJson(ref container);
            return(container);
        }
コード例 #7
0
        /// <summary>
        /// Serializes this instance of <see cref="DatabaseMigration" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="DatabaseMigration" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            __proxyResource?.ToJson(container, serializationMode);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._systemData.ToJson(null, serializationMode) : null, "systemData", container.Add);
            }
            AddIf(null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._property.ToJson(null, serializationMode) : null, "properties", container.Add);
            AfterToJson(ref container);
            return(container);
        }
コード例 #8
0
        /// <summary>
        /// Serializes this instance of <see cref="RegenAuthKeys" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="RegenAuthKeys" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._keyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._keyName.ToString()) : null, "keyName", container.Add);
            AddIf(null != (((object)this._authKey1)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._authKey1.ToString()) : null, "authKey1", container.Add);
            AddIf(null != (((object)this._authKey2)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._authKey2.ToString()) : null, "authKey2", container.Add);
            AfterToJson(ref container);
            return(container);
        }
コード例 #9
0
        /// <summary>
        /// Serializes this instance of <see cref="SourceLocation" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="SourceLocation" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._fileShare ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._fileShare.ToJson(null, serializationMode) : null, "fileShare", container.Add);
            AddIf(null != this._azureBlob ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._azureBlob.ToJson(null, serializationMode) : null, "azureBlob", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._fileStorageType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._fileStorageType.ToString()) : null, "fileStorageType", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
コード例 #10
0
        /// <summary>
        /// Serializes this instance of <see cref="TrackedResource" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="TrackedResource" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._systemData.ToJson(null, serializationMode) : null, "systemData", container.Add);
            }
            AddIf(null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._location.ToString()) : null, "location", container.Add);
            AddIf(null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._tag.ToJson(null, serializationMode) : null, "tags", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._id.ToString()) : null, "id", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._type.ToString()) : null, "type", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
コード例 #11
0
        /// <summary>
        /// Serializes this instance of <see cref="AzureBlob" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="AzureBlob" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._storageAccountResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._storageAccountResourceId.ToString()) : null, "storageAccountResourceId", container.Add);
            AddIf(null != (((object)this._accountKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._accountKey.ToString()) : null, "accountKey", container.Add);
            AddIf(null != (((object)this._blobContainerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._blobContainerName.ToString()) : null, "blobContainerName", container.Add);
            AfterToJson(ref container);
            return(container);
        }
コード例 #12
0
        /// <summary>
        /// Serializes this instance of <see cref="SqlBackupFileInfo" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="SqlBackupFileInfo" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._fileName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._fileName.ToString()) : null, "fileName", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._status.ToString()) : null, "status", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._totalSize ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._totalSize) : null, "totalSize", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._dataRead ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._dataRead) : null, "dataRead", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._dataWritten ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((long)this._dataWritten) : null, "dataWritten", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._copyThroughput ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((double)this._copyThroughput) : null, "copyThroughput", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._copyDuration ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._copyDuration) : null, "copyDuration", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._familySequenceNumber ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._familySequenceNumber) : null, "familySequenceNumber", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
コード例 #13
0
        /// <summary>
        /// Serializes this instance of <see cref="OperationsDefinition" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="OperationsDefinition" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._display.ToJson(null, serializationMode) : null, "display", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._name.ToString()) : null, "name", container.Add);
            }
            AddIf(null != this._isDataAction ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._isDataAction) : null, "isDataAction", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._origin)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._origin.ToString()) : null, "origin", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._property.ToJson(null, serializationMode) : null, "properties", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
コード例 #14
0
        /// <summary>
        /// Serializes this instance of <see cref="NodeMonitoringData" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="NodeMonitoringData" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._additionalProperty ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._additionalProperty.ToJson(null, serializationMode) : null, "additionalProperties", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._nodeName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._nodeName.ToString()) : null, "nodeName", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._availableMemoryInMb ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._availableMemoryInMb) : null, "availableMemoryInMB", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._cpuUtilization ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._cpuUtilization) : null, "cpuUtilization", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._concurrentJobsLimit ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._concurrentJobsLimit) : null, "concurrentJobsLimit", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._concurrentJobsRunning ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._concurrentJobsRunning) : null, "concurrentJobsRunning", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._maxConcurrentJob ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._maxConcurrentJob) : null, "maxConcurrentJobs", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._sentByte ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((double)this._sentByte) : null, "sentBytes", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._receivedByte ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((double)this._receivedByte) : null, "receivedBytes", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
コード例 #15
0
        /// <summary>
        /// Serializes this instance of <see cref="ErrorInfo" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ErrorInfo" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._code.ToString()) : null, "code", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._message.ToString()) : null, "message", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
コード例 #16
0
        /// <summary>
        /// Serializes this instance of <see cref="DatabaseMigrationProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="DatabaseMigrationProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._sourceSqlConnection ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceSqlConnection.ToJson(null, serializationMode) : null, "sourceSqlConnection", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._migrationFailureError ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._migrationFailureError.ToJson(null, serializationMode) : null, "migrationFailureError", container.Add);
            }
            AddIf(null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind", container.Add);
            AddIf(null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._migrationStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._migrationStatus.ToString()) : null, "migrationStatus", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._startedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._startedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedOn", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._endedOn ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._endedOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endedOn", container.Add);
            }
            AddIf(null != (((object)this._sourceDatabaseName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceDatabaseName.ToString()) : null, "sourceDatabaseName", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._sourceServerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._sourceServerName.ToString()) : null, "sourceServerName", container.Add);
            }
            AddIf(null != (((object)this._migrationService)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._migrationService.ToString()) : null, "migrationService", container.Add);
            AddIf(null != (((object)this._migrationOperationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._migrationOperationId.ToString()) : null, "migrationOperationId", container.Add);
            AddIf(null != (((object)this._targetDatabaseCollation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._targetDatabaseCollation.ToString()) : null, "targetDatabaseCollation", container.Add);
            AddIf(null != (((object)this._provisioningError)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._provisioningError.ToString()) : null, "provisioningError", container.Add);
            AfterToJson(ref container);
            return(container);
        }
コード例 #17
0
        /// <summary>
        /// Serializes this instance of <see cref="DatabaseMigrationPropertiesSqlVM" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="DatabaseMigrationPropertiesSqlVM" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            __databaseMigrationProperties?.ToJson(container, serializationMode);
            AddIf(null != this._backupConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._backupConfiguration.ToJson(null, serializationMode) : null, "backupConfiguration", container.Add);
            AddIf(null != this._offlineConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._offlineConfiguration.ToJson(null, serializationMode) : null, "offlineConfiguration", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._migrationStatusDetail ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._migrationStatusDetail.ToJson(null, serializationMode) : null, "migrationStatusDetails", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
コード例 #18
0
        /// <summary>
        /// Serializes this instance of <see cref="SqlDbMigrationStatusDetails" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="SqlDbMigrationStatusDetails" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._migrationState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._migrationState.ToString()) : null, "migrationState", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._sqlDataCopyError)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray();
                    foreach (var __x in this._sqlDataCopyError)
                    {
                        AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                    }
                    container.Add("sqlDataCopyErrors", __w);
                }
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._listOfCopyProgressDetail)
                {
                    var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray();
                    foreach (var __s in this._listOfCopyProgressDetail)
                    {
                        AddIf(__s?.ToJson(null, serializationMode), __r.Add);
                    }
                    container.Add("listOfCopyProgressDetails", __r);
                }
            }
            AfterToJson(ref container);
            return(container);
        }
コード例 #19
0
        /// <summary>
        /// Serializes this instance of <see cref="BackupConfiguration" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="BackupConfiguration" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._sourceLocation ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._sourceLocation.ToJson(null, serializationMode) : null, "sourceLocation", container.Add);
            AddIf(null != this._targetLocation ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetLocation.ToJson(null, serializationMode) : null, "targetLocation", container.Add);
            AfterToJson(ref container);
            return(container);
        }
コード例 #20
0
        /// <summary>
        /// Serializes this instance of <see cref="MigrationStatusDetails" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="MigrationStatusDetails" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._fullBackupSetInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._fullBackupSetInfo.ToJson(null, serializationMode) : null, "fullBackupSetInfo", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._lastRestoredBackupSetInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._lastRestoredBackupSetInfo.ToJson(null, serializationMode) : null, "lastRestoredBackupSetInfo", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._migrationState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._migrationState.ToString()) : null, "migrationState", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._activeBackupSet)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray();
                    foreach (var __x in this._activeBackupSet)
                    {
                        AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                    }
                    container.Add("activeBackupSets", __w);
                }
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._invalidFile)
                {
                    var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray();
                    foreach (var __s in this._invalidFile)
                    {
                        AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__s.ToString()) : null, __r.Add);
                    }
                    container.Add("invalidFiles", __r);
                }
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._blobContainerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._blobContainerName.ToString()) : null, "blobContainerName", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._isFullBackupRestored ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._isFullBackupRestored) : null, "isFullBackupRestored", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._restoreBlockingReason)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._restoreBlockingReason.ToString()) : null, "restoreBlockingReason", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._completeRestoreErrorMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._completeRestoreErrorMessage.ToString()) : null, "completeRestoreErrorMessage", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._fileUploadBlockingError)
                {
                    var __m = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray();
                    foreach (var __n in this._fileUploadBlockingError)
                    {
                        AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__n.ToString()) : null, __m.Add);
                    }
                    container.Add("fileUploadBlockingErrors", __m);
                }
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._currentRestoringFilename)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._currentRestoringFilename.ToString()) : null, "currentRestoringFilename", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._lastRestoredFilename)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._lastRestoredFilename.ToString()) : null, "lastRestoredFilename", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._pendingLogBackupsCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNumber((int)this._pendingLogBackupsCount) : null, "pendingLogBackupsCount", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
コード例 #21
0
        /// <summary>
        /// Serializes this instance of <see cref="SourceLocation" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="SourceLocation" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._fileShare ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._fileShare.ToJson(null, serializationMode) : null, "fileShare", container.Add);
            AddIf(null != this._azureBlob ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._azureBlob.ToJson(null, serializationMode) : null, "azureBlob", container.Add);
            AfterToJson(ref container);
            return(container);
        }
コード例 #22
0
        /// <summary>
        /// Serializes this instance of <see cref="SqlDbOfflineConfiguration" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="SqlDbOfflineConfiguration" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._offline ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._offline) : null, "offline", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
コード例 #23
0
        /// <summary>
        /// Serializes this instance of <see cref="OfflineConfiguration" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="OfflineConfiguration" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.JsonSerializable.ToJson(((Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.IAssociativeArray <global::System.Object>) this).AdditionalProperties, container);
            AfterToJson(ref container);
            return(container);
        }
コード例 #25
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.DataMigration.Runtime.Json.JsonObject json);
コード例 #26
0
        /// <summary>
        /// Serializes this instance of <see cref="SqlMigrationListResult" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="SqlMigrationListResult" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._value)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
コード例 #27
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 <paramref name= "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.DataMigration.Runtime.Json.JsonObject json, ref bool returnNow);
コード例 #28
0
        /// <summary>
        /// Serializes this instance of <see cref="Any" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="Any" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            __databaseMigrationProperties?.ToJson(container, serializationMode);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._migrationStatusDetail ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._migrationStatusDetail.ToJson(null, serializationMode) : null, "migrationStatusDetails", container.Add);
            }
            AddIf(null != this._targetSqlConnection ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._targetSqlConnection.ToJson(null, serializationMode) : null, "targetSqlConnection", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._offlineConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) this._offlineConfiguration.ToJson(null, serializationMode) : null, "offlineConfiguration", container.Add);
            }
            if (null != this._tableList)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.XNodeArray();
                foreach (var __x in this._tableList)
                {
                    AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                }
                container.Add("tableList", __w);
            }
            AfterToJson(ref container);
            return(container);
        }
コード例 #30
0
        /// <summary>
        /// Serializes this instance of <see cref="SqlConnectionInformation" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.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.DataMigration.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="SqlConnectionInformation" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._dataSource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._dataSource.ToString()) : null, "dataSource", container.Add);
            AddIf(null != (((object)this._authentication)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._authentication.ToString()) : null, "authentication", container.Add);
            AddIf(null != (((object)this._userName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._userName.ToString()) : null, "userName", container.Add);
            AddIf(null != (((object)this._password)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonString(this._password.ToString()) : null, "password", container.Add);
            AddIf(null != this._encryptConnection ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._encryptConnection) : null, "encryptConnection", container.Add);
            AddIf(null != this._trustServerCertificate ? (Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataMigration.Runtime.Json.JsonBoolean((bool)this._trustServerCertificate) : null, "trustServerCertificate", container.Add);
            AfterToJson(ref container);
            return(container);
        }