mirror of
https://github.com/bitwarden/mobile.git
synced 2024-11-23 11:45:38 +01:00
more models
This commit is contained in:
parent
c89805d123
commit
87798612a6
12
src/Core/Models/Api/CardApi.cs
Normal file
12
src/Core/Models/Api/CardApi.cs
Normal file
@ -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; }
|
||||
}
|
||||
}
|
11
src/Core/Models/Api/FieldApi.cs
Normal file
11
src/Core/Models/Api/FieldApi.cs
Normal file
@ -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; }
|
||||
}
|
||||
}
|
24
src/Core/Models/Api/IdentityApi.cs
Normal file
24
src/Core/Models/Api/IdentityApi.cs
Normal file
@ -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; }
|
||||
}
|
||||
}
|
9
src/Core/Models/Api/SecureNoteApi.cs
Normal file
9
src/Core/Models/Api/SecureNoteApi.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using Bit.Core.Enums;
|
||||
|
||||
namespace Bit.Core.Models.Api
|
||||
{
|
||||
public class SecureNoteApi
|
||||
{
|
||||
public SecureNoteType Type { get; set; }
|
||||
}
|
||||
}
|
26
src/Core/Models/Data/AttachmentData.cs
Normal file
26
src/Core/Models/Data/AttachmentData.cs
Normal file
@ -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; }
|
||||
}
|
||||
}
|
26
src/Core/Models/Data/CardData.cs
Normal file
26
src/Core/Models/Data/CardData.cs
Normal file
@ -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; }
|
||||
}
|
||||
}
|
22
src/Core/Models/Data/CollectionData.cs
Normal file
22
src/Core/Models/Data/CollectionData.cs
Normal file
@ -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; }
|
||||
}
|
||||
}
|
21
src/Core/Models/Data/FieldData.cs
Normal file
21
src/Core/Models/Data/FieldData.cs
Normal file
@ -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; }
|
||||
}
|
||||
}
|
21
src/Core/Models/Data/FolderData.cs
Normal file
21
src/Core/Models/Data/FolderData.cs
Normal file
@ -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; }
|
||||
}
|
||||
}
|
50
src/Core/Models/Data/IdentityData.cs
Normal file
50
src/Core/Models/Data/IdentityData.cs
Normal file
@ -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; }
|
||||
}
|
||||
}
|
19
src/Core/Models/Data/PasswordHistoryData.cs
Normal file
19
src/Core/Models/Data/PasswordHistoryData.cs
Normal file
@ -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; }
|
||||
}
|
||||
}
|
17
src/Core/Models/Data/SecureNoteData.cs
Normal file
17
src/Core/Models/Data/SecureNoteData.cs
Normal file
@ -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; }
|
||||
}
|
||||
}
|
12
src/Core/Models/Response/AttachmentResponse.cs
Normal file
12
src/Core/Models/Response/AttachmentResponse.cs
Normal file
@ -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; }
|
||||
}
|
||||
}
|
28
src/Core/Models/Response/CipherResponse.cs
Normal file
28
src/Core/Models/Response/CipherResponse.cs
Normal file
@ -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<FieldApi> 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<AttachmentResponse> Attachments { get; set; }
|
||||
public List<PasswordHistoryResponse> PasswordHistory { get; set; }
|
||||
public List<string> CollectionIds { get; set; }
|
||||
}
|
||||
}
|
11
src/Core/Models/Response/CollectionResponse.cs
Normal file
11
src/Core/Models/Response/CollectionResponse.cs
Normal file
@ -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; }
|
||||
}
|
||||
}
|
11
src/Core/Models/Response/FolderResponse.cs
Normal file
11
src/Core/Models/Response/FolderResponse.cs
Normal file
@ -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; }
|
||||
}
|
||||
}
|
10
src/Core/Models/Response/PasswordHistoryResponse.cs
Normal file
10
src/Core/Models/Response/PasswordHistoryResponse.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace Bit.Core.Models.Response
|
||||
{
|
||||
public class PasswordHistoryResponse
|
||||
{
|
||||
public string Password { get; set; }
|
||||
public DateTime? LastUsedDate { get; set; }
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user