AipFileInfo.cs 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. 
  2. namespace Aip.Service.Aip.Models;
  3. public class SetFileInfo : IDisposable
  4. {
  5. private bool disposedValue;
  6. public int errorNo { get; set; }
  7. public string errorMsg { get; set; } = string.Empty;
  8. public string labelGuid { get; set; } = string.Empty;
  9. public string templateGuid { get; set; } = string.Empty;
  10. public string fileOwner { get; set; } = string.Empty;
  11. public long fileSize { get; set; }
  12. public string newFileName { get; set; } = string.Empty;
  13. public string newFileOwner { get; set; } = string.Empty;
  14. public string newFileLabelGuid { get; set; } = string.Empty;
  15. public string newFileTemplateGuid { get; set; } = string.Empty;
  16. public long newFileSize { get; set; }
  17. protected virtual void Dispose(bool disposing)
  18. {
  19. if (!disposedValue)
  20. {
  21. if (disposing)
  22. {
  23. // TODO: 관리형 상태(관리형 개체)를 삭제합니다.
  24. }
  25. // TODO: 비관리형 리소스(비관리형 개체)를 해제하고 종료자를 재정의합니다.
  26. // TODO: 큰 필드를 null로 설정합니다.
  27. disposedValue = true;
  28. }
  29. }
  30. // // TODO: 비관리형 리소스를 해제하는 코드가 'Dispose(bool disposing)'에 포함된 경우에만 종료자를 재정의합니다.
  31. // ~SetFileInfo()
  32. // {
  33. // // 이 코드를 변경하지 마세요. 'Dispose(bool disposing)' 메서드에 정리 코드를 입력합니다.
  34. // Dispose(disposing: false);
  35. // }
  36. public void Dispose()
  37. {
  38. // 이 코드를 변경하지 마세요. 'Dispose(bool disposing)' 메서드에 정리 코드를 입력합니다.
  39. Dispose(disposing: true);
  40. GC.SuppressFinalize(this);
  41. }
  42. }
  43. public class AipFileInfo
  44. {
  45. public int errorCode { get; set; } = 0;
  46. public string errorMessage { get; set; } = string.Empty;
  47. public AipContentLabel? Content { get; set; }
  48. public AipLabel? Label { get; set; }
  49. public AipProtection? Protection { get; set; }
  50. public long FileSize { get; set; }
  51. public string? OutputFileName { get; set; }
  52. //public static implicit operator List<object>(AipFileInfo v)
  53. //{
  54. // throw new NotImplementedException();
  55. //}
  56. }
  57. public enum AipAssignmentMethod
  58. {
  59. /// <summary>Label assignment method is standard</summary>
  60. Standard,
  61. /// <summary>Label assignment method is privileged</summary>
  62. Privileged,
  63. /// <summary>Label assignment method is automatic</summary>
  64. Auto,
  65. }
  66. public enum AipProtectionType
  67. {
  68. /// <summary>Protection was created from a template</summary>
  69. TemplateBased,
  70. /// <summary>Protection was created ad hoc</summary>
  71. Custom,
  72. }
  73. public class AipLabelInfo
  74. {
  75. /// <summary>The unique GUID for the label within the tenant</summary>
  76. public string LabelId { get; set; } = "";
  77. /// <summary>GUID of the tenant that owns the label</summary>
  78. public string TenantId { get; set; } = "";
  79. }
  80. public class AipProtectionDescriptor
  81. {
  82. /// <summary>The protection type</summary>
  83. public AipProtectionType ProtectionType { get; set; }
  84. /// <summary>Collection of users-to-roles mappings</summary>
  85. // public List<Microsoft.InformationProtection.UserRoles> UserRoles { get; set; }
  86. //
  87. // /// <summary>Collection of users-to-rights mappings</summary>
  88. // public List<Microsoft.InformationProtection.UserRights> UserRights { get; set; }
  89. /// <summary>
  90. /// The RMS template id for template protection, license id for adhoc protection, if any
  91. /// </summary>
  92. public string? TemplateId { get; set; }
  93. /// <summary>
  94. /// Gets the Label info, if any
  95. /// This property will only be populated in ProtectionDescriptors for preexisting protected content. i.e. It is
  96. /// a field populated by the server at the moment protected content is consumed.
  97. /// </summary>
  98. public AipLabelInfo? LabelInformation { get; set; }
  99. /// <summary>
  100. /// Gets the Label id, if any
  101. /// This property will only be populated in ProtectionDescriptors for preexisting protected content. i.e. It is
  102. /// a field populated by the server at the moment protected content is consumed.
  103. /// </summary>
  104. public string? LabelId { get; set; }
  105. /// <summary>The owner of protection</summary>
  106. public string? Owner { get; set; }
  107. /// <summary>
  108. /// Gets the content id
  109. /// Publishing licenses will have this identifier surrounded by curly braces "{}".
  110. /// Those braces are removed from the value returned here
  111. /// </summary>
  112. public string? ContentId { get; set; }
  113. /// <summary>The protection name</summary>
  114. public string? Name { get; set; }
  115. /// <summary>The protection description</summary>
  116. public string? Description { get; set; }
  117. /// <summary>
  118. /// Whether or not protection allows offline content access (default = true)
  119. /// </summary>
  120. public bool AllowOfflineAccess { get; set; }
  121. /// <summary>Protection referrer address</summary>
  122. public string? Referrer { get; set; }
  123. /// <summary>Protection expiration time</summary>
  124. public DateTime? ContentValidUntil { get; set; }
  125. /// <summary>App-specific data that was encrypted</summary>
  126. // public Dictionary<string, string> EncryptedAppData { get; set; }
  127. //
  128. // /// <summary>App-specific data that was signed</summary>
  129. // public Dictionary<string, string> SignedAppData { get; set; }
  130. /// <summary>The double key url</summary>
  131. public string? DoubleKeyUrl { get; set; }
  132. }
  133. public class AipProtection
  134. {
  135. public AipProtectionDescriptor? ProtectionDescriptor { get; set; }
  136. /// <summary>Email address of content owner</summary>
  137. public string? Owner { get; set; }
  138. /// <summary>The user associated with the protection handler</summary>
  139. public string? IssuedTo { get; set; }
  140. /// <summary>Whether or not the current user is the content owner</summary>
  141. public bool IsIssuedToOwner { get; set; }
  142. /// <summary>
  143. /// The unique identifier for the document/content
  144. /// Publishing licenses will have this identifier surrounded by curly braces "{}".
  145. /// Those braces are removed from the value returned here
  146. /// </summary>
  147. public string? ContentId { get; set; }
  148. /// <summary> Whether or not protection handler uses deprecated crypto algorithms (ECB) for backward compatibility </summary>
  149. public bool UseDeprecatedAlgorithms { get; set; }
  150. /// <summary> Whether or not protection handler grants user 'audited extract' right </summary>
  151. public bool AuditedExtractAllowed { get; set; }
  152. /// <summary> The block size (in bytes) for the cipher mode used by this ProtectionHandler </summary>
  153. public long BlockSize { get; set; }
  154. }
  155. public class AipContentLabel
  156. {
  157. //public AipLabel Label { get; set; }
  158. public DateTime CreationTime { get; set; }
  159. /// <summary>The assignment method of the label.</summary>
  160. public AipAssignmentMethod AssignmentMethod { get; set; }
  161. /// <summary>Returns true if protection was applied by the label or not.</summary>
  162. public bool IsProtectionAppliedFromLabel { get; set; }
  163. }