Skip to content

Commit

Permalink
Update MusicDataDeleteRequest, MusicDataPostRequest, and MusicDataPut…
Browse files Browse the repository at this point in the history
…Request
  • Loading branch information
rudrankriyam committed Jun 11, 2022
1 parent 4a18b18 commit bc6bab6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import Foundation
import MusicKit

public struct MusicDataDeleteRequest {
/// The URL for the data request.
Expand All @@ -18,11 +19,11 @@ public struct MusicDataDeleteRequest {

/// Uploads data the Apple Music API endpoint that
/// the URL request defines.
public func response() async throws -> MusicDataPostResponse {
public func response() async throws -> MusicDataResponse {
var urlRequest = URLRequest(url: url)
urlRequest.httpMethod = "DELETE"

var request = MusicTokenRequest(urlRequest: urlRequest)
let request = MusicDataRequest(urlRequest: urlRequest)
let response = try await request.response()
return response
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/MusadoraKit/Add Resources/MusicDataPostRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ public struct MusicDataPostRequest {

/// Uploads data the Apple Music API endpoint that
/// the URL request defines.
public func response() async throws -> MusicDataPostResponse {
public func response() async throws -> MusicDataResponse {
var urlRequest = URLRequest(url: url)
urlRequest.httpMethod = "POST"

var request = MusicTokenRequest(urlRequest: urlRequest)
let request = MusicDataRequest(urlRequest: urlRequest)
let response = try await request.response()
return response
}
Expand Down
5 changes: 3 additions & 2 deletions Sources/MusadoraKit/Add Resources/MusicDataPutRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import Foundation
import MusicKit

public struct MusicDataPutRequest {
/// The URL for the data request.
Expand All @@ -22,12 +23,12 @@ public struct MusicDataPutRequest {

/// Uploads data the Apple Music API endpoint that
/// the URL request defines.
public func response() async throws -> MusicDataPostResponse {
public func response() async throws -> MusicDataResponse {
var urlRequest = URLRequest(url: url)
urlRequest.httpMethod = "PUT"
urlRequest.httpBody = data

var request = MusicTokenRequest(urlRequest: urlRequest)
let request = MusicDataRequest(urlRequest: urlRequest)
let response = try await request.response()
return response
}
Expand Down
28 changes: 0 additions & 28 deletions Sources/MusadoraKit/Add Resources/MusicTokenRequest.swift

This file was deleted.

19 changes: 0 additions & 19 deletions Sources/MusadoraKit/Add Resources/MusicTokenResponse.swift

This file was deleted.

0 comments on commit bc6bab6

Please sign in to comment.