2022-12-04 02:29:46 +01:00
|
|
|
//
|
|
|
|
// DeleteItemEndpoint.swift
|
|
|
|
// APIService
|
|
|
|
//
|
|
|
|
// Created by Javier Cicchelli on 04/12/2022.
|
|
|
|
// Copyright © 2022 Röck+Cöde. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2022-12-04 03:04:57 +01:00
|
|
|
import Foundation
|
|
|
|
|
2022-12-04 02:29:46 +01:00
|
|
|
struct DeleteItemEndpoint: Endpoint {
|
|
|
|
let path: String
|
|
|
|
let method: RequestMethod
|
|
|
|
let credentials: BasicCredentials
|
|
|
|
let headers: [String : String]
|
2022-12-04 03:04:57 +01:00
|
|
|
let body: Data?
|
2022-12-04 02:29:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// MARK: - Initialisers
|
|
|
|
|
|
|
|
extension DeleteItemEndpoint {
|
|
|
|
init(
|
|
|
|
itemId: String,
|
|
|
|
username: String,
|
|
|
|
password: String
|
|
|
|
) {
|
|
|
|
self.path = .init(format: .Formats.itemsWithId, itemId)
|
|
|
|
self.method = .delete
|
|
|
|
self.credentials = .init(
|
|
|
|
username: username,
|
|
|
|
password: password
|
|
|
|
)
|
|
|
|
self.headers = [:]
|
|
|
|
self.body = nil
|
|
|
|
}
|
|
|
|
}
|