35 lines
764 B
Swift
35 lines
764 B
Swift
|
//
|
||
|
// DeleteItemEndpoint.swift
|
||
|
// APIService
|
||
|
//
|
||
|
// Created by Javier Cicchelli on 04/12/2022.
|
||
|
// Copyright © 2022 Röck+Cöde. All rights reserved.
|
||
|
//
|
||
|
|
||
|
struct DeleteItemEndpoint: Endpoint {
|
||
|
let path: String
|
||
|
let method: RequestMethod
|
||
|
let credentials: BasicCredentials
|
||
|
let headers: [String : String]
|
||
|
let body: [String : String]?
|
||
|
}
|
||
|
|
||
|
// 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
|
||
|
}
|
||
|
}
|