-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add #175: Optimisation on optin and optout call
- Loading branch information
1 parent
52ac3ca
commit 8cfa25c
Showing
10 changed files
with
288 additions
and
211 deletions.
There are no files selected for viewing
71 changes: 71 additions & 0 deletions
71
PrivacyDashboardiOS/Classes/Model/Organisation/DataAgreementsModel.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// | ||
// DataAgreements.swift | ||
// PrivacyDashboardiOS | ||
// | ||
// Created by Mumthasir mohammed on 04/01/24. | ||
// | ||
|
||
import Foundation | ||
// MARK: - DataAgreements | ||
struct DataAgreementsModel: Codable { | ||
var dataAgreements: [DataAgreements] | ||
let pagination: PaginationModel | ||
} | ||
|
||
// MARK: - DataAgreement | ||
struct DataAgreements: Codable { | ||
var active: Bool | ||
let compatibleWithVersionID, controllerID, controllerName: String | ||
let controllerURL: String | ||
let dataAttributes: [DataAttributeModel] | ||
let dpiaDate: String | ||
let dpiaSummaryURL: String | ||
let forgettable: Bool | ||
let id, lawfulBasis, lifecycle, methodOfUse: String | ||
let policy: PolicyModel | ||
let purpose, purposeDescription: String | ||
let signature: SignatureModel | ||
let version: String | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case active | ||
case compatibleWithVersionID = "compatibleWithVersionId" | ||
case controllerID = "controllerId" | ||
case controllerName | ||
case controllerURL = "controllerUrl" | ||
case dataAttributes, dpiaDate | ||
case dpiaSummaryURL = "dpiaSummaryUrl" | ||
case forgettable, id, lawfulBasis, lifecycle, methodOfUse, policy, purpose, purposeDescription, signature, version | ||
} | ||
} | ||
|
||
// MARK: - DataAttribute | ||
struct DataAttributeModel: Codable { | ||
let category, description, id, name: String | ||
let sensitivity: Bool | ||
} | ||
|
||
// MARK: - Policy | ||
struct PolicyModel: Codable { | ||
let dataRetentionPeriodDays: Int | ||
let geographicRestriction, id, industrySector, jurisdiction: String | ||
let name, storageLocation: String | ||
let thirdPartyDataSharing: Bool | ||
let url: String | ||
let version: String | ||
} | ||
|
||
// MARK: - Signature | ||
struct SignatureModel: Codable { | ||
let id, objectReference, objectType, payload: String | ||
let signature: String | ||
let signedWithoutObjectReference: Bool | ||
let timestamp, verificationArtifact, verificationJwsHeader, verificationMethod: String | ||
let verificationPayload, verificationPayloadHash, verificationSignedAs, verificationSignedBy: String | ||
} | ||
|
||
// MARK: - Pagination | ||
struct PaginationModel: Codable { | ||
let currentPage, totalItems, totalPages, limit: Int | ||
let hasPrevious, hasNext: Bool | ||
} |
33 changes: 33 additions & 0 deletions
33
PrivacyDashboardiOS/Classes/Model/Organisation/OrganisationModel.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// OrganisationModel.swift | ||
// PrivacyDashboardiOS | ||
// | ||
// Created by Mumthasir mohammed on 05/01/24. | ||
// | ||
|
||
import Foundation | ||
|
||
// MARK: - Organisation | ||
struct OrganisationModel: Codable { | ||
let organisation: OrganisationClass | ||
} | ||
|
||
// MARK: - OrganisationClass | ||
struct OrganisationClass: Codable { | ||
let id, name, description, sector: String | ||
let location: String | ||
let policyURL: String | ||
let coverImageID: String | ||
let coverImageURL: String | ||
let logoImageID: String | ||
let logoImageURL: String | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case id, name, description, sector, location | ||
case policyURL = "policyUrl" | ||
case coverImageID = "coverImageId" | ||
case coverImageURL = "coverImageUrl" | ||
case logoImageID = "logoImageId" | ||
case logoImageURL = "logoImageUrl" | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
PrivacyDashboardiOS/Classes/Model/Organisation/RecordsModel.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// RecordsModel.swift | ||
// PrivacyDashboardiOS | ||
// | ||
// Created by Mumthasir mohammed on 05/01/24. | ||
// | ||
|
||
import Foundation | ||
|
||
// MARK: - Records | ||
class RecordsModel: Codable { | ||
let consentRecords: [ConsentRecordModel] | ||
let pagination: RecordsPagination | ||
} | ||
|
||
// MARK: - ConsentRecord | ||
class ConsentRecordModel: Codable { | ||
let id, dataAgreementID, dataAgreementRevisionID, dataAgreementRevisionHash: String | ||
let individualID: String | ||
var optIn: Bool | ||
let state, signatureID: String | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case id | ||
case dataAgreementID = "dataAgreementId" | ||
case dataAgreementRevisionID = "dataAgreementRevisionId" | ||
case dataAgreementRevisionHash | ||
case individualID = "individualId" | ||
case optIn, state | ||
case signatureID = "signatureId" | ||
} | ||
} | ||
|
||
// MARK: - Pagination | ||
class RecordsPagination: Codable { | ||
let currentPage, totalItems, totalPages, limit: Int | ||
let hasPrevious, hasNext: Bool | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.