From b0823b74ae5151fef47ac3016992a241b2970cf7 Mon Sep 17 00:00:00 2001 From: Devel user for SPP Date: Mon, 13 May 2019 10:22:19 +0200 Subject: [PATCH] =?UTF-8?q?Dateien=20hochladen=20nach=20=E2=80=9ETestDir?= =?UTF-8?q?=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TestDir/Permission.swift | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 TestDir/Permission.swift diff --git a/TestDir/Permission.swift b/TestDir/Permission.swift new file mode 100644 index 0000000..83cd22e --- /dev/null +++ b/TestDir/Permission.swift @@ -0,0 +1,30 @@ +// +// Permission.swift +// Gitea Client +// +// Created by Johann Neuhauser on 13.05.19. +// Copyright © 2019 Johann Neuhauser. All rights reserved. +// + +import Foundation + +struct Permission : Codable { + + let admin : Bool? + let pull : Bool? + let push : Bool? + + enum CodingKeys: String, CodingKey { + case admin = "admin" + case pull = "pull" + case push = "push" + } + + init(from decoder: Decoder) throws { + let values = try decoder.container(keyedBy: CodingKeys.self) + admin = try values.decodeIfPresent(Bool.self, forKey: .admin) + pull = try values.decodeIfPresent(Bool.self, forKey: .pull) + push = try values.decodeIfPresent(Bool.self, forKey: .push) + } + +}