/// <summary> /// Update Zone /// </summary> /// <example> /// { /// "Name":"Name", /// "HeartbeatTolerance":10, /// "ZoneServices":"StorageZone, SharepointConnector, NetworkShareConnector" /// } /// </example> /// <remarks> /// Updates an existing zone /// </remarks> /// <param name="url"></param> /// <param name="zone"></param> /// <returns> /// The modified zone /// </returns> public IQuery<Zone> Update(Uri url, Zone zone) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<Zone>(Client); sfApiQuery.Uri(url); sfApiQuery.Body = zone; sfApiQuery.HttpMethod = "PATCH"; return sfApiQuery; }
/// <summary> /// Create Zone /// </summary> /// <example> /// { /// "Name":"Name", /// "HeartbeatTolerance":10, /// "ZoneServices":"StorageZone, SharepointConnector, NetworkShareConnector" /// } /// </example> /// <remarks> /// Creates a new Zone. /// </remarks> /// <returns> /// the created zone /// </returns> public IQuery<Zone> Create(Zone zone) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<Zone>(Client); sfApiQuery.From("Zones"); sfApiQuery.Body = zone; sfApiQuery.HttpMethod = "POST"; return sfApiQuery; }
public override void Copy(ODataObject source, JsonSerializer serializer) { if(source == null || serializer == null) return; base.Copy(source, serializer); var typedSource = source as StorageCenter; if(typedSource != null) { Zone = typedSource.Zone; Address = typedSource.Address; LocalAddress = typedSource.LocalAddress; ExternalAddress = typedSource.ExternalAddress; DefaultExternalUrl = typedSource.DefaultExternalUrl; HostName = typedSource.HostName; Services = typedSource.Services; Version = typedSource.Version; Enabled = typedSource.Enabled; LastHeartBeat = typedSource.LastHeartBeat; ExternalUrl = typedSource.ExternalUrl; MetadataProxyAddress = typedSource.MetadataProxyAddress; LastPingBack = typedSource.LastPingBack; Metadata = typedSource.Metadata; } else { JToken token; if(source.TryGetProperty("Zone", out token) && token.Type != JTokenType.Null) { Zone = (Zone)serializer.Deserialize(token.CreateReader(), typeof(Zone)); } if(source.TryGetProperty("Address", out token) && token.Type != JTokenType.Null) { Address = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("LocalAddress", out token) && token.Type != JTokenType.Null) { LocalAddress = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("ExternalAddress", out token) && token.Type != JTokenType.Null) { ExternalAddress = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("DefaultExternalUrl", out token) && token.Type != JTokenType.Null) { DefaultExternalUrl = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("HostName", out token) && token.Type != JTokenType.Null) { HostName = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("Services", out token) && token.Type != JTokenType.Null) { Services = (SafeEnum<ZoneService>)serializer.Deserialize(token.CreateReader(), typeof(SafeEnum<ZoneService>)); } if(source.TryGetProperty("Version", out token) && token.Type != JTokenType.Null) { Version = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("Enabled", out token) && token.Type != JTokenType.Null) { Enabled = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?)); } if(source.TryGetProperty("LastHeartBeat", out token) && token.Type != JTokenType.Null) { LastHeartBeat = (DateTime?)serializer.Deserialize(token.CreateReader(), typeof(DateTime?)); } if(source.TryGetProperty("ExternalUrl", out token) && token.Type != JTokenType.Null) { ExternalUrl = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("MetadataProxyAddress", out token) && token.Type != JTokenType.Null) { MetadataProxyAddress = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("LastPingBack", out token) && token.Type != JTokenType.Null) { LastPingBack = (DateTime?)serializer.Deserialize(token.CreateReader(), typeof(DateTime?)); } if(source.TryGetProperty("Metadata", out token) && token.Type != JTokenType.Null) { Metadata = (IEnumerable<Metadata>)serializer.Deserialize(token.CreateReader(), typeof(IEnumerable<Metadata>)); } } }
public override void Copy(ODataObject source, JsonSerializer serializer) { if(source == null || serializer == null) return; base.Copy(source, serializer); var typedSource = source as Item; if(typedSource != null) { Name = typedSource.Name; FileName = typedSource.FileName; Creator = typedSource.Creator; Parent = typedSource.Parent; AccessControls = typedSource.AccessControls; Zone = typedSource.Zone; CreationDate = typedSource.CreationDate; ProgenyEditDate = typedSource.ProgenyEditDate; ClientCreatedDate = typedSource.ClientCreatedDate; ClientModifiedDate = typedSource.ClientModifiedDate; ExpirationDate = typedSource.ExpirationDate; Description = typedSource.Description; DiskSpaceLimit = typedSource.DiskSpaceLimit; IsHidden = typedSource.IsHidden; BandwidthLimitInMB = typedSource.BandwidthLimitInMB; Owner = typedSource.Owner; Account = typedSource.Account; FileSizeInKB = typedSource.FileSizeInKB; Path = typedSource.Path; CreatorFirstName = typedSource.CreatorFirstName; CreatorLastName = typedSource.CreatorLastName; ExpirationDays = typedSource.ExpirationDays; FileSizeBytes = typedSource.FileSizeBytes; PreviewStatus = typedSource.PreviewStatus; PreviewPlatformsSupported = typedSource.PreviewPlatformsSupported; MaxPreviewSize = typedSource.MaxPreviewSize; HasPendingDeletion = typedSource.HasPendingDeletion; AssociatedFolderTemplateID = typedSource.AssociatedFolderTemplateID; IsTemplateOwned = typedSource.IsTemplateOwned; HasPermissionInfo = typedSource.HasPermissionInfo; State = typedSource.State; StreamID = typedSource.StreamID; CreatorNameShort = typedSource.CreatorNameShort; HasMultipleVersions = typedSource.HasMultipleVersions; Metadata = typedSource.Metadata; ESignatureDocument = typedSource.ESignatureDocument; } else { JToken token; if(source.TryGetProperty("Name", out token) && token.Type != JTokenType.Null) { Name = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("FileName", out token) && token.Type != JTokenType.Null) { FileName = (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("Parent", out token) && token.Type != JTokenType.Null) { Parent = (Item)serializer.Deserialize(token.CreateReader(), typeof(Item)); } if(source.TryGetProperty("AccessControls", out token) && token.Type != JTokenType.Null) { AccessControls = (IEnumerable<AccessControl>)serializer.Deserialize(token.CreateReader(), typeof(IEnumerable<AccessControl>)); } if(source.TryGetProperty("Zone", out token) && token.Type != JTokenType.Null) { Zone = (Zone)serializer.Deserialize(token.CreateReader(), typeof(Zone)); } if(source.TryGetProperty("CreationDate", out token) && token.Type != JTokenType.Null) { CreationDate = (DateTime?)serializer.Deserialize(token.CreateReader(), typeof(DateTime?)); } if(source.TryGetProperty("ProgenyEditDate", out token) && token.Type != JTokenType.Null) { ProgenyEditDate = (DateTime?)serializer.Deserialize(token.CreateReader(), typeof(DateTime?)); } if(source.TryGetProperty("ClientCreatedDate", out token) && token.Type != JTokenType.Null) { ClientCreatedDate = (DateTime?)serializer.Deserialize(token.CreateReader(), typeof(DateTime?)); } if(source.TryGetProperty("ClientModifiedDate", out token) && token.Type != JTokenType.Null) { ClientModifiedDate = (DateTime?)serializer.Deserialize(token.CreateReader(), typeof(DateTime?)); } if(source.TryGetProperty("ExpirationDate", out token) && token.Type != JTokenType.Null) { ExpirationDate = (DateTime?)serializer.Deserialize(token.CreateReader(), typeof(DateTime?)); } if(source.TryGetProperty("Description", out token) && token.Type != JTokenType.Null) { Description = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("DiskSpaceLimit", out token) && token.Type != JTokenType.Null) { DiskSpaceLimit = (int?)serializer.Deserialize(token.CreateReader(), typeof(int?)); } if(source.TryGetProperty("IsHidden", out token) && token.Type != JTokenType.Null) { IsHidden = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?)); } if(source.TryGetProperty("BandwidthLimitInMB", out token) && token.Type != JTokenType.Null) { BandwidthLimitInMB = (int?)serializer.Deserialize(token.CreateReader(), typeof(int?)); } if(source.TryGetProperty("Owner", out token) && token.Type != JTokenType.Null) { Owner = (User)serializer.Deserialize(token.CreateReader(), typeof(User)); } if(source.TryGetProperty("Account", out token) && token.Type != JTokenType.Null) { Account = (Account)serializer.Deserialize(token.CreateReader(), typeof(Account)); } if(source.TryGetProperty("FileSizeInKB", out token) && token.Type != JTokenType.Null) { FileSizeInKB = (int?)serializer.Deserialize(token.CreateReader(), typeof(int?)); } if(source.TryGetProperty("Path", out token) && token.Type != JTokenType.Null) { Path = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("CreatorFirstName", out token) && token.Type != JTokenType.Null) { CreatorFirstName = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("CreatorLastName", out token) && token.Type != JTokenType.Null) { CreatorLastName = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("ExpirationDays", out token) && token.Type != JTokenType.Null) { ExpirationDays = (int?)serializer.Deserialize(token.CreateReader(), typeof(int?)); } if(source.TryGetProperty("FileSizeBytes", out token) && token.Type != JTokenType.Null) { FileSizeBytes = (long?)serializer.Deserialize(token.CreateReader(), typeof(long?)); } if(source.TryGetProperty("PreviewStatus", out token) && token.Type != JTokenType.Null) { PreviewStatus = (SafeEnum<PreviewStatus>)serializer.Deserialize(token.CreateReader(), typeof(SafeEnum<PreviewStatus>)); } if(source.TryGetProperty("PreviewPlatformsSupported", out token) && token.Type != JTokenType.Null) { PreviewPlatformsSupported = (IEnumerable<PreviewPlatformInfo>)serializer.Deserialize(token.CreateReader(), typeof(IEnumerable<PreviewPlatformInfo>)); } if(source.TryGetProperty("MaxPreviewSize", out token) && token.Type != JTokenType.Null) { MaxPreviewSize = (int?)serializer.Deserialize(token.CreateReader(), typeof(int?)); } if(source.TryGetProperty("HasPendingDeletion", out token) && token.Type != JTokenType.Null) { HasPendingDeletion = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?)); } if(source.TryGetProperty("AssociatedFolderTemplateID", out token) && token.Type != JTokenType.Null) { AssociatedFolderTemplateID = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("IsTemplateOwned", out token) && token.Type != JTokenType.Null) { IsTemplateOwned = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?)); } if(source.TryGetProperty("HasPermissionInfo", out token) && token.Type != JTokenType.Null) { HasPermissionInfo = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?)); } if(source.TryGetProperty("State", out token) && token.Type != JTokenType.Null) { State = (int?)serializer.Deserialize(token.CreateReader(), typeof(int?)); } if(source.TryGetProperty("StreamID", out token) && token.Type != JTokenType.Null) { StreamID = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("CreatorNameShort", out token) && token.Type != JTokenType.Null) { CreatorNameShort = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("HasMultipleVersions", out token) && token.Type != JTokenType.Null) { HasMultipleVersions = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?)); } if(source.TryGetProperty("Metadata", out token) && token.Type != JTokenType.Null) { Metadata = (IEnumerable<Metadata>)serializer.Deserialize(token.CreateReader(), typeof(IEnumerable<Metadata>)); } if(source.TryGetProperty("ESignatureDocument", out token) && token.Type != JTokenType.Null) { ESignatureDocument = (ESignature)serializer.Deserialize(token.CreateReader(), typeof(ESignature)); } } }
public override void Copy(ODataObject source, JsonSerializer serializer) { if(source == null || serializer == null) return; base.Copy(source, serializer); var typedSource = source as Share; if(typedSource != null) { AliasID = typedSource.AliasID; ShareType = typedSource.ShareType; Title = typedSource.Title; HasSentMessage = typedSource.HasSentMessage; SentMessageTitle = typedSource.SentMessageTitle; RequireLogin = typedSource.RequireLogin; RequireUserInfo = typedSource.RequireUserInfo; Parent = typedSource.Parent; Creator = typedSource.Creator; User = typedSource.User; Items = typedSource.Items; CreationDate = typedSource.CreationDate; ExpirationDate = typedSource.ExpirationDate; MaxDownloads = typedSource.MaxDownloads; TotalDownloads = typedSource.TotalDownloads; IsViewOnly = typedSource.IsViewOnly; TrackUntilDate = typedSource.TrackUntilDate; SendFrequency = typedSource.SendFrequency; SendInterval = typedSource.SendInterval; LastDateSent = typedSource.LastDateSent; IsConsumed = typedSource.IsConsumed; IsRead = typedSource.IsRead; IsArchived = typedSource.IsArchived; SendTool = typedSource.SendTool; SendMethod = typedSource.SendMethod; UsesStreamIDs = typedSource.UsesStreamIDs; Uri = typedSource.Uri; Recipients = typedSource.Recipients; Zone = typedSource.Zone; Signature = typedSource.Signature; HasRemoteChildren = typedSource.HasRemoteChildren; Redirection = typedSource.Redirection; ShareSubType = typedSource.ShareSubType; } else { JToken token; if(source.TryGetProperty("AliasID", out token) && token.Type != JTokenType.Null) { AliasID = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("ShareType", out token) && token.Type != JTokenType.Null) { ShareType = (SafeEnum<ShareType>)serializer.Deserialize(token.CreateReader(), typeof(SafeEnum<ShareType>)); } if(source.TryGetProperty("Title", out token) && token.Type != JTokenType.Null) { Title = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("HasSentMessage", out token) && token.Type != JTokenType.Null) { HasSentMessage = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?)); } if(source.TryGetProperty("SentMessageTitle", out token) && token.Type != JTokenType.Null) { SentMessageTitle = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("RequireLogin", out token) && token.Type != JTokenType.Null) { RequireLogin = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?)); } if(source.TryGetProperty("RequireUserInfo", out token) && token.Type != JTokenType.Null) { RequireUserInfo = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?)); } if(source.TryGetProperty("Parent", out token) && token.Type != JTokenType.Null) { Parent = (Item)serializer.Deserialize(token.CreateReader(), typeof(Item)); } if(source.TryGetProperty("Creator", out token) && token.Type != JTokenType.Null) { Creator = (User)serializer.Deserialize(token.CreateReader(), typeof(User)); } if(source.TryGetProperty("User", out token) && token.Type != JTokenType.Null) { User = (User)serializer.Deserialize(token.CreateReader(), typeof(User)); } if(source.TryGetProperty("Items", out token) && token.Type != JTokenType.Null) { Items = (IEnumerable<Item>)serializer.Deserialize(token.CreateReader(), typeof(IEnumerable<Item>)); } if(source.TryGetProperty("CreationDate", out token) && token.Type != JTokenType.Null) { CreationDate = (DateTime?)serializer.Deserialize(token.CreateReader(), typeof(DateTime?)); } if(source.TryGetProperty("ExpirationDate", out token) && token.Type != JTokenType.Null) { ExpirationDate = (DateTime?)serializer.Deserialize(token.CreateReader(), typeof(DateTime?)); } if(source.TryGetProperty("MaxDownloads", out token) && token.Type != JTokenType.Null) { MaxDownloads = (int?)serializer.Deserialize(token.CreateReader(), typeof(int?)); } if(source.TryGetProperty("TotalDownloads", out token) && token.Type != JTokenType.Null) { TotalDownloads = (int?)serializer.Deserialize(token.CreateReader(), typeof(int?)); } if(source.TryGetProperty("IsViewOnly", out token) && token.Type != JTokenType.Null) { IsViewOnly = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?)); } if(source.TryGetProperty("TrackUntilDate", out token) && token.Type != JTokenType.Null) { TrackUntilDate = (DateTime?)serializer.Deserialize(token.CreateReader(), typeof(DateTime?)); } if(source.TryGetProperty("SendFrequency", out token) && token.Type != JTokenType.Null) { SendFrequency = (int?)serializer.Deserialize(token.CreateReader(), typeof(int?)); } if(source.TryGetProperty("SendInterval", out token) && token.Type != JTokenType.Null) { SendInterval = (int?)serializer.Deserialize(token.CreateReader(), typeof(int?)); } if(source.TryGetProperty("LastDateSent", out token) && token.Type != JTokenType.Null) { LastDateSent = (DateTime?)serializer.Deserialize(token.CreateReader(), typeof(DateTime?)); } if(source.TryGetProperty("IsConsumed", out token) && token.Type != JTokenType.Null) { IsConsumed = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?)); } if(source.TryGetProperty("IsRead", out token) && token.Type != JTokenType.Null) { IsRead = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?)); } if(source.TryGetProperty("IsArchived", out token) && token.Type != JTokenType.Null) { IsArchived = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?)); } if(source.TryGetProperty("SendTool", out token) && token.Type != JTokenType.Null) { SendTool = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("SendMethod", out token) && token.Type != JTokenType.Null) { SendMethod = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("UsesStreamIDs", out token) && token.Type != JTokenType.Null) { UsesStreamIDs = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?)); } if(source.TryGetProperty("Uri", out token) && token.Type != JTokenType.Null) { Uri = (Uri)serializer.Deserialize(token.CreateReader(), typeof(Uri)); } if(source.TryGetProperty("Recipients", out token) && token.Type != JTokenType.Null) { Recipients = (IEnumerable<ShareAlias>)serializer.Deserialize(token.CreateReader(), typeof(IEnumerable<ShareAlias>)); } if(source.TryGetProperty("Zone", out token) && token.Type != JTokenType.Null) { Zone = (Zone)serializer.Deserialize(token.CreateReader(), typeof(Zone)); } if(source.TryGetProperty("Signature", out token) && token.Type != JTokenType.Null) { Signature = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("HasRemoteChildren", out token) && token.Type != JTokenType.Null) { HasRemoteChildren = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?)); } if(source.TryGetProperty("Redirection", out token) && token.Type != JTokenType.Null) { Redirection = (Redirection)serializer.Deserialize(token.CreateReader(), typeof(Redirection)); } if(source.TryGetProperty("ShareSubType", out token) && token.Type != JTokenType.Null) { ShareSubType = (SafeEnum<ShareSubType>)serializer.Deserialize(token.CreateReader(), typeof(SafeEnum<ShareSubType>)); } } }
public override void Copy(ODataObject source, JsonSerializer serializer) { if(source == null || serializer == null) return; base.Copy(source, serializer); var typedSource = source as Redirection; if(typedSource != null) { Method = typedSource.Method; Root = typedSource.Root; Zone = typedSource.Zone; Domain = typedSource.Domain; Uri = typedSource.Uri; FormsUri = typedSource.FormsUri; SessionUri = typedSource.SessionUri; TokenUri = typedSource.TokenUri; SessionCheck = typedSource.SessionCheck; Body = typedSource.Body; Available = typedSource.Available; } else { JToken token; if(source.TryGetProperty("Method", out token) && token.Type != JTokenType.Null) { Method = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("Root", out token) && token.Type != JTokenType.Null) { Root = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("Zone", out token) && token.Type != JTokenType.Null) { Zone = (Zone)serializer.Deserialize(token.CreateReader(), typeof(Zone)); } if(source.TryGetProperty("Domain", out token) && token.Type != JTokenType.Null) { Domain = (object)serializer.Deserialize(token.CreateReader(), typeof(object)); } if(source.TryGetProperty("Uri", out token) && token.Type != JTokenType.Null) { Uri = (Uri)serializer.Deserialize(token.CreateReader(), typeof(Uri)); } if(source.TryGetProperty("FormsUri", out token) && token.Type != JTokenType.Null) { FormsUri = (Uri)serializer.Deserialize(token.CreateReader(), typeof(Uri)); } if(source.TryGetProperty("SessionUri", out token) && token.Type != JTokenType.Null) { SessionUri = (Uri)serializer.Deserialize(token.CreateReader(), typeof(Uri)); } if(source.TryGetProperty("TokenUri", out token) && token.Type != JTokenType.Null) { TokenUri = (Uri)serializer.Deserialize(token.CreateReader(), typeof(Uri)); } if(source.TryGetProperty("SessionCheck", out token) && token.Type != JTokenType.Null) { SessionCheck = (bool)serializer.Deserialize(token.CreateReader(), typeof(bool)); } if(source.TryGetProperty("Body", out token) && token.Type != JTokenType.Null) { Body = (string)serializer.Deserialize(token.CreateReader(), typeof(string)); } if(source.TryGetProperty("Available", out token) && token.Type != JTokenType.Null) { Available = (bool)serializer.Deserialize(token.CreateReader(), typeof(bool)); } } }