Skip to content

Commit 005a981

Browse files
committed
Add a couple of missing initializers to Entity
1 parent fad4520 commit 005a981

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Sources/JSONAPI/Resource/Entity.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,12 @@ extension Entity where MetaType == NoMetadata, EntityRawIdType: CreatableRawIdTy
326326
}
327327
}
328328

329+
extension Entity where MetaType == NoMetadata, EntityRawIdType == Unidentified {
330+
public init(attributes: Description.Attributes, relationships: Description.Relationships, links: LinksType) {
331+
self.init(attributes: attributes, relationships: relationships, meta: .none, links: links)
332+
}
333+
}
334+
329335
extension Entity where LinksType == NoLinks {
330336
public init(id: Entity.Id, attributes: Description.Attributes, relationships: Description.Relationships, meta: MetaType) {
331337
self.init(id: id, attributes: attributes, relationships: relationships, meta: meta, links: .none)
@@ -338,6 +344,12 @@ extension Entity where LinksType == NoLinks, EntityRawIdType: CreatableRawIdType
338344
}
339345
}
340346

347+
extension Entity where LinksType == NoLinks, EntityRawIdType == Unidentified {
348+
public init(attributes: Description.Attributes, relationships: Description.Relationships, meta: MetaType) {
349+
self.init(attributes: attributes, relationships: relationships, meta: meta, links: .none)
350+
}
351+
}
352+
341353
extension Entity where MetaType == NoMetadata, LinksType == NoLinks {
342354
public init(id: Entity.Id, attributes: Description.Attributes, relationships: Description.Relationships) {
343355
self.init(id: id, attributes: attributes, relationships: relationships, meta: .none, links: .none)
@@ -350,6 +362,12 @@ extension Entity where MetaType == NoMetadata, LinksType == NoLinks, EntityRawId
350362
}
351363
}
352364

365+
extension Entity where MetaType == NoMetadata, LinksType == NoLinks, EntityRawIdType == Unidentified {
366+
public init(attributes: Description.Attributes, relationships: Description.Relationships) {
367+
self.init(attributes: attributes, relationships: relationships, meta: .none, links: .none)
368+
}
369+
}
370+
353371
// MARK: Pointer for Relationships use.
354372
public extension Entity where EntityRawIdType: JSONAPI.RawIdType {
355373

0 commit comments

Comments
 (0)