Librarian API and Security API - C# Types |
A C F G I M P S T U V
A
C
F
FolderPermissionWithIdentities
FolderUpdatePermissionsRequest
G
I
M
P
S
T
U
V
AbstractItem
See also:
public class AbstractItem : AbstractItemBase
{
/// <summary>
/// Specifies the date and time when the item was created.
/// </summary>
public DateTime? CreatedDateTime { get; set; }
/// <summary>
/// Specifies the ID of the user who created the item.
/// </summary>
public string CreatedBy { get; set; }
/// <summary>
/// Specifies the item's metadata collection.
/// </summary>
public Dictionary<string, object> Metadata { get; set; }
/// <summary>
/// True if the item is marked for deletion; otherwise, false.
/// The item is deleted after a purge action is initiated.
/// </summary>
public bool IsDeleted { get; set; }
}
AbstractItemBase
public class AbstractItemBase
{
/// <summary>
/// Specifies the item's ID.
/// </summary>
public string ItemId { get; set; }
/// <summary>
/// Specifies the item's tenant ID.
/// </summary>
public string TenantId { get; set; }
/// <summary>
/// Specifies the item's name.
/// </summary>
public string Name { get; set; }
/// <summary>
/// Specifies the item's type.
/// </summary>
public virtual string Type { get; set; }
}
AbstractItemExtended
See also:
public class AbstractItemExtended : AbstractItem
{
/// <summary>
/// Specifies the item's space ID.
/// </summary>
public int SpaceId { get; set; }
/// <summary>
/// True if a file is locked; otherwise, false.
/// Files can be locked only when a user performs a checkout operation.
/// </summary>
public bool IsLocked { get; set; }
/// <summary>
/// True if a file is hidden; otherwise, false.
/// </summary>
public bool IsHidden { get; set; }
/// <summary>
/// True if a file is a temporary file; otherwise, false.
/// </summary>
public bool IsTemporary { get; set; }
/// <summary>
/// Specifies the ID of the user who locked the file.
/// </summary>
public string LockedByUser { get; set; }
/// <summary>
/// Specifies the file's checksum.
/// </summary>
public string Checksum { get; set; }
/// <summary>
/// Specifies the file's version.
/// </summary>
public Version Version { get; set; }
/// <summary>
/// Specifies the file's published version.
/// </summary>
public Version PublishedVersion { get; set; }
/// <summary>
/// True if the file is published; otherwise, false.
/// </summary>
public bool IsPublished { get; set; }
/// <summary>
/// Specifies the date and time when the file was last modified.
/// </summary>
public DateTime? ModifiedDateTime { get; set; }
/// <summary>
/// Specifies the date and time when the file was published.
/// </summary>
public DateTime? PublishedDateTime { get; set; }
/// <summary>
/// Specifies the ID of the user who last modified the file.
/// </summary>
public string ModifiedBy { get; set; }
/// <summary>
/// Specifies the ID of the user who published the file.
/// </summary>
public string PublishedBy { get; set; }
/// <summary>
/// Specifies the ID of the file's workflow state.
/// </summary>
public Guid WorkflowStateId { get; set; }
/// <summary>
/// Specifies the ID of the folder that contains the file.
/// </summary>
public string FolderId { get; set; }
/// <summary>
/// Specifies the file's size in bytes.
/// </summary>
public long Size { get; set; }
}
AddFileRequestBase
This is the base class for FileAddRequest. It provides the properties that can be set when a file is created.
public class FileAddRequestBase
{
/// <summary>
/// Specifies a comment for the file.
/// </summary>
public string Comment { get; set; }
/// <summary>
/// Specifies the file's content type (such as .txt, .jpg, and so on).
/// </summary>
public string FileContentType { get; set; }
/// <summary>
/// Specifies the file's encryption type and level.
/// Note: This parameter is only a label. All encryption and decryption is the responsibility of the client.
/// </summary>
public string Encryption { get; set; }
/// <summary>
/// True if inheriting permissions from the folder permissions. If InheritFromFolderPermissions
/// is true, the contents of the Permissions property are ignored.
/// </summary>
public bool InheritFromFolderPermissions { get; set; } = true;
/// <summary>
/// Specifies the file's metadata collection.
/// </summary>
public Dictionary<string, object> Metadata { get; set; }
/// <summary>
/// Specifies the file's permissions collection.
/// </summary>
public List<FilePermissionWithIdentities> Permissions { get; set; }
/// <summary>
/// True if the file should be hidden. When a file is hidden, it is excluded from
/// query responses unless it is specifically requested.
/// </summary>
public bool IsHidden { get; set; }
/// <summary>
/// Specifies the friendly version description.
/// </summary>
public string VersionDescription { get; set; }
}
Attachment
See also:
public class Attachment
{
/// <summary>
/// Specifies the attachment's ID.
/// </summary>
public string Id { get; set; }
/// <summary>
/// Specifies the attachment's name.
/// </summary>
public string Name { get; set; }
/// <summary>
/// Specifies the attachment's content type.
/// </summary>
public string ContentType { get; set; }
/// <summary>
/// Specifies a comment for the attachment.
/// </summary>
public string Comment { get; set; }
/// <summary>
/// Specifies the ID of the attachment's parent file.
/// </summary>
public string ParentFileId { get; set; }
/// <summary>
/// Specifies the version of the attachment's parent file.
/// </summary>
public Version ParentFileVersion { get; set; }
/// <summary>
/// Specifies the ID of the attachment's space.
/// </summary>
public int SpaceId { get; set; }
/// <summary>
/// Specifies the attachment's size.
/// </summary>
public long Size { get; set; }
/// <summary>
/// True if the attachment is to be copied to the updated or new version of the file; otherwise, false.
/// </summary>
public bool CopyForward { get; set; }
/// <summary>
/// Specifies the date and time when the attachment was created.
/// </summary>
public DateTime? CreatedDateTime { get; set; }
/// <summary>
/// Specifies the ID of the user who created the attachment.
/// </summary>
public User CreatedBy { get; set; }
/// <summary>
/// Specifies the date and time when the attachment was modified.
/// </summary>
public DateTime? ModifiedDateTime { get; set; }
/// <summary>
/// Specifies the ID of the user who modified the attachment.
/// </summary>
public User ModifiedBy { get; set; }
}
AttachmentAddRequest
public class AttachmentAddRequest
{
/// <summary>
/// Specifies the name of the attachment to be added.
/// </summary>
[JsonProperty(Required = Required.Always)]
public string Name { get; set; }
/// <summary>
/// Specifies a comment for the attachment to be added.
/// </summary>
[JsonProperty(Required = Required.AllowNull)]
public string Comment { get; set; }
/// <summary>
/// Specifies the content type of the attachment to be added, such as Preview.
/// </summary>
[JsonProperty(Required = Required.Always)]
public string ContentType { get; set; }
/// <summary>
/// True if the attachment is to be copied to the updated or new version of the file; otherwise, false.
/// </summary>
[JsonProperty(Required = Required.Always)]
public bool CopyForward { get; set; }
}
AttachmentDeleteRequest
public class AttachmentDeleteRequest
{
/// <summary>
/// Specifies a new comment for the file change history of the attachment's parent file.
/// </summary>
[JsonProperty(Required = Required.AllowNull)]
}
AttachmentRenameRequest
public class AttachmentRenameRequest
{
/// <summary>
/// Specifies the new name of the attachment.
/// </summary>
[JsonProperty(Required = Required.Always)]
public string Name { get; set; }
/// <summary>
/// Specifies a new comment for the attachment.
/// </summary>
[JsonProperty(Required = Required.Always)]
public string Comment { get; set; }
}
AttachmentUpdateRequest
public class AttachmentUpdateRequest
{
/// <summary>
/// Specifies a new comment for the updated attachment.
/// </summary>
[JsonProperty(Required = Required.AllowNull)]
public string Comment { get; set; }
}
ConfigurationSettings
This class is a structure that has a set of values that describe the configuration settings for the Librarian spaces. Currently, ConfigurationSettings provides access to a single setting.
See also:
public class ConfigurationSettings
{
/// <summary>
/// Specifies a map of alternative folder path URIs to actual folder path URIs.
/// </summary>
public UriAliases Aliases { get; set; }
}
File
See also:
public class File : AbstractItemExtended
{
/// <summary>
/// Specifies the ID and version of a file to use for indexing and retrieval.
/// </summary>
public string IdWithVersion { get; set; }
/// <summary>
/// Specifies the file's workflow status.
/// </summary>
public string FileStatus { get; set; }
/// <summary>
/// Specifies the file's content type (such as .txt, .jpg, and so on).
/// </summary>
public string FileContentType { get; set; }
/// <summary>
/// Specifies the file's encryption type and level.
/// Note: This parameter is only a label. All encryption and decryption is the responsibility of the client.
/// </summary>
public string Encryption { get; set; }
/// <summary>
/// True if the file is inheriting from the folder permissions; otherwise, false.
/// </summary>
public bool InheritFromFolderPermissions { get; set; }
/// <summary>
/// Specifies the file's permissions collection.
/// </summary>
public List<FilePermissionWithIdentities> Permissions { get; set; }
/// <summary>
/// Specifies a friendly version description.
/// </summary>
public string VersionDescription { get; set; }
/// <summary>
/// Specifies the file's attachments collection.
/// </summary>
public List<FileAttachment> Attachments { get; set; } = new List<FileAttachment>();
}
FileAddRequest
Specifies the name and location where a file is to be created.
See also:
public class FileAddRequest : FileAddRequestBase
{
/// <summary>
/// Specifies the file's name.
/// </summary>
public string Name { get; set; }
/// <summary>
/// Specifies the ID of the file's parent folder.
/// </summary>
public string FolderId { get; set; }
}
FileAddRequestBase
This is the base class for FileAddRequest. It provides the properties that can be set when a file is created.
See also:
public class FileAddRequestBase
{
/// <summary>
/// Specifies a comment for the file.
/// </summary>
public string Comment { get; set; }
/// <summary>
/// Specifies the file's content type (such as .txt, .jpg, and so on).
/// </summary>
public string FileContentType { get; set; }
/// <summary>
/// Specifies the file's encryption type and level.
/// Note: This parameter is only a label. All encryption and decryption is the responsibility of the client.
/// </summary>
public string Encryption { get; set; }
/// <summary>
/// True if inheriting permissions from the folder permissions. If InheritFromFolderPermissions
/// is true, the contents of the Permissions property are ignored.
/// </summary>
public bool InheritFromFolderPermissions { get; set; } = true;
/// <summary>
/// Specifies the file's metadata collection.
/// </summary>
public Dictionary<string, object> Metadata { get; set; }
/// <summary>
/// Specifies the file's permissions collection.
/// </summary>
public List<FilePermissionWithIdentities> Permissions { get; set; }
/// <summary>
/// True if the file should be hidden. When a file is hidden, it is excluded from
/// query responses unless it is specifically requested.
/// </summary>
public bool IsHidden { get; set; }
/// <summary>
/// Specifies a friendly version description.
/// </summary>
public string VersionDescription { get; set; }
}
FileAttachment
Attachments can be associated with a file. Every attachment automatically receives a unique AttachmentId value, and the AttachmentName value must be unique for the file. If the name for a new attachment already exists for the file, the new attachment overwrites the original attachment.
public class FileAttachment
{
/// <summary>
/// Specifies the ID of the file's attachment.
/// </summary>
public string AttachmentId { get; set; }
/// <summary>
/// Specifies the name of the file's attachment.
/// </summary>
public string AttachmentName { get; set; }
/// <summary>
/// Specifies the attachment's content type (such as .txt, .jpg, .btw, and so on).
/// Use this parameter to help users understand how the attachment can be processed.
/// </summary>
public string ContentType { get; set; }
/// <summary>
/// Specifies the attachment's size in bytes.
/// </summary>
public long Size { get; set; }
}
FileChange
Actions that are applied to a file (such as adding a comment, renaming, checking out, and so on) produce a historical log of file changes that can be reviewed. The records that this log maintains are represented by the FileChange class.
See also:
public class FileChange
{
/// <summary>
/// Specifies the ID of the file change history.
/// </summary>
public string Id { get; set; }
/// <summary>
/// Specifies the ID of the file's space.
/// </summary>
public int SpaceId { get; set; }
/// <summary>
/// Specifies the file's ID.
/// </summary>
public string FileId { get; set; }
/// <summary>
/// Specifies the ID of the file's parent folder.
/// </summary>
public string FolderId { get; set; }
/// <summary>
/// Specifies the file's name.
/// </summary>
public string Name { get; set; }
/// <summary>
/// Specifies the date and time when the file was created.
/// </summary>
public DateTime? CreatedDateTime { get; set; }
/// <summary>
/// Specifies the name of the user who created the file.
/// </summary>
public User CreatedBy { get; set; }
/// <summary>
/// Specifies the file's metadata collection.
/// </summary>
public Dictionary<string, object> Metadata { get; set; }
/// <summary>
/// True if the file is locked for checkout; otherwise, false.
/// </summary>
public bool IsLocked { get; set; }
/// <summary>
/// True if a file is hidden; otherwise, false.
/// </summary>
public bool IsHidden { get; set; }
/// <summary>
/// True if a file is a temporary file; otherwise, false.
/// </summary>
public bool IsTemporary { get; set; }
/// <summary>
/// Specifies the name of the user who locked the file for checkout.
/// </summary>
public User LockedByUser { get; set; }
/// <summary>
/// Specifies the file's version.
/// </summary>
public Version Version { get; set; }
/// <summary>
/// Specifies the file's published version.
/// </summary>
public Version PublishedVersion { get; set; }
/// <summary>
/// Specifies the date and time when the file was modified.
/// </summary>
public DateTime? ModifiedDateTime { get; set; }
/// <summary>
/// Specifies the date and time when the file was published.
/// </summary>
public DateTime? PublishedDateTime { get; set; }
/// <summary>
/// Specifies the file's file change action.
/// </summary>
public FileChangeAction Action { get; set; }
/// <summary>
/// Specifies the ID of the user who made the change to the file.
/// </summary>
public string ActionUserId { get; set; }
/// <summary>
/// Specifies a comment for the file.
/// </summary>
public string Comment { get; set; }
/// <summary>
/// Specifies the name of the user who last modified the file.
/// </summary>
public User ModifiedBy { get; set; }
/// <summary>
/// Specifies the name of the user who published the file.
/// </summary>
public User PublishedBy { get; set; }
/// <summary>
/// Specifies the file's size.
/// </summary>
public long Size { get; set; }
/// <summary>
/// True if the file is marked for deletion; otherwise, false.
/// The file can permanently be deleted by using the Purge action.
/// </summary>
public bool IsDeleted { get; set; }
/// <summary>
/// True if inheriting permissions from the folder permissions; otherwise, false.
/// </summary>
public bool InheritFromFolderPermissions { get; set; }
/// <summary>
/// Specifies a friendly version description.
/// </summary>
public string VersionDescription { get; set; }
/// <summary>
/// Specifies the file's attachments collection.
/// </summary>
public List<FileAttachment> Attachments { get; set; }
/// <summary>
/// Specifies the file's checksum at this history point.
/// </summary>
public string Checksum { get; set; }
}
FileChangeAction
This enumeration type represents the available actions for which a FileChange record will be created when a file is changed. The Uninitialized value exists to enforce the selection of a type.
public enum FileChangeAction
{
Uninitialized = 0,
Add,
Rename,
Move,
Copy,
Delete,
Undelete,
CheckOut,
CheckIn,
Revert,
AddComment,
EditComment,
AddMetadata,
UpdateMetadata,
DeleteMetadata,
DeleteAllMetadata,
ChangeState,
Transition,
Publish
}
FileChangeCommentRequest
public class FileChangeCommentRequest
{
/// <summary>
/// Specifies a comment for the file's file change.
/// </summary>
public string Comment { get; set; }
}
FileChangeList
See also:
public class FileChangeList
{
/// <summary>
/// Specifies the file's file changes collection.
/// </summary>
public List<FileChange> FileChange { get; set; } = new List<FileChange>();
/// <summary>
/// True if all the file changes have been requested; otherwise, false.
/// </summary>
public bool GetFileChangesRequestDone { get; set; }
/// <summary>
/// If the value of GetFileChangesRequestDone is false, then NextGetFileChangesRequest can be used to
/// retrieve the next set of file changes in the paged response.
/// </summary>
public GetFileChangeRequest NextGetFileChangesRequest { get; set; }
}
FileCloneRequest
public class FileCloneRequest
{
/// <summary>
/// Specifies the ID of the destination folder where the file is to be cloned.
/// </summary>
[JsonProperty(Required = Required.Always)]
public string DestinationFolderId { get; set; }
/// <summary>
/// Specifies the new file name.
/// </summary>
[JsonProperty(Required = Required.Always)]
public string FileName { get; set; }
}
FileCopyRequest
public class FileCopyRequest
{
/// <summary>
/// Specifies the name of the file's destination.
/// </summary>
public string DestinationName { get; set; }
/// <summary>
/// Specifies the ID of the file's new destination folder.
/// </summary>
public string DestinationFolderId { get; set; }
/// <summary>
/// Specifies a comment for the file copy operation.
/// </summary>
public string DestinationComment { get; set; }
}
FileMoveRequest
public class FileMoveRequest
{
/// <summary>
/// Specifies the ID of the file's new folder.
/// </summary>
public string FolderId { get; set; }
/// <summary>
/// Specifies a comment for the file move operation.
/// </summary>
public string Comment { get; set; }
}
FilePermission
This enumeration type represents the available permission types that can be applied to a file. The Uninitialized value exists to enforce the selection of a type.
public enum FilePermission
{
Uninitialized = 0,
Read,
Write,
Delete,
Purge
}
FilePermissions
public class FilePermissions
{
/// <summary>
/// Specifies the file's permissions collection.
/// </summary>
public List<FilePermissionWithIdentities> Permissions { get; set; }
/// <summary>
/// True if the file's permissions are explicit; false if the permissions are implicit.
/// </summary>
public bool IsExplicit { get; set; }
/// <summary>
/// Specifies the ID of the folder from which the permissions are inherited. Applies only when a file's permissions are implicit.
/// </summary>
public string PermissionsInheritedFromFolderId { get; set; }
}
FilePermissionWithIdentities
This class associates a specific file permission, such as Read or Write, with an identity. An identity can be a user ID, a group ID, or a role ID.
See also:
public class FilePermissionWithIdentities
{
/// <summary>
/// Specifies a file permission.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public FilePermission Permission { get; set; }
/// <summary>
/// Specifies the file permission's identities.
/// </summary>
public Dictionary<IdentityType, List<Identity>> GrantedTo { get; set; }
}
C# Example
/// Create a FilePermissionWithIdentities object that grants FilePermission.Read
/// access to a specific user, a specific userId, and any user who is a member of the group
/// that is identified by the groupId. This new filePermission object can then be applied
/// to a file.
var grants = new Dictionary<IdentityType, List<Identity>>();
grants.Add(IdentityType.User, new Identity() { Id=userId, DisplayName="Joe"});
grants.Add(IdentityType.Group, new Identity() { Id=groupId, DisplayName="Developers Group"})
var filePermission = new FilePermissionWithIdentities()
{
Permission = FilePermission.Read,
GrantedTo = grants
};
FileRenameRequest
public class FileRenameRequest
{
/// <summary>
/// Specifies the file's new name.
/// </summary>
public string Name { get; set; }
/// <summary>
/// Specifies a comment for the file rename operation.
/// </summary>
public string Comment { get; set; }
}
FileUpdateCheckInRequest
public class FileUpdateCheckInRequest : FileUpdateRequest
{
/// <summary>
/// Specifies a friendly version description.
/// </summary>
public string VersionDescription { get; set; }
}
FileUpdateIsHiddenRequest
public class FileUpdateIsHiddenRequest
{
/// <summary>
/// Specifies a comment for the file update operation.
/// </summary>
public string Comment { get; set; }
/// <summary>
/// True if the file is to be hidden; otherwise, false.
/// </summary>
public bool IsHidden { get; set; }
}
FileUpdatePermissionsRequest
See also:
public class FileUpdatePermissionsRequest
{
/// <summary>
/// True if inheriting permissions from the folder permissions.
/// If true, then file permissions that were explicitly set file will be cleared.
/// </summary>
public bool InheritFromFolderPermissions { get; set; }
/// <summary>
/// Specifies the file's new permissions collection.
/// Set to null if InheritFromFolderPermissions is set to true.
/// </summary>
public List<FilePermissionWithIdentities> Permissions { get; set; }
}
FileUpdateRequest
public class FileUpdateRequest
{
/// <summary>
/// Specifies a comment for the file update operation.
/// </summary>
public string Comment { get; set; }
}
GetFileChangeRequest
public class GetFileChangeRequest
{
/// <summary>
/// Specifies the ID of the requested file.
/// </summary>
[JsonProperty(Required = Required.Always)]
public string FileId { get; set; }
/// <summary>
/// Specifies the requested skip count.
/// </summary>
public int Skip { get; set; } = 0;
/// <summary>
/// Specifies the requested limit count.
/// </summary>
public int Limit { get; set; } = 25;
}
Folder
public class Folder
{
/// <summary>
/// Specifies the folder's ID.
/// </summary>
public string Id { get; set; }
/// <summary>
/// Specifies the ID of the folder's space.
/// </summary>
public int SpaceId { get; set; }
/// <summary>
/// Specifies the folder's name.
/// </summary>
public string Name { get; set; }
/// <summary>
/// Specifies the folder's path.
/// </summary>
public string UncPath { get; set; }
/// <summary>
/// True if the folder is locked for use; otherwise, false.
/// </summary>
public bool IsLocked { get; set; }
/// <summary>
/// True if a folder is hidden; otherwise, false.
/// </summary>
public bool IsHidden { get; set; }
/// <summary>
/// Specifies the date and time when the folder was created.
/// </summary>
public DateTime? CreatedDateTime { get; set; }
/// <summary>
/// Specifies the name of the user who created the folder.
/// </summary>
public User CreatedBy { get; set; }
/// <summary>
/// Specifies the folder's metadata collection.
/// </summary>
public Dictionary<string, object> Metadata { get; set; }
/// <summary>
/// True if inheriting permissions from the parent folder; otherwise, false.
/// </summary>
public bool InheritPermissionsFromParent { get; set; }
/// <summary>
/// True if the folder is marked for deletion; otherwise, false.
/// Note: A Purge action will delete the folder permanently.
/// </summary>
public bool IsDeleted { get; set; }
/// <summary>
/// Specifies the ID of the folder's parent folder.
/// </summary>
public string ParentFolderId { get; set; }
/// <summary>
/// Specifies the folder's subfolders.
/// </summary>
public List<Folder> Folders { get; set; } = new List<Folder>();
}
FolderCopyRequest
public class FolderCopyRequest
{
/// <summary>
/// Specifies the folder's new folder ID.
/// </summary>
public string DestinationFolderId { get; set; }
/// <summary>
/// Specifies the folder's name.
/// </summary>
public string Name { get; set; }
}
FolderCreateRequest
public class FolderCreateRequest : FolderCreateRequestBase
{
/// <summary>
/// Specifies the new folder's name.
/// </summary>
public string Name { get; set; }
/// <summary>
/// Specifies the ID of the new folder's parent folder.
/// </summary>
public string ParentFolderId { get; set; }
/// <summary>
/// True if the folder is hidden; otherwise, false.
/// </summary>
public bool IsHidden { get; set; }
}
FolderCreateRequestBase
See also:
public class FolderCreateRequestBase
{
/// <summary>
/// True if the folder inherits permissions from the parent folder; otherwise, false.
/// </summary>
public bool InheritPermissionsFromParent { get; set; } = true;
/// <summary>
/// Specifies the new folder's metadata collection.
/// </summary>
public Dictionary<string, object> Metadata { get; set; }
/// <summary>
/// Specifies the new folder's permissions collection.
/// </summary>
public List<FolderPermissionWithIdentities> Permissions { get; set; }
}
FolderHierarchy
public class FolderHierarchy
{
/// <summary>
/// Specifies the folder's subfolders.
/// </summary>
public List<FolderMin> Folders { get; set; } = new List<FolderMin>();
}
FolderMin
public class FolderMin
{
/// <summary>
/// Specifies the folder's ID.
/// </summary>
public string Id { get; set; }
/// <summary>
/// Specifies the folder's name.
/// </summary>
public string Name { get; set; }
/// <summary>
/// Specifies the folder's path.
/// </summary>
public string UncPath { get; set; }
public bool IsHidden { get; set; }
public bool IsDeleted { get; set; }
/// <summary>
/// Specifies the folder's subfolders.
/// </summary>
public List<FolderMin> Folders { get; set; } = new List<FolderMin>();
/// <summary>
/// Provides a utility method to allow for enumeration over the folder hierarchy.
/// </summary>
public static IEnumerable<FolderMin> Traverse(FolderMin root)
{
var stack = new Stack<FolderMin>();
stack.Push(root);
while (stack.Count > 0)
{
var current = stack.Pop();
yield return current;
foreach (var child in current.Folders)
stack.Push(child);
}
}
}
FolderMoveRequest
public class FolderMoveRequest
{
/// <summary>
/// Specifies the ID of the destination parent folder.
/// </summary>
public string DestinationFolderId { get; set; }
/// <summary>
/// Specifies the moved folder's name.
/// </summary>
public string Name { get; set; }
}
FolderNoChildren
See also:
public class FolderNoChildren
{
/// <summary>
/// Specifies the ID of the folder's space.
/// </summary>
public int SpaceId { get; set; }
/// <summary>
/// Specifies the folder's ID.
/// </summary>
public string Id { get; set; }
/// <summary>
/// Specifies the folder's name.
/// </summary>
public string Name { get; set; }
/// <summary>
/// Specifies the folder's path.
/// </summary>
public string UncPath { get; set; }
/// <summary>
/// True if the folder is locked for use; otherwise, false.
/// </summary>
public bool IsLocked { get; set; }
/// <summary>
/// Specifies the date and time when the folder was created.
/// </summary>
public DateTime? CreatedDateTime { get; set; }
/// <summary>
/// Specifies the name of the user who created the folder.
/// </summary>
public User CreatedBy { get; set; }
/// <summary>
/// Specifies the folder's metadata collection.
/// </summary>
public System.Collections.Generic.Dictionary<string, object> Metadata { get; set; }
/// <summary>
/// True if inheriting permissions from the parent folder; otherwise, false.
/// </summary>
public bool InheritPermissionsFromParent { get; set; }
/// <summary>
/// True if the folder is marked for deletion; otherwise, false.
/// Note: A Purge action will delete the folder permanently.
/// </summary>
public bool IsDeleted { get; set; }
/// <summary>
/// Specifies the ID of the folder's parent folder.
/// </summary>
public string ParentFolderId { get; set; }
}
FolderPermission
public enum FolderPermission
{
Uninitialized = 0,
Read,
Write,
Delete,
List,
Purge
}
FolderPermissions
See also:
public class FolderPermissions
{
/// <summary>
/// Specifies the folder's permissions collection.
/// </summary>
public List<FolderPermissionWithIdentities> Permissions { get; set; }
/// <summary>
/// True if permissions were explicitly set on the folder; otherwise, false.
/// </summary>
public bool IsExplicit { get; set; }
/// <summary>
/// Specifies the ID of the folder from which the permissions are inherited.
/// Applies only when the folder's permissions are not otherwise explicitly specified.
/// </summary>
public string PermissionsInheritedFromFolderId { get; set; }
}
FolderPermissionWithIdentities
See also:
public class FolderPermissionWithIdentities
{
/// <summary>
/// Specifies a folder permission.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public FolderPermission Permission { get; set; }
/// <summary>
/// Specifies the collection of the folder permission identities.
/// </summary>
public Dictionary<IdentityType, List<Identity>> GrantedTo { get; set; }
}
FolderRenameRequest
public class FolderRenameRequest
{
/// <summary>
/// Specifies the folder's new name.
/// </summary>
public string Name { get; set; }
}
FolderUpdatePermissionsRequest
See also:
public class FolderUpdatePermissionsRequest
{
/// <summary>
/// True if the folder inherits permissions from the parent folder; otherwise, false.
/// If true, then explicit folder permissions will be cleared.
/// </summary>
public bool InheritPermissionsFromParent { get; set; }
/// <summary>
/// Specifies the folder's new permissions collection.
/// There is no need to set this parameter if InheritPermissionsFromParent is set to true.
/// </summary>
public List<FolderPermissionWithIdentities> Permissions { get; set; }
}
FolderUpdateRequest
public class FolderUpdateRequest
{
/// <summary>
/// Specifies the folder's name.
/// </summary>
public string Name { get; set; }
/// <summary>
/// Specifies the folder's metadata collection.
/// </summary>
public Dictionary <string, object> Metadata { get; set; }
/// <summary>
/// True if the folder is hidden; otherwise, false.
/// </summary>
public bool? IsHidden { get; set; }
}
Identity
This class is used to represent one of the three identity types: User, Group, or Role. How the value is interpreted is based on the context in which it is used.
public class Identity
{
/// <summary>
/// Specifies the ID of the identity type that is being referenced, such as UserID, GroupID, or RoleID.
/// </summary>
public string Id { get; set; }
/// <summary>
/// Specifies the display name for the identity. This parameter is primarily used to provide context if
/// a permission-editing UI is displayed.
/// </summary>
public string DisplayName { get; set; }
}
IdentityType
This enumeration type is used to convey how the Id member of the Identity class should be interpreted. The Uninitialized value exists to enforce the selection of a type.
public enum IdentityType
{
Uninitialized = 0,
User,
Group,
Role
}
Items
See also:
public class Items
{
/// <summary>
/// Specifies the item's folder.
/// </summary>
public FolderNoChildren Folder { get; set; }
/// <summary>
/// Specifies the item's files collection.
/// </summary>
public List<File> Files { get; set; } = new List<File>();
/// <summary>
/// Specifies the item's subfolders collection.
/// </summary>
public List<FolderNoChildren> Subfolders { get; set; } = new List<FolderNoChildren>();
/// <summary>
/// Specifies the next items request.
/// </summary>
public ItemsRequest NextItemsRequest { get; set; }
/// <summary>
/// True if there are more items to get; otherwise, false.
/// </summary>
public bool MoreItemsToGet { get; set; }
}
ItemsByPath
See also:
public class ItemsByPath
{
/// <summary>
/// Specifies the item's folder.
/// </summary>
public FolderNoChildren Folder { get; set; }
/// <summary>
/// Specifies the item's files collection.
/// </summary>
public List<File> Files { get; set; } = new List<File>();
/// <summary>
/// Specifies the item's subfolders collection.
/// </summary>
public List<FolderNoChildren> Subfolders { get; set; } = new List<FolderNoChildren>();
/// <summary>
/// Specifies the next items request.
/// </summary>
public ItemsByPathRequest NextItemsByPathRequest { get; set; }
/// <summary>
/// True if there are more items to get; otherwise, false.
/// </summary>
public bool MoreItemsToGet { get; set; }
}
ItemsByPathRequest
See also:
public class ItemsByPathRequest : ItemsRequest
{
/// <summary>
/// Specifies the optional major version of the file.
/// </summary>
public int? VersionMajor { get; set; }
/// <summary>
/// Specifies the optional minor version of the file.
/// </summary>
public int? VersionMinor { get; set; }
}
ItemsRequest
public class ItemsRequest
{
/// <summary>
/// Specifies the folders limit value to use in the next GetItems request.
/// </summary>
public int? FoldersLimit { get; set; }
/// <summary>
/// Specifies the files limit value to use in the next GetItems request.
/// </summary>
public int? FilesLimit { get; set; }
/// <summary>
/// Specifies the folders skip value to use in the next GetItems request.
/// </summary>
public long FoldersSkip { get; set; }
/// <summary>
/// Specifies the files skip value to use in the next GetItems request.
/// </summary>
public long FilesSkip { get; set; }
/// <summary>
/// True if hidden folders and files should be included; otherwise, false.
/// </summary>
public bool IncludeHidden { get; set; }
/// <summary>
/// True if deleted folders and files should be included; otherwise, false.
/// </summary>
public bool IncludeDeleted { get; set; }
}
MetadataCreateItemRequest
public class MetadataCreateItemRequest
{
/// <summary>
/// Specifies the value of the new metadata item.
/// </summary>
public object Value { get; set; }
}
MetadataUpdateItemRequest
public class MetadataUpdateItemRequest
{
/// <summary>
/// Specifies the value of the updated metadata item.
/// </summary>
public object Value { get; set; }
}
PictureTypeEnum
This enumeration type provides a hint for how the User Picture byte array should be interpreted. The Uninitialized value exists to enforce the selection of a type.
public enum PictureTypeEnum
{
Uninitialized = 0,
None,
Jpeg,
Png,
Gif,
Bmp
}
SearchFileAttributeTypes
[Flags]
public enum SearchFileAttributeTypes
{
Uninitialized = 0,
ExcludeDeleted = 1,
ExcludeHidden = 2,
OnlyHidden = 4,
OnlyDeleted = 8
}
SearchFileResult
See also:
public class SearchFileResult : File
{
/// <summary>
/// Specifies the UNC path to the file.
/// </summary>
public string UncPath { get; set; }
}
SearchFilesRequest
See also:
public class SearchFilesRequest : SearchRequestBase
{
/// <summary>
/// Specifies the attribute type for the files search.
/// </summary>
public SearchFileAttributeTypes SearchFileAttributeType { get; set; }
/// <summary>
/// Specifies the string value for the "name contains" query.
/// </summary>
[JsonProperty(Required = Required.AllowNull)]
public string FileNameContainsQuery { get; set; }
}
SearchFilesResult
See also:
public class SearchFilesResult
{
/// <summary>
/// True if all the file records for each paged request have been searched; otherwise, false.
/// </summary>
public bool SearchCompleted { get; set; }
/// <summary>
/// Specifies the SearchFilesRequest to use for the next paged search request.
/// This value will be null if the value of SearchCompleted is true.
/// </summary>
public SearchFilesRequest NextSearchFilesRequest { get; set; }
/// <summary>
/// Specifies the collection of file matches in the search result.
/// </summary>
public List<SearchFileResult> SearchResultFileMatches { get; set; }
}
SearchFolderAttributeTypes
[Flags]
public enum SearchFolderAttributeTypes
{
Uninitialized = 0, // Indicates that no attribute-based filter is to be applied.
ExcludeDeleted = 1, // Excludes deleted folders from the results list (cannot be used with OnlyDeleted).
ExcludeHidden = 2, // Excludes hidden folders from the results list (cannot be used with OnlyHidden).
OnlyHidden = 4, // Includes only hidden folders in the results list.
OnlyDeleted = 8 // Includes only deleted folders in the results list.
}
SearchFoldersRequest
See also:
public class SearchFoldersResult
public class SearchFoldersRequest : SearchRequestBase
{
/// <summary>
/// The attribute type for folders search.
/// </summary>
public SearchFolderAttributeTypes SearchFolderAttributeType { get; set; }
/// <summary>
/// The string value for the name contains substring query. Case insensitive matching
/// </summary>
public string FolderNameContainsQuery { get; set; }
}
SearchFoldersResult
See also:
public class SearchFoldersResult
{
/// <summary>
/// True if all the folder records for each paged request have been searched; otherwise, false.
/// </summary>
public bool SearchCompleted { get; set; }
/// <summary>
/// Specifies the SearchFoldersRequest to use for the next paged search request.
/// This value will be null if the value of SearchCompleted is true.
/// </summary>
public SearchFoldersRequest NextSearchFoldersRequest { get; set; }
/// <summary>
/// Specifies the collection of folder matches in the search result.
/// </summary>
public List<SearchFolderResult> SearchResultFolderMatches { get; set; }
}
SearchRequestBase
public class SearchRequestBase
{
/// <summary>
/// Specifies the page limit count of the request.
/// </summary>
[JsonProperty(Required = Required.Always)]
public int? Limit { get; set; }
/// <summary>
/// Specifies the page skip count of the request.
/// </summary>
[JsonProperty(Required = Required.Always)]
public int Skip { get; set; }
}
TempFileAddByPathRequest
When you specify the location of a temporary file by using a folder path, that target URI is included in the REST URI by using URL encoding.
See also:
public class TempFileAddByPathRequest : TempFileAddRequestBase
{
}
TempFileAddRequest
When you use this class, you must specify the ID of the folder that will contain the new temporary file.
See also:
public class TempFileAddRequest : TempFileAddRequestBase
{
/// <summary>
/// Specifies the folder ID of the file to be added.
/// </summary>
[JsonProperty(Required = Required.Always)]
public string FolderId { get; set; }
}
TempFileAddRequestBase
This base class defines the common properties of TempFileAddRequest and TempFileAddByPathRequest.
public class TempFileAddRequestBase
{
/// <summary>
/// Specifies a comment for the file to be added.
/// </summary>
[JsonProperty(Required = Required.AllowNull)]
public string Comment { get; set; }
/// <summary>
/// Specifies the content type of the file to be added (such as .txt, .jpg, .gif, and so on).
/// </summary>
[JsonProperty(Required = Required.Always)]
public string FileContentType { get; set; }
/// <summary>
/// Specifies the encryption type and level of the file to be added.
/// Note: This parameter is only a label. All encryption and decryption is the responsibility of the client.
/// </summary>
[JsonProperty(Required = Required.Always)]
public string Encryption { get; set; }
/// <summary>
/// True if the file will inherit folder permissions when it is added; otherwise, false.
/// </summary>
[JsonProperty(Required = Required.Always)]
public bool InheritFromFolderPermissions { get; set; } = true;
/// <summary>
/// Specifies the file's metadata collection.
/// </summary>
[JsonProperty(Required = Required.AllowNull)]
public Dictionary<string, object> Metadata { get; set; }
/// <summary>
/// Specifies the permissions collection of the added file.
/// There is no need to set this parameter if InheritFromFolderPermissions is set to true.
/// </summary>
[JsonProperty(Required = Required.Default)]
public List<FilePermissionWithIdentities> Permissions { get; set; }
/// <summary>
/// True if the file is hidden; otherwise, false.
/// </summary>
public bool IsHidden { get; set; }
/// <summary>
/// Specifies the prefix for the file to be added.
/// </summary>
[JsonProperty(Required = Required.Always)]
public string Prefix { get; set; }
/// <summary>
/// Specifies the extension for the file to be added.
/// </summary>
[JsonProperty(Required = Required.Always)]
public string Extension { get; set; }
}
UriAliases
This class is the collection of mappings that are used to convert a Librarian URI prefix to another Librarian prefix.
See also:
public class UriAliases
{
/// <summary>
/// Provides a map of alternative folder path URIs to actual folder path URIs.
/// </summary>
public List<UriAliasMap> Mappings { get; set; } = new List<UriAliasMap>();
}
UriAliasMap
Both the Input and Output strings must not be null, and both must end with a slash (/) character.
public class UriAliasMap
{
/// <summary>
/// Specifies the aliased URI prefix segment to replace (such as "librarian://Folder2/").
/// </summary>
public string Input { get; set; }
/// <summary>
/// Specifies the original URI prefix segment (such as "librarian://Main/Folder1/Folder2/").
/// </summary>
public string Output { get; set; }
}
User
The main way to identify a user is by using the UserID property of a User object.
public class User : UserBase
{
/// <summary>
/// Specifies the unique identifier for a user.
/// </summary>
public string UserID { get; set; }
/// <summary>
/// Indicates whether the user has completed the sign-up process for their account.
/// This parameter is read-only.
/// </summary>
public bool? Onboarded { get; set; }
}
UserBase
This class specifies the settings that comprise a user.
See also:
public class UserBase
{
/// <summary>
/// Specifies the company name.
/// </summary>
public string Company { get; set; }
/// <summary>
/// Specifies the country name.
/// </summary>
public string Country { get; set; }
/// <summary>
/// Specifies the display name of the user.
/// </summary>
public string DisplayName { get; set; }
/// <summary>
/// Specifies the city name.
/// </summary>
public string City { get; set; }
/// <summary>
/// Specifies the email address for the user.
/// </summary>
/// <remarks>Must be unique</remarks>
public string Email { get; set; }
/// <summary>
/// Specifies the first name of the user.
/// </summary>
public string FirstName { get; set; }
/// <summary>
/// Specifies the industry name.
/// </summary>
public string Industry { get; set; }
/// <summary>
/// Specifies the last name of the user.
/// </summary>
public string LastName { get; set; }
/// <summary>
/// Specifies the phone number for the user.
/// </summary>
/// <remarks>Note: Formatting restrictions apply, such as +15551235555.</remarks>
/// <note>Valid only if SMS is configured for the tenant.</note>
public string PhoneNumber { get; set; }
/// <summary>
/// Specifies the profile picture for the user. The Picture value can be null or between 1024 bytes and 2097152 bytes in size.
/// </summary>
public byte[] Picture { get; set; }
/// <summary>
/// Specifies the format of the data that is in the Picture field.
/// </summary>
public PictureTypeEnum? PictureType { get; set; }
/// <summary>
/// Specifies the position or title of the user.
/// </summary>
public string PositionTitle { get; set; }
/// <summary>
/// Specifies the state or province of the user.
/// </summary>
public string StateProvince { get; set; }
/// <summary>
/// Specifies whether the user account is locked. The sign-in operation is denied for a locked account.
/// </summary>
public bool? Locked { get; set; }
/// <summary>
/// Specifies whether the user account has administrator privileges. To avoid a security lockout, Administrator accounts
/// will not be blocked due to permissions.
/// </summary>
public bool? Administrator { get; set; }
/// <summary>
/// Identifies the roles that are associated with the user.
/// </summary>
public List<string> RoleIds { get; set; }
}
UserFilePermissions
See also:
public class UserFilePermissions
{
/// <summary>
/// Specifies the file permissions for the user.
/// The dictionary's value is a Boolean that is true if the user has the FilePermission parameter specified in its corresponding key; otherwise, it is false.
/// </summary>
public Dictionary<FilePermission, bool> Permissions { get; set; }
}
UserFolderPermissions
See also:
public class UserFolderPermissions
{
/// <summary>
/// Specifies the folder permissions for the user.
/// The dictionary's value is a Boolean that is true if the user has the FolderPermission parameter specified in its corresponding key; otherwise, it is false.
/// </summary>
public Dictionary<FolderPermission, bool> Permissions { get; set; }
}
Version
Librarian supports the use of major and minor versions to track document changes. When a user checks in a file, this class indicates which of these values is incremented. New files start with a major version of 1. When a major version is incremented, the minor version starts at zero (0).
public class Version
{
public int Major { get; set; }
public int Minor { get; set; }
}
VersionUpdateMethod
When a user checks in a file, this enumeration type specifies whether the major or minor integer version numbers should be incremented. The Uninitialized value exists to enforce the selection of a type.
public enum VersionUpdateMethod
{
Uninitialized = 0,
Major,
Minor
}