mirror of
https://github.com/encounter/JSONAPI.git
synced 2026-03-30 11:18:38 -07:00
Add a couple of missing initializers to Entity
This commit is contained in:
@@ -326,6 +326,12 @@ extension Entity where MetaType == NoMetadata, EntityRawIdType: CreatableRawIdTy
|
||||
}
|
||||
}
|
||||
|
||||
extension Entity where MetaType == NoMetadata, EntityRawIdType == Unidentified {
|
||||
public init(attributes: Description.Attributes, relationships: Description.Relationships, links: LinksType) {
|
||||
self.init(attributes: attributes, relationships: relationships, meta: .none, links: links)
|
||||
}
|
||||
}
|
||||
|
||||
extension Entity where LinksType == NoLinks {
|
||||
public init(id: Entity.Id, attributes: Description.Attributes, relationships: Description.Relationships, meta: MetaType) {
|
||||
self.init(id: id, attributes: attributes, relationships: relationships, meta: meta, links: .none)
|
||||
@@ -338,6 +344,12 @@ extension Entity where LinksType == NoLinks, EntityRawIdType: CreatableRawIdType
|
||||
}
|
||||
}
|
||||
|
||||
extension Entity where LinksType == NoLinks, EntityRawIdType == Unidentified {
|
||||
public init(attributes: Description.Attributes, relationships: Description.Relationships, meta: MetaType) {
|
||||
self.init(attributes: attributes, relationships: relationships, meta: meta, links: .none)
|
||||
}
|
||||
}
|
||||
|
||||
extension Entity where MetaType == NoMetadata, LinksType == NoLinks {
|
||||
public init(id: Entity.Id, attributes: Description.Attributes, relationships: Description.Relationships) {
|
||||
self.init(id: id, attributes: attributes, relationships: relationships, meta: .none, links: .none)
|
||||
@@ -350,6 +362,12 @@ extension Entity where MetaType == NoMetadata, LinksType == NoLinks, EntityRawId
|
||||
}
|
||||
}
|
||||
|
||||
extension Entity where MetaType == NoMetadata, LinksType == NoLinks, EntityRawIdType == Unidentified {
|
||||
public init(attributes: Description.Attributes, relationships: Description.Relationships) {
|
||||
self.init(attributes: attributes, relationships: relationships, meta: .none, links: .none)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Pointer for Relationships use.
|
||||
public extension Entity where EntityRawIdType: JSONAPI.RawIdType {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user