From 25fdc1fabd9e06793488aa5679553d7115e5dca2 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Sat, 11 Oct 2025 09:59:35 +0200 Subject: [PATCH] Implemented a Product model in the library target. --- .../Public/Models/Product.swift | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Sources/DiscogsService/Public/Models/Product.swift diff --git a/Sources/DiscogsService/Public/Models/Product.swift b/Sources/DiscogsService/Public/Models/Product.swift new file mode 100644 index 000000000..b52d52b59 --- /dev/null +++ b/Sources/DiscogsService/Public/Models/Product.swift @@ -0,0 +1,48 @@ +// ===----------------------------------------------------------------------=== +// +// This source file is part of the DiscogsService open source project +// +// Copyright (c) 2025 Röck+Cöde VoF. and the DiscogsService project authors +// Licensed under Apache license v2.0 +// +// See LICENSE for license information +// See CONTRIBUTORS for the list of DiscogsService project authors +// +// SPDX-License-Identifier: Apache-2.0 +// +// ===----------------------------------------------------------------------=== + +import Foundation + +/// A type that represents a product that uses the ``Client`` client. +public struct Product: Sendable { + + // MARK: Properties + + /// A camel-cased name of a product. + let name: String + + /// A URI link related to a product. + let url: String + + /// A semantic version of a product. + let version: String + + // MARK: Initializers + + /// Initializes this model. + /// - Parameters: + /// - name: A camel-cased name of a product. + /// - version: A URI link related to a product. + /// - url: A semantic version of a product. + public init( + name: String, + version: String, + url: String + ) { + self.name = name + self.url = url + self.version = version + } + +}