//
// Class10useruserIdeditedAPI.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
//

import Foundation
import Alamofire



open class Class10useruserIdeditedAPI {
    /**
     .
     
     - parameter userId: (path) the user&#39;s userId 
     - parameter p: (query) the number of the result page (optional, default to 1)
     - parameter completion: completion handler to receive the data and the error objects
     */
    open class func getUserEditedSetlistsGET(userId: String, p: Int? = nil, completion: @escaping ((_ data: Setlists?,_ error: Error?) -> Void)) {
        getUserEditedSetlistsGETWithRequestBuilder(userId: userId, p: p).execute { (response, error) -> Void in
            completion(response?.body, error)
        }
    }


    /**
     .
     - GET /1.0/user/{userId}/edited
     - <p> Get a list of setlists of concerts edited by a user. The list contains the current version, not the version edited. </p>
     - examples: [{contentType=application/json, example={
  "setlist" : [ {
    "artist" : {
      "mbid" : "b10bbbfc-cf9e-42e0-be17-e2c3e1d2600d",
      "tmid" : 735610,
      "name" : "The Beatles",
      "sortName" : "Beatles, The",
      "disambiguation" : "John, Paul, George and Ringo",
      "url" : "https://www.setlist.fm/setlists/the-beatles-23d6a88b.html"
    },
    "venue" : {
      "city" : { },
      "url" : "https://www.setlist.fm/venue/compaq-center-san-jose-ca-usa-6bd6ca6e.html",
      "id" : "6bd6ca6e",
      "name" : "Compaq Center"
    },
    "tour" : {
      "name" : "North American Tour 1964"
    },
    "set" : [ {
      "name" : "...",
      "encore" : 12345,
      "song" : [ { }, { } ]
    }, {
      "name" : "...",
      "encore" : 12345,
      "song" : [ { }, { } ]
    } ],
    "info" : "Recorded and published as 'The Beatles at the Hollywood Bowl'",
    "url" : "https://www.setlist.fm/setlist/the-beatles/1964/hollywood-bowl-hollywood-ca-63de4613.html",
    "id" : "63de4613",
    "versionId" : "7be1aaa0",
    "eventDate" : "23-08-1964",
    "lastUpdated" : "2013-10-20T05:18:08.000+0000"
  }, {
    "artist" : {
      "mbid" : "...",
      "tmid" : 12345,
      "name" : "...",
      "sortName" : "...",
      "disambiguation" : "...",
      "url" : "..."
    },
    "venue" : {
      "city" : { },
      "url" : "...",
      "id" : "...",
      "name" : "..."
    },
    "tour" : {
      "name" : "..."
    },
    "set" : [ {
      "name" : "...",
      "encore" : 12345,
      "song" : [ { }, { } ]
    }, {
      "name" : "...",
      "encore" : 12345,
      "song" : [ { }, { } ]
    } ],
    "info" : "...",
    "url" : "...",
    "id" : "...",
    "versionId" : "...",
    "eventDate" : "...",
    "lastUpdated" : "..."
  } ],
  "total" : 42,
  "page" : 1,
  "itemsPerPage" : 20
}}]
     
     - parameter userId: (path) the user&#39;s userId 
     - parameter p: (query) the number of the result page (optional, default to 1)

     - returns: RequestBuilder<Setlists> 
     */
    open class func getUserEditedSetlistsGETWithRequestBuilder(userId: String, p: Int? = nil) -> RequestBuilder<Setlists> {
        var path = "/1.0/user/{userId}/edited"
        let userIdPreEscape = "\(userId)"
        let userIdPostEscape = userIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
        path = path.replacingOccurrences(of: "{userId}", with: userIdPostEscape, options: .literal, range: nil)
        let URLString = SwaggerClientAPI.basePath + path
        let parameters: [String:Any]? = nil
        
        var url = URLComponents(string: URLString)
        url?.queryItems = APIHelper.mapValuesToQueryItems([
            "p": p?.encodeToJSON()
        ])

        let requestBuilder: RequestBuilder<Setlists>.Type = SwaggerClientAPI.requestBuilderFactory.getBuilder()

        return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false)
    }

}
