Example #1
0
        /// <summary>
        /// Gets the object from Json properties.
        /// </summary>
        /// <param name="reader">The <see cref="T: Newtonsoft.Json.JsonReader" /> to read from, reader must be placed at first property.</param>
        /// <returns>The object Value.</returns>
        internal static PartitionBackupConfigurationInfo GetFromJsonProperties(JsonReader reader)
        {
            var policyName          = default(string);
            var policyInheritedFrom = default(BackupPolicyScope?);
            var suspensionInfo      = default(BackupSuspensionInfo);
            var serviceName         = default(ServiceName);
            var partitionId         = default(PartitionId);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("PolicyName", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    policyName = reader.ReadValueAsString();
                }
                else if (string.Compare("PolicyInheritedFrom", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    policyInheritedFrom = BackupPolicyScopeConverter.Deserialize(reader);
                }
                else if (string.Compare("SuspensionInfo", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    suspensionInfo = BackupSuspensionInfoConverter.Deserialize(reader);
                }
                else if (string.Compare("ServiceName", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    serviceName = ServiceNameConverter.Deserialize(reader);
                }
                else if (string.Compare("PartitionId", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    partitionId = PartitionIdConverter.Deserialize(reader);
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            return(new PartitionBackupConfigurationInfo(
                       policyName: policyName,
                       policyInheritedFrom: policyInheritedFrom,
                       suspensionInfo: suspensionInfo,
                       serviceName: serviceName,
                       partitionId: partitionId));
        }
Example #2
0
        /// <summary>
        /// Gets the object from Json properties.
        /// </summary>
        /// <param name="reader">The <see cref="T: Newtonsoft.Json.JsonReader" /> to read from, reader must be placed at first property.</param>
        /// <returns>The object Value.</returns>
        internal static ApplicationBackupConfigurationInfo GetFromJsonProperties(JsonReader reader)
        {
            var policyName          = default(string);
            var policyInheritedFrom = default(BackupPolicyScope?);
            var suspensionInfo      = default(BackupSuspensionInfo);
            var applicationName     = default(ApplicationName);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("PolicyName", propName, StringComparison.Ordinal) == 0)
                {
                    policyName = reader.ReadValueAsString();
                }
                else if (string.Compare("PolicyInheritedFrom", propName, StringComparison.Ordinal) == 0)
                {
                    policyInheritedFrom = BackupPolicyScopeConverter.Deserialize(reader);
                }
                else if (string.Compare("SuspensionInfo", propName, StringComparison.Ordinal) == 0)
                {
                    suspensionInfo = BackupSuspensionInfoConverter.Deserialize(reader);
                }
                else if (string.Compare("ApplicationName", propName, StringComparison.Ordinal) == 0)
                {
                    applicationName = ApplicationNameConverter.Deserialize(reader);
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            return(new ApplicationBackupConfigurationInfo(
                       policyName: policyName,
                       policyInheritedFrom: policyInheritedFrom,
                       suspensionInfo: suspensionInfo,
                       applicationName: applicationName));
        }