diff --git a/src/Core/Models/Api/CardApi.cs b/src/Core/Models/Api/CardApi.cs new file mode 100644 index 000000000..4d5830363 --- /dev/null +++ b/src/Core/Models/Api/CardApi.cs @@ -0,0 +1,12 @@ +namespace Bit.Core.Models.Api +{ + public class CardApi + { + public string CardholderName { get; set; } + public string Brand { get; set; } + public string Number { get; set; } + public string ExpMonth { get; set; } + public string ExpYear { get; set; } + public string Code { get; set; } + } +} diff --git a/src/Core/Models/Api/FieldApi.cs b/src/Core/Models/Api/FieldApi.cs new file mode 100644 index 000000000..8fca5ac29 --- /dev/null +++ b/src/Core/Models/Api/FieldApi.cs @@ -0,0 +1,11 @@ +using Bit.Core.Enums; + +namespace Bit.Core.Models.Api +{ + public class FieldApi + { + public FieldType Type { get; set; } + public string Name { get; set; } + public string Value { get; set; } + } +} diff --git a/src/Core/Models/Api/IdentityApi.cs b/src/Core/Models/Api/IdentityApi.cs new file mode 100644 index 000000000..b7a9cfd11 --- /dev/null +++ b/src/Core/Models/Api/IdentityApi.cs @@ -0,0 +1,24 @@ +namespace Bit.Core.Models.Api +{ + public class IdentityApi + { + public string Title { get; set; } + public string FirstName { get; set; } + public string MiddleName { get; set; } + public string LastName { get; set; } + public string Address1 { get; set; } + public string Address2 { get; set; } + public string Address3 { get; set; } + public string City { get; set; } + public string State { get; set; } + public string PostalCode { get; set; } + public string Country { get; set; } + public string Company { get; set; } + public string Email { get; set; } + public string Phone { get; set; } + public string SSN { get; set; } + public string Username { get; set; } + public string PassportNumber { get; set; } + public string LicenseNumber { get; set; } + } +} diff --git a/src/Core/Models/Api/SecureNoteApi.cs b/src/Core/Models/Api/SecureNoteApi.cs new file mode 100644 index 000000000..f311cfaa0 --- /dev/null +++ b/src/Core/Models/Api/SecureNoteApi.cs @@ -0,0 +1,9 @@ +using Bit.Core.Enums; + +namespace Bit.Core.Models.Api +{ + public class SecureNoteApi + { + public SecureNoteType Type { get; set; } + } +} diff --git a/src/Core/Models/Data/AttachmentData.cs b/src/Core/Models/Data/AttachmentData.cs new file mode 100644 index 000000000..32fb585e4 --- /dev/null +++ b/src/Core/Models/Data/AttachmentData.cs @@ -0,0 +1,26 @@ +using Bit.Core.Models.Response; + +namespace Bit.Core.Models.Data +{ + public class AttachmentData : Data + { + public AttachmentData() { } + + public AttachmentData(AttachmentResponse response) + { + Id = response.Id; + Url = response.Url; + FileName = response.FileName; + Key = response.Key; + Size = response.Size; + SizeName = response.SizeName; + } + + public string Id { get; set; } + public string Url { get; set; } + public string FileName { get; set; } + public string Key { get; set; } + public string Size { get; set; } + public string SizeName { get; set; } + } +} diff --git a/src/Core/Models/Data/CardData.cs b/src/Core/Models/Data/CardData.cs new file mode 100644 index 000000000..43744f5c2 --- /dev/null +++ b/src/Core/Models/Data/CardData.cs @@ -0,0 +1,26 @@ +using Bit.Core.Models.Api; + +namespace Bit.Core.Models.Data +{ + public class CardData : Data + { + public CardData() { } + + public CardData(CardApi data) + { + CardholderName = data.CardholderName; + Brand = data.Brand; + Number = data.Number; + ExpMonth = data.ExpMonth; + ExpYear = data.ExpYear; + Code = data.Code; + } + + public string CardholderName { get; set; } + public string Brand { get; set; } + public string Number { get; set; } + public string ExpMonth { get; set; } + public string ExpYear { get; set; } + public string Code { get; set; } + } +} diff --git a/src/Core/Models/Data/CollectionData.cs b/src/Core/Models/Data/CollectionData.cs new file mode 100644 index 000000000..a63583e06 --- /dev/null +++ b/src/Core/Models/Data/CollectionData.cs @@ -0,0 +1,22 @@ +using Bit.Core.Models.Response; + +namespace Bit.Core.Models.Data +{ + public class CollectionData : Data + { + public CollectionData(CollectionResponse response) + { + Id = response.Id; + OrganizationId = response.OrganizationId; + Name = response.Name; + ExternalId = response.ExternalId; + ReadOnly = response.ReadOnly; + } + + public string Id { get; set; } + public string OrganizationId { get; set; } + public string Name { get; set; } + public string ExternalId { get; set; } + public bool ReadOnly { get; set; } + } +} diff --git a/src/Core/Models/Data/FieldData.cs b/src/Core/Models/Data/FieldData.cs new file mode 100644 index 000000000..9e7bf67e9 --- /dev/null +++ b/src/Core/Models/Data/FieldData.cs @@ -0,0 +1,21 @@ +using Bit.Core.Enums; +using Bit.Core.Models.Api; + +namespace Bit.Core.Models.Data +{ + public class FieldData : Data + { + public FieldData() { } + + public FieldData(FieldApi data) + { + Type = data.Type; + Name = data.Name; + Value = data.Value; + } + + public FieldType Type { get; set; } + public string Name { get; set; } + public string Value { get; set; } + } +} diff --git a/src/Core/Models/Data/FolderData.cs b/src/Core/Models/Data/FolderData.cs new file mode 100644 index 000000000..4947d41ee --- /dev/null +++ b/src/Core/Models/Data/FolderData.cs @@ -0,0 +1,21 @@ +using Bit.Core.Models.Response; +using System; + +namespace Bit.Core.Models.Data +{ + public class FolderData : Data + { + public FolderData(FolderResponse response, string userId) + { + UserId = userId; + Id = response.Id; + Name = response.Name; + RevisionDate = response.RevisionDate; + } + + public string Id { get; set; } + public string UserId { get; set; } + public string Name { get; set; } + public DateTime RevisionDate { get; set; } + } +} diff --git a/src/Core/Models/Data/IdentityData.cs b/src/Core/Models/Data/IdentityData.cs new file mode 100644 index 000000000..ba98d8ae3 --- /dev/null +++ b/src/Core/Models/Data/IdentityData.cs @@ -0,0 +1,50 @@ +using Bit.Core.Models.Api; + +namespace Bit.Core.Models.Data +{ + public class IdentityData : Data + { + public IdentityData() { } + + public IdentityData(IdentityApi data) + { + Title = data.Title; + FirstName = data.FirstName; + MiddleName = data.MiddleName; + LastName = data.LastName; + Address1 = data.Address1; + Address2 = data.Address2; + Address3 = data.Address3; + City = data.City; + State = data.State; + PostalCode = data.PostalCode; + Country = data.Country; + Company = data.Company; + Email = data.Email; + Phone = data.Phone; + SSN = data.SSN; + Username = data.Username; + PassportNumber = data.PassportNumber; + LicenseNumber = data.LicenseNumber; + } + + public string Title { get; set; } + public string FirstName { get; set; } + public string MiddleName { get; set; } + public string LastName { get; set; } + public string Address1 { get; set; } + public string Address2 { get; set; } + public string Address3 { get; set; } + public string City { get; set; } + public string State { get; set; } + public string PostalCode { get; set; } + public string Country { get; set; } + public string Company { get; set; } + public string Email { get; set; } + public string Phone { get; set; } + public string SSN { get; set; } + public string Username { get; set; } + public string PassportNumber { get; set; } + public string LicenseNumber { get; set; } + } +} diff --git a/src/Core/Models/Data/PasswordHistoryData.cs b/src/Core/Models/Data/PasswordHistoryData.cs new file mode 100644 index 000000000..5d15bc0a7 --- /dev/null +++ b/src/Core/Models/Data/PasswordHistoryData.cs @@ -0,0 +1,19 @@ +using Bit.Core.Models.Response; +using System; + +namespace Bit.Core.Models.Data +{ + public class PasswordHistoryData : Data + { + public PasswordHistoryData() { } + + public PasswordHistoryData(PasswordHistoryResponse data) + { + Password = data.Password; + LastUsedDate = data.LastUsedDate; + } + + public string Password { get; set; } + public DateTime? LastUsedDate { get; set; } + } +} diff --git a/src/Core/Models/Data/SecureNoteData.cs b/src/Core/Models/Data/SecureNoteData.cs new file mode 100644 index 000000000..8b89bab7b --- /dev/null +++ b/src/Core/Models/Data/SecureNoteData.cs @@ -0,0 +1,17 @@ +using Bit.Core.Enums; +using Bit.Core.Models.Api; + +namespace Bit.Core.Models.Data +{ + public class SecureNoteData : Data + { + public SecureNoteData() { } + + public SecureNoteData(SecureNoteApi data) + { + Type = data.Type; + } + + public SecureNoteType Type { get; set; } + } +} diff --git a/src/Core/Models/Response/AttachmentResponse.cs b/src/Core/Models/Response/AttachmentResponse.cs new file mode 100644 index 000000000..1dea2a877 --- /dev/null +++ b/src/Core/Models/Response/AttachmentResponse.cs @@ -0,0 +1,12 @@ +namespace Bit.Core.Models.Response +{ + public class AttachmentResponse + { + public string Id { get; set; } + public string Url { get; set; } + public string FileName { get; set; } + public string Key { get; set; } + public string Size { get; set; } + public string SizeName { get; set; } + } +} diff --git a/src/Core/Models/Response/CipherResponse.cs b/src/Core/Models/Response/CipherResponse.cs new file mode 100644 index 000000000..a78c0ec1e --- /dev/null +++ b/src/Core/Models/Response/CipherResponse.cs @@ -0,0 +1,28 @@ +using Bit.Core.Models.Api; +using System; +using System.Collections.Generic; + +namespace Bit.Core.Models.Response +{ + public class CipherResponse + { + public string Id { get; set; } + public string OrganizationId { get; set; } + public string FolderId { get; set; } + public Enums.CipherType Type { get; set; } + public string Name { get; set; } + public string Notes { get; set; } + public List Fields { get; set; } + public LoginApi Login { get; set; } + public CardApi Card { get; set; } + public IdentityApi Identity { get; set; } + public SecureNoteApi SecureNote { get; set; } + public bool Favorite { get; set; } + public bool Edit { get; set; } + public bool OrganizationUseTotp { get; set; } + public DateTime RevisionDate { get; set; } + public List Attachments { get; set; } + public List PasswordHistory { get; set; } + public List CollectionIds { get; set; } + } +} diff --git a/src/Core/Models/Response/CollectionResponse.cs b/src/Core/Models/Response/CollectionResponse.cs new file mode 100644 index 000000000..f60a065ba --- /dev/null +++ b/src/Core/Models/Response/CollectionResponse.cs @@ -0,0 +1,11 @@ +namespace Bit.Core.Models.Response +{ + public class CollectionResponse + { + public string Id { get; set; } + public string OrganizationId { get; set; } + public string Name { get; set; } + public string ExternalId { get; set; } + public bool ReadOnly { get; set; } + } +} diff --git a/src/Core/Models/Response/FolderResponse.cs b/src/Core/Models/Response/FolderResponse.cs new file mode 100644 index 000000000..e62fda4fb --- /dev/null +++ b/src/Core/Models/Response/FolderResponse.cs @@ -0,0 +1,11 @@ +using System; + +namespace Bit.Core.Models.Response +{ + public class FolderResponse + { + public string Id { get; set; } + public string Name { get; set; } + public DateTime RevisionDate { get; set; } + } +} diff --git a/src/Core/Models/Response/PasswordHistoryResponse.cs b/src/Core/Models/Response/PasswordHistoryResponse.cs new file mode 100644 index 000000000..2903ede72 --- /dev/null +++ b/src/Core/Models/Response/PasswordHistoryResponse.cs @@ -0,0 +1,10 @@ +using System; + +namespace Bit.Core.Models.Response +{ + public class PasswordHistoryResponse + { + public string Password { get; set; } + public DateTime? LastUsedDate { get; set; } + } +}