using System; namespace AipGateway.AIP { public class SetFileInfo : IDisposable { private bool disposedValue; public int errorNo { get; set; } public string errorMsg { get; set; } = string.Empty; public string labelGuid { get; set; } = string.Empty; public string templateGuid { get; set; } = string.Empty; public string fileOwner { get; set; } = string.Empty; public Int64 fileSize { get; set; } public string newFileName { get; set; } = string.Empty; public string newFileOwner { get; set; } = string.Empty; public string newFileLabelGuid { get; set; } = string.Empty; public string newFileTemplateGuid { get; set; } = string.Empty; public Int64 newFileSize { get; set; } protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { // TODO: 관리형 상태(관리형 개체)를 삭제합니다. } // TODO: 비관리형 리소스(비관리형 개체)를 해제하고 종료자를 재정의합니다. // TODO: 큰 필드를 null로 설정합니다. disposedValue = true; } } // // TODO: 비관리형 리소스를 해제하는 코드가 'Dispose(bool disposing)'에 포함된 경우에만 종료자를 재정의합니다. // ~SetFileInfo() // { // // 이 코드를 변경하지 마세요. 'Dispose(bool disposing)' 메서드에 정리 코드를 입력합니다. // Dispose(disposing: false); // } public void Dispose() { // 이 코드를 변경하지 마세요. 'Dispose(bool disposing)' 메서드에 정리 코드를 입력합니다. Dispose(disposing: true); GC.SuppressFinalize(this); } } public class AipFileInfo { public int errorCode { get; set; } = 0; public string errorMessage { get; set; } = string.Empty; public AipContentLabel Content{ get; set; } public AipLabel Label { get; set; } public AipProtection Protection { get; set; } public Int64 FileSize { get; set; } public string OutputFileName { get; set; } //public static implicit operator List(AipFileInfo v) //{ // throw new NotImplementedException(); //} } public enum AipAssignmentMethod { /// Label assignment method is standard Standard, /// Label assignment method is privileged Privileged, /// Label assignment method is automatic Auto, } public enum AipProtectionType { /// Protection was created from a template TemplateBased, /// Protection was created ad hoc Custom, } public class AipLabelInfo { /// The unique GUID for the label within the tenant public string LabelId { get; set; } = ""; /// GUID of the tenant that owns the label public string TenantId { get; set; } = ""; } public class AipProtectionDescriptor { /// The protection type public AipProtectionType ProtectionType { get; set; } /// Collection of users-to-roles mappings // public List UserRoles { get; set; } // // /// Collection of users-to-rights mappings // public List UserRights { get; set; } /// /// The RMS template id for template protection, license id for adhoc protection, if any /// public string TemplateId { get; set; } /// /// Gets the Label info, if any /// This property will only be populated in ProtectionDescriptors for preexisting protected content. i.e. It is /// a field populated by the server at the moment protected content is consumed. /// public AipLabelInfo LabelInformation { get; set; } /// /// Gets the Label id, if any /// This property will only be populated in ProtectionDescriptors for preexisting protected content. i.e. It is /// a field populated by the server at the moment protected content is consumed. /// public string LabelId { get; set; } /// The owner of protection public string Owner { get; set; } /// /// Gets the content id /// Publishing licenses will have this identifier surrounded by curly braces "{}". /// Those braces are removed from the value returned here /// public string ContentId { get; set; } /// The protection name public string Name { get; set; } /// The protection description public string Description { get; set; } /// /// Whether or not protection allows offline content access (default = true) /// public bool AllowOfflineAccess { get; set; } /// Protection referrer address public string Referrer { get; set; } /// Protection expiration time public DateTime? ContentValidUntil { get; set; } /// App-specific data that was encrypted // public Dictionary EncryptedAppData { get; set; } // // /// App-specific data that was signed // public Dictionary SignedAppData { get; set; } /// The double key url public string DoubleKeyUrl { get; set; } } public class AipProtection { public AipProtectionDescriptor ProtectionDescriptor { get; set; } /// Email address of content owner public string Owner { get; set; } /// The user associated with the protection handler public string IssuedTo { get; set; } /// Whether or not the current user is the content owner public bool IsIssuedToOwner { get; set; } /// /// The unique identifier for the document/content /// Publishing licenses will have this identifier surrounded by curly braces "{}". /// Those braces are removed from the value returned here /// public string ContentId { get; set; } /// Whether or not protection handler uses deprecated crypto algorithms (ECB) for backward compatibility public bool UseDeprecatedAlgorithms { get; set; } /// Whether or not protection handler grants user 'audited extract' right public bool AuditedExtractAllowed { get; set; } /// The block size (in bytes) for the cipher mode used by this ProtectionHandler public long BlockSize { get; set; } } public class AipContentLabel { //public AipLabel Label { get; set; } public DateTime CreationTime { get; set; } /// The assignment method of the label. public AipAssignmentMethod AssignmentMethod { get; set; } /// Returns true if protection was applied by the label or not. public bool IsProtectionAppliedFromLabel { get; set; } } }