Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Equatable conformance to RequestItem struct #42

Merged
merged 3 commits into from
Nov 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions Sources/MdocDataTransfer18013/RequestItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,25 @@ limitations under the License.
*/
import Foundation

public struct RequestItem: Sendable {
public init(elementIdentifier: String, intentToRetain: Bool? = nil, isOptional: Bool? = nil) {
self.elementIdentifier = elementIdentifier
self.intentToRetain = intentToRetain
self.isOptional = isOptional
}
public init(elementIdentifier: String) {
self.elementIdentifier = elementIdentifier
self.intentToRetain = nil
self.isOptional = nil
}
/// A structure representing a request item for data transfer.
public struct RequestItem: Equatable, Sendable {
public init(elementIdentifier: String, intentToRetain: Bool? = nil, isOptional: Bool? = nil) {
self.elementIdentifier = elementIdentifier
self.intentToRetain = intentToRetain
self.isOptional = isOptional
}
public init(elementIdentifier: String) {
self.elementIdentifier = elementIdentifier
self.intentToRetain = nil
self.isOptional = nil
}

public let elementIdentifier: String
public let intentToRetain: Bool?
public let isOptional: Bool?
/// A unique identifier for the data element.
/// This identifier is used to distinguish between different elements within the data transfer process.
public let elementIdentifier: String
/// Indicates whether the mdoc verifier intends to retain the received data element
public let intentToRetain: Bool?
/// Indicates whether the data element is optional.
/// false or nil value of the property indicates the field is required
public let isOptional: Bool?
}