示例#1
0
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as DownloadSpecification;

            if (typedSource != null)
            {
                DownloadToken         = typedSource.DownloadToken;
                PrepareXmlInfo        = typedSource.PrepareXmlInfo;
                DownloadUrl           = typedSource.DownloadUrl;
                DownloadPrepStartURL  = typedSource.DownloadPrepStartURL;
                DownloadPrepStatusURL = typedSource.DownloadPrepStatusURL;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("DownloadToken", out token) && token.Type != JTokenType.Null)
                {
                    DownloadToken = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
                if (source.TryGetProperty("PrepareXmlInfo", out token) && token.Type != JTokenType.Null)
                {
                    PrepareXmlInfo = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
                if (source.TryGetProperty("DownloadUrl", out token) && token.Type != JTokenType.Null)
                {
                    DownloadUrl = (Uri)serializer.Deserialize(token.CreateReader(), typeof(Uri));
                }
                if (source.TryGetProperty("DownloadPrepStartURL", out token) && token.Type != JTokenType.Null)
                {
                    DownloadPrepStartURL = (Uri)serializer.Deserialize(token.CreateReader(), typeof(Uri));
                }
                if (source.TryGetProperty("DownloadPrepStatusURL", out token) && token.Type != JTokenType.Null)
                {
                    DownloadPrepStatusURL = (Uri)serializer.Deserialize(token.CreateReader(), typeof(Uri));
                }
            }
        }
示例#2
0
        public virtual void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }

            var typedSource = source as ODataObject;

            MetadataUrl = typedSource.MetadataUrl;
            __type      = typedSource.__type;
            Id          = typedSource.Id;
            url         = typedSource.url;
            Dictionary <string, JToken> properties;

            if (typedSource.TryGetProperty("Properties", out properties))
            {
                this.AddProperty("Properties", properties);
            }
        }
示例#3
0
		public override void Copy(ODataObject source, JsonSerializer serializer)
		{
			if(source == null || serializer == null) return;
			base.Copy(source, serializer);

			var typedSource = source as PhoneSupport;
			if(typedSource != null)
			{
				CountryCode = typedSource.CountryCode;
				AreaCode = typedSource.AreaCode;
				Number = typedSource.Number;
				Availability = typedSource.Availability;
				UTCOffsetMins = typedSource.UTCOffsetMins;
			}
			else
			{
				JToken token;
				if(source.TryGetProperty("CountryCode", out token) && token.Type != JTokenType.Null)
				{
					CountryCode = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
				}
				if(source.TryGetProperty("AreaCode", out token) && token.Type != JTokenType.Null)
				{
					AreaCode = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
				}
				if(source.TryGetProperty("Number", out token) && token.Type != JTokenType.Null)
				{
					Number = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
				}
				if(source.TryGetProperty("Availability", out token) && token.Type != JTokenType.Null)
				{
					Availability = (IEnumerable<DailyAvailability>)serializer.Deserialize(token.CreateReader(), typeof(IEnumerable<DailyAvailability>));
				}
				if(source.TryGetProperty("UTCOffsetMins", out token) && token.Type != JTokenType.Null)
				{
					UTCOffsetMins = (int)serializer.Deserialize(token.CreateReader(), typeof(int));
				}
			}
		}
示例#4
0
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as Capability;

            if (typedSource != null)
            {
                Name    = typedSource.Name;
                Version = typedSource.Version;
                ScopedHostsAndProviders = typedSource.ScopedHostsAndProviders;
                SupportedDataTypes      = typedSource.SupportedDataTypes;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("Name", out token) && token.Type != JTokenType.Null)
                {
                    Name = (SafeEnum <CapabilityName>)serializer.Deserialize(token.CreateReader(), typeof(SafeEnum <CapabilityName>));
                }
                if (source.TryGetProperty("Version", out token) && token.Type != JTokenType.Null)
                {
                    Version = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
                if (source.TryGetProperty("ScopedHostsAndProviders", out token) && token.Type != JTokenType.Null)
                {
                    ScopedHostsAndProviders = (IEnumerable <string>)serializer.Deserialize(token.CreateReader(), typeof(IEnumerable <string>));
                }
                if (source.TryGetProperty("SupportedDataTypes", out token) && token.Type != JTokenType.Null)
                {
                    SupportedDataTypes = (IEnumerable <string>)serializer.Deserialize(token.CreateReader(), typeof(IEnumerable <string>));
                }
            }
        }
示例#5
0
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as QueryPaging;

            if (typedSource != null)
            {
                PageNumber = typedSource.PageNumber;
                PageSize   = typedSource.PageSize;
                Count      = typedSource.Count;
                Skip       = typedSource.Skip;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("PageNumber", out token) && token.Type != JTokenType.Null)
                {
                    PageNumber = (int)serializer.Deserialize(token.CreateReader(), typeof(int));
                }
                if (source.TryGetProperty("PageSize", out token) && token.Type != JTokenType.Null)
                {
                    PageSize = (int)serializer.Deserialize(token.CreateReader(), typeof(int));
                }
                if (source.TryGetProperty("Count", out token) && token.Type != JTokenType.Null)
                {
                    Count = (int)serializer.Deserialize(token.CreateReader(), typeof(int));
                }
                if (source.TryGetProperty("Skip", out token) && token.Type != JTokenType.Null)
                {
                    Skip = (int)serializer.Deserialize(token.CreateReader(), typeof(int));
                }
            }
        }
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as AccessControlParam;

            if (typedSource != null)
            {
                AccessControl = typedSource.AccessControl;
                NotifyUser    = typedSource.NotifyUser;
                NotifyMessage = typedSource.NotifyMessage;
                Recursive     = typedSource.Recursive;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("AccessControl", out token) && token.Type != JTokenType.Null)
                {
                    AccessControl = (AccessControl)serializer.Deserialize(token.CreateReader(), typeof(AccessControl));
                }
                if (source.TryGetProperty("NotifyUser", out token) && token.Type != JTokenType.Null)
                {
                    NotifyUser = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
                }
                if (source.TryGetProperty("NotifyMessage", out token) && token.Type != JTokenType.Null)
                {
                    NotifyMessage = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
                if (source.TryGetProperty("Recursive", out token) && token.Type != JTokenType.Null)
                {
                    Recursive = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
                }
            }
        }
示例#7
0
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as Principal;

            if (typedSource != null)
            {
                Name     = typedSource.Name;
                Email    = typedSource.Email;
                Username = typedSource.Username;
                Domain   = typedSource.Domain;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("Name", out token) && token.Type != JTokenType.Null)
                {
                    Name = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
                if (source.TryGetProperty("Email", out token) && token.Type != JTokenType.Null)
                {
                    Email = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
                if (source.TryGetProperty("Username", out token) && token.Type != JTokenType.Null)
                {
                    Username = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
                if (source.TryGetProperty("Domain", out token) && token.Type != JTokenType.Null)
                {
                    Domain = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
            }
        }
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as TenantAccountCreationParameters;

            if (typedSource != null)
            {
                PartnerAccountId  = typedSource.PartnerAccountId;
                TenantAccountId   = typedSource.TenantAccountId;
                PartnerAdminEmail = typedSource.PartnerAdminEmail;
                MultiTenantZoneId = typedSource.MultiTenantZoneId;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("PartnerAccountId", out token) && token.Type != JTokenType.Null)
                {
                    PartnerAccountId = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
                if (source.TryGetProperty("TenantAccountId", out token) && token.Type != JTokenType.Null)
                {
                    TenantAccountId = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
                if (source.TryGetProperty("PartnerAdminEmail", out token) && token.Type != JTokenType.Null)
                {
                    PartnerAdminEmail = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
                if (source.TryGetProperty("MultiTenantZoneId", out token) && token.Type != JTokenType.Null)
                {
                    MultiTenantZoneId = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
            }
        }
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as MarketAnalytics;

            if (typedSource != null)
            {
                ConversionIndex  = typedSource.ConversionIndex;
                ConversionIndex2 = typedSource.ConversionIndex2;
                LtvIndex         = typedSource.LtvIndex;
                PlanValue        = typedSource.PlanValue;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("ConversionIndex", out token) && token.Type != JTokenType.Null)
                {
                    ConversionIndex = (decimal?)serializer.Deserialize(token.CreateReader(), typeof(decimal?));
                }
                if (source.TryGetProperty("ConversionIndex2", out token) && token.Type != JTokenType.Null)
                {
                    ConversionIndex2 = (decimal?)serializer.Deserialize(token.CreateReader(), typeof(decimal?));
                }
                if (source.TryGetProperty("LtvIndex", out token) && token.Type != JTokenType.Null)
                {
                    LtvIndex = (decimal?)serializer.Deserialize(token.CreateReader(), typeof(decimal?));
                }
                if (source.TryGetProperty("PlanValue", out token) && token.Type != JTokenType.Null)
                {
                    PlanValue = (decimal?)serializer.Deserialize(token.CreateReader(), typeof(decimal?));
                }
            }
        }
示例#10
0
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as FolderTemplate;

            if (typedSource != null)
            {
                Name        = typedSource.Name;
                Description = typedSource.Description;
                Creator     = typedSource.Creator;
                Items       = typedSource.Items;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("Name", out token) && token.Type != JTokenType.Null)
                {
                    Name = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
                if (source.TryGetProperty("Description", out token) && token.Type != JTokenType.Null)
                {
                    Description = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
                if (source.TryGetProperty("Creator", out token) && token.Type != JTokenType.Null)
                {
                    Creator = (User)serializer.Deserialize(token.CreateReader(), typeof(User));
                }
                if (source.TryGetProperty("Items", out token) && token.Type != JTokenType.Null)
                {
                    Items = (IEnumerable <FolderTemplateItem>)serializer.Deserialize(token.CreateReader(), typeof(IEnumerable <FolderTemplateItem>));
                }
            }
        }
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as ResetPasswordRequest;

            if (typedSource != null)
            {
                Token     = typedSource.Token;
                Password  = typedSource.Password;
                Subdomain = typedSource.Subdomain;
                Tool      = typedSource.Tool;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("Token", out token) && token.Type != JTokenType.Null)
                {
                    Token = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
                if (source.TryGetProperty("Password", out token) && token.Type != JTokenType.Null)
                {
                    Password = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
                if (source.TryGetProperty("Subdomain", out token) && token.Type != JTokenType.Null)
                {
                    Subdomain = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
                if (source.TryGetProperty("Tool", out token) && token.Type != JTokenType.Null)
                {
                    Tool = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
            }
        }
示例#12
0
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as TwoFactorAuthApp;

            if (typedSource != null)
            {
                Name          = typedSource.Name;
                LastLoginDate = typedSource.LastLoginDate;
                PasscodeType  = typedSource.PasscodeType;
                UserId        = typedSource.UserId;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("Name", out token) && token.Type != JTokenType.Null)
                {
                    Name = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
                if (source.TryGetProperty("LastLoginDate", out token) && token.Type != JTokenType.Null)
                {
                    LastLoginDate = (DateTime?)serializer.Deserialize(token.CreateReader(), typeof(DateTime?));
                }
                if (source.TryGetProperty("PasscodeType", out token) && token.Type != JTokenType.Null)
                {
                    PasscodeType = (SafeEnum <TwoFactorAuthPasscodeType>)serializer.Deserialize(token.CreateReader(), typeof(SafeEnum <TwoFactorAuthPasscodeType>));
                }
                if (source.TryGetProperty("UserId", out token) && token.Type != JTokenType.Null)
                {
                    UserId = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
            }
        }
示例#13
0
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as BillingContact;

            if (typedSource != null)
            {
                FirstName    = typedSource.FirstName;
                LastName     = typedSource.LastName;
                EmailAddress = typedSource.EmailAddress;
                Password     = typedSource.Password;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("FirstName", out token) && token.Type != JTokenType.Null)
                {
                    FirstName = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
                if (source.TryGetProperty("LastName", out token) && token.Type != JTokenType.Null)
                {
                    LastName = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
                if (source.TryGetProperty("EmailAddress", out token) && token.Type != JTokenType.Null)
                {
                    EmailAddress = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
                if (source.TryGetProperty("Password", out token) && token.Type != JTokenType.Null)
                {
                    Password = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
            }
        }
示例#14
0
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as AccountZoneUsage;

            if (typedSource != null)
            {
                TotalFileSizeBytes = typedSource.TotalFileSizeBytes;
                Zone            = typedSource.Zone;
                RootFolderCount = typedSource.RootFolderCount;
                FileCount       = typedSource.FileCount;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("TotalFileSizeBytes", out token) && token.Type != JTokenType.Null)
                {
                    TotalFileSizeBytes = (long?)serializer.Deserialize(token.CreateReader(), typeof(long?));
                }
                if (source.TryGetProperty("Zone", out token) && token.Type != JTokenType.Null)
                {
                    Zone = (Zone)serializer.Deserialize(token.CreateReader(), typeof(Zone));
                }
                if (source.TryGetProperty("RootFolderCount", out token) && token.Type != JTokenType.Null)
                {
                    RootFolderCount = (long?)serializer.Deserialize(token.CreateReader(), typeof(long?));
                }
                if (source.TryGetProperty("FileCount", out token) && token.Type != JTokenType.Null)
                {
                    FileCount = (long?)serializer.Deserialize(token.CreateReader(), typeof(long?));
                }
            }
        }
示例#15
0
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as FileLock;

            if (typedSource != null)
            {
                LockId = typedSource.LockId;
                Owner  = typedSource.Owner;
                ExpirationTimeInMinutes = typedSource.ExpirationTimeInMinutes;
                ExpirationDate          = typedSource.ExpirationDate;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("LockId", out token) && token.Type != JTokenType.Null)
                {
                    LockId = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
                if (source.TryGetProperty("Owner", out token) && token.Type != JTokenType.Null)
                {
                    Owner = (Principal)serializer.Deserialize(token.CreateReader(), typeof(Principal));
                }
                if (source.TryGetProperty("ExpirationTimeInMinutes", out token) && token.Type != JTokenType.Null)
                {
                    ExpirationTimeInMinutes = (int?)serializer.Deserialize(token.CreateReader(), typeof(int?));
                }
                if (source.TryGetProperty("ExpirationDate", out token) && token.Type != JTokenType.Null)
                {
                    ExpirationDate = (DateTime?)serializer.Deserialize(token.CreateReader(), typeof(DateTime?));
                }
            }
        }
示例#16
0
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as SearchQuery;

            if (typedSource != null)
            {
                Query            = typedSource.Query;
                Paging           = typedSource.Paging;
                Sort             = typedSource.Sort;
                TimeoutInSeconds = typedSource.TimeoutInSeconds;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("Query", out token) && token.Type != JTokenType.Null)
                {
                    Query = (Query)serializer.Deserialize(token.CreateReader(), typeof(Query));
                }
                if (source.TryGetProperty("Paging", out token) && token.Type != JTokenType.Null)
                {
                    Paging = (QueryPaging)serializer.Deserialize(token.CreateReader(), typeof(QueryPaging));
                }
                if (source.TryGetProperty("Sort", out token) && token.Type != JTokenType.Null)
                {
                    Sort = (QuerySorting)serializer.Deserialize(token.CreateReader(), typeof(QuerySorting));
                }
                if (source.TryGetProperty("TimeoutInSeconds", out token) && token.Type != JTokenType.Null)
                {
                    TimeoutInSeconds = (int)serializer.Deserialize(token.CreateReader(), typeof(int));
                }
            }
        }
示例#17
0
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as ServicesCollection;

            if (typedSource != null)
            {
                RightSignature = typedSource.RightSignature;
                ShareConnect   = typedSource.ShareConnect;
                ShareFileLegal = typedSource.ShareFileLegal;
                Podio          = typedSource.Podio;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("RightSignature", out token) && token.Type != JTokenType.Null)
                {
                    RightSignature = (Service)serializer.Deserialize(token.CreateReader(), typeof(Service));
                }
                if (source.TryGetProperty("ShareConnect", out token) && token.Type != JTokenType.Null)
                {
                    ShareConnect = (Service)serializer.Deserialize(token.CreateReader(), typeof(Service));
                }
                if (source.TryGetProperty("ShareFileLegal", out token) && token.Type != JTokenType.Null)
                {
                    ShareFileLegal = (Service)serializer.Deserialize(token.CreateReader(), typeof(Service));
                }
                if (source.TryGetProperty("Podio", out token) && token.Type != JTokenType.Null)
                {
                    Podio = (Service)serializer.Deserialize(token.CreateReader(), typeof(Service));
                }
            }
        }
示例#18
0
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as ShareItemHistory;

            if (typedSource != null)
            {
                Title        = typedSource.Title;
                Recipient    = typedSource.Recipient;
                ActivityType = typedSource.ActivityType;
                DownloadDate = typedSource.DownloadDate;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("Title", out token) && token.Type != JTokenType.Null)
                {
                    Title = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
                if (source.TryGetProperty("Recipient", out token) && token.Type != JTokenType.Null)
                {
                    Recipient = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
                if (source.TryGetProperty("ActivityType", out token) && token.Type != JTokenType.Null)
                {
                    ActivityType = (SafeEnum <ItemAction>)serializer.Deserialize(token.CreateReader(), typeof(SafeEnum <ItemAction>));
                }
                if (source.TryGetProperty("DownloadDate", out token) && token.Type != JTokenType.Null)
                {
                    DownloadDate = (DateTime?)serializer.Deserialize(token.CreateReader(), typeof(DateTime?));
                }
            }
        }
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as ZoneUsageBreakdown;

            if (typedSource != null)
            {
                ZonesToUsage = typedSource.ZonesToUsage;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("ZonesToUsage", out token) && token.Type != JTokenType.Null)
                {
                    ZonesToUsage = (IDictionary <string, AccountZoneUsage>)serializer.Deserialize(token.CreateReader(), typeof(IDictionary <string, AccountZoneUsage>));
                }
            }
        }
示例#20
0
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as ItemDlpInfo;

            if (typedSource != null)
            {
                Status = typedSource.Status;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("Status", out token) && token.Type != JTokenType.Null)
                {
                    Status = (SafeEnum <DlpStatus>)serializer.Deserialize(token.CreateReader(), typeof(SafeEnum <DlpStatus>));
                }
            }
        }
示例#21
0
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as StorageSettings;

            if (typedSource != null)
            {
                StorageZoneId = typedSource.StorageZoneId;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("StorageZoneId", out token) && token.Type != JTokenType.Null)
                {
                    StorageZoneId = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
            }
        }
示例#22
0
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as FileAndFolderPolicy;

            if (typedSource != null)
            {
                Settings = typedSource.Settings;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("Settings", out token) && token.Type != JTokenType.Null)
                {
                    Settings = (FileAndFolderSettings)serializer.Deserialize(token.CreateReader(), typeof(FileAndFolderSettings));
                }
            }
        }
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as RequireSubdomainResult;

            if (typedSource != null)
            {
                RequireSubdomain = typedSource.RequireSubdomain;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("RequireSubdomain", out token) && token.Type != JTokenType.Null)
                {
                    RequireSubdomain = (bool)serializer.Deserialize(token.CreateReader(), typeof(bool));
                }
            }
        }
示例#24
0
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as ShareSettings;

            if (typedSource != null)
            {
                NotifyOnUse = typedSource.NotifyOnUse;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("NotifyOnUse", out token) && token.Type != JTokenType.Null)
                {
                    NotifyOnUse = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
                }
            }
        }
示例#25
0
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as EmailSupport;

            if (typedSource != null)
            {
                Email = typedSource.Email;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("Email", out token) && token.Type != JTokenType.Null)
                {
                    Email = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
            }
        }
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as BaseCspAccountParameters;

            if (typedSource != null)
            {
                SupportInfo = typedSource.SupportInfo;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("SupportInfo", out token) && token.Type != JTokenType.Null)
                {
                    SupportInfo = (Support)serializer.Deserialize(token.CreateReader(), typeof(Support));
                }
            }
        }
示例#27
0
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as Link;

            if (typedSource != null)
            {
                Uri = typedSource.Uri;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("Uri", out token) && token.Type != JTokenType.Null)
                {
                    Uri = (Uri)serializer.Deserialize(token.CreateReader(), typeof(Uri));
                }
            }
        }
示例#28
0
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as StorageCenterUrls;

            if (typedSource != null)
            {
                HealthStatsUrl = typedSource.HealthStatsUrl;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("HealthStatsUrl", out token) && token.Type != JTokenType.Null)
                {
                    HealthStatsUrl = (Uri)serializer.Deserialize(token.CreateReader(), typeof(Uri));
                }
            }
        }
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as ActivityReportFilter;

            if (typedSource != null)
            {
                ActivityTypes = typedSource.ActivityTypes;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("ActivityTypes", out token) && token.Type != JTokenType.Null)
                {
                    ActivityTypes = (IEnumerable <string>)serializer.Deserialize(token.CreateReader(), typeof(IEnumerable <string>));
                }
            }
        }
        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if (source == null || serializer == null)
            {
                return;
            }
            base.Copy(source, serializer);

            var typedSource = source as ForbiddenOAuthClientNameWords;

            if (typedSource != null)
            {
                Words = typedSource.Words;
            }
            else
            {
                JToken token;
                if (source.TryGetProperty("Words", out token) && token.Type != JTokenType.Null)
                {
                    Words = (IEnumerable <string>)serializer.Deserialize(token.CreateReader(), typeof(IEnumerable <string>));
                }
            }
        }