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

import Foundation
import Alamofire


open class ReportingAPI: APIBase {
    /**
     Report a comment as spam, offensive, etc.
     - parameter commentHandle: (path) Comment handle for the comment being reported on 
     - parameter postReportRequest: (body) Post report request 
     - parameter authorization: (header) Format is: \&quot;Scheme CredentialsList\&quot;. Possible values are:  - Anon AK&#x3D;AppKey  - SocialPlus TK&#x3D;SessionToken  - Facebook AK&#x3D;AppKey|TK&#x3D;AccessToken  - Google AK&#x3D;AppKey|TK&#x3D;AccessToken  - Twitter AK&#x3D;AppKey|RT&#x3D;RequestToken|TK&#x3D;AccessToken  - Microsoft AK&#x3D;AppKey|TK&#x3D;AccessToken  - AADS2S AK&#x3D;AppKey|[UH&#x3D;UserHandle]|TK&#x3D;AADToken 
     - parameter completion: completion handler to receive the data and the error objects
     */
    open class func commentReportsPostReport(commentHandle: String, postReportRequest: PostReportRequest, authorization: String, completion: @escaping ((_ data: Object?, _ error: ErrorResponse?) -> Void)) {
        commentReportsPostReportWithRequestBuilder(commentHandle: commentHandle, postReportRequest: postReportRequest, authorization: authorization).execute { (response, error) -> Void in
            completion(response?.body, error)
        }
    }


    /**
     Report a comment as spam, offensive, etc.
     - POST /v0.7/comments/{commentHandle}/reports

     - examples: [{contentType=application/json, example={ }}, {contentType=application/xml, example=<null>
</null>}]
     - examples: [{contentType=application/json, example={ }}, {contentType=application/xml, example=<null>
</null>}]
     - parameter commentHandle: (path) Comment handle for the comment being reported on 
     - parameter postReportRequest: (body) Post report request 
     - parameter authorization: (header) Format is: \&quot;Scheme CredentialsList\&quot;. Possible values are:  - Anon AK&#x3D;AppKey  - SocialPlus TK&#x3D;SessionToken  - Facebook AK&#x3D;AppKey|TK&#x3D;AccessToken  - Google AK&#x3D;AppKey|TK&#x3D;AccessToken  - Twitter AK&#x3D;AppKey|RT&#x3D;RequestToken|TK&#x3D;AccessToken  - Microsoft AK&#x3D;AppKey|TK&#x3D;AccessToken  - AADS2S AK&#x3D;AppKey|[UH&#x3D;UserHandle]|TK&#x3D;AADToken 
     - returns: RequestBuilder<Object> 
     */
    open class func commentReportsPostReportWithRequestBuilder(commentHandle: String, postReportRequest: PostReportRequest, authorization: String) -> RequestBuilder<Object> {
        var path = "/v0.7/comments/{commentHandle}/reports"
        path = path.replacingOccurrences(of: "{commentHandle}", with: "\(commentHandle)", options: .literal, range: nil)
        let URLString = EmbeddedSocialClientAPI.basePath + path
        let parameters = postReportRequest.encodeToJSON() as? [String:AnyObject]

        let url = NSURLComponents(string: URLString)
        let nillableHeaders: [String: Any?] = [
            "Authorization": authorization
        ]
        let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)

        let requestBuilder: RequestBuilder<Object>.Type = EmbeddedSocialClientAPI.requestBuilderFactory.getBuilder()

        return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true, headers: headerParameters)
    }

    /**
     Report a reply as spam, offensive, etc.
     - parameter replyHandle: (path) Reply handle for the reply being reported on 
     - parameter postReportRequest: (body) Post report request 
     - parameter authorization: (header) Format is: \&quot;Scheme CredentialsList\&quot;. Possible values are:  - Anon AK&#x3D;AppKey  - SocialPlus TK&#x3D;SessionToken  - Facebook AK&#x3D;AppKey|TK&#x3D;AccessToken  - Google AK&#x3D;AppKey|TK&#x3D;AccessToken  - Twitter AK&#x3D;AppKey|RT&#x3D;RequestToken|TK&#x3D;AccessToken  - Microsoft AK&#x3D;AppKey|TK&#x3D;AccessToken  - AADS2S AK&#x3D;AppKey|[UH&#x3D;UserHandle]|TK&#x3D;AADToken 
     - parameter completion: completion handler to receive the data and the error objects
     */
    open class func replyReportsPostReport(replyHandle: String, postReportRequest: PostReportRequest, authorization: String, completion: @escaping ((_ data: Object?, _ error: ErrorResponse?) -> Void)) {
        replyReportsPostReportWithRequestBuilder(replyHandle: replyHandle, postReportRequest: postReportRequest, authorization: authorization).execute { (response, error) -> Void in
            completion(response?.body, error)
        }
    }


    /**
     Report a reply as spam, offensive, etc.
     - POST /v0.7/replies/{replyHandle}/reports

     - examples: [{contentType=application/json, example={ }}, {contentType=application/xml, example=<null>
</null>}]
     - examples: [{contentType=application/json, example={ }}, {contentType=application/xml, example=<null>
</null>}]
     - parameter replyHandle: (path) Reply handle for the reply being reported on 
     - parameter postReportRequest: (body) Post report request 
     - parameter authorization: (header) Format is: \&quot;Scheme CredentialsList\&quot;. Possible values are:  - Anon AK&#x3D;AppKey  - SocialPlus TK&#x3D;SessionToken  - Facebook AK&#x3D;AppKey|TK&#x3D;AccessToken  - Google AK&#x3D;AppKey|TK&#x3D;AccessToken  - Twitter AK&#x3D;AppKey|RT&#x3D;RequestToken|TK&#x3D;AccessToken  - Microsoft AK&#x3D;AppKey|TK&#x3D;AccessToken  - AADS2S AK&#x3D;AppKey|[UH&#x3D;UserHandle]|TK&#x3D;AADToken 
     - returns: RequestBuilder<Object> 
     */
    open class func replyReportsPostReportWithRequestBuilder(replyHandle: String, postReportRequest: PostReportRequest, authorization: String) -> RequestBuilder<Object> {
        var path = "/v0.7/replies/{replyHandle}/reports"
        path = path.replacingOccurrences(of: "{replyHandle}", with: "\(replyHandle)", options: .literal, range: nil)
        let URLString = EmbeddedSocialClientAPI.basePath + path
        let parameters = postReportRequest.encodeToJSON() as? [String:AnyObject]

        let url = NSURLComponents(string: URLString)
        let nillableHeaders: [String: Any?] = [
            "Authorization": authorization
        ]
        let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)

        let requestBuilder: RequestBuilder<Object>.Type = EmbeddedSocialClientAPI.requestBuilderFactory.getBuilder()

        return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true, headers: headerParameters)
    }

    /**
     Report a topic as spam, offensive, etc.
     - parameter topicHandle: (path) Topic handle being reported on 
     - parameter postReportRequest: (body) Post report request 
     - parameter authorization: (header) Format is: \&quot;Scheme CredentialsList\&quot;. Possible values are:  - Anon AK&#x3D;AppKey  - SocialPlus TK&#x3D;SessionToken  - Facebook AK&#x3D;AppKey|TK&#x3D;AccessToken  - Google AK&#x3D;AppKey|TK&#x3D;AccessToken  - Twitter AK&#x3D;AppKey|RT&#x3D;RequestToken|TK&#x3D;AccessToken  - Microsoft AK&#x3D;AppKey|TK&#x3D;AccessToken  - AADS2S AK&#x3D;AppKey|[UH&#x3D;UserHandle]|TK&#x3D;AADToken 
     - parameter completion: completion handler to receive the data and the error objects
     */
    open class func topicReportsPostReport(topicHandle: String, postReportRequest: PostReportRequest, authorization: String, completion: @escaping ((_ data: Object?, _ error: ErrorResponse?) -> Void)) {
        topicReportsPostReportWithRequestBuilder(topicHandle: topicHandle, postReportRequest: postReportRequest, authorization: authorization).execute { (response, error) -> Void in
            completion(response?.body, error)
        }
    }


    /**
     Report a topic as spam, offensive, etc.
     - POST /v0.7/topics/{topicHandle}/reports

     - examples: [{contentType=application/json, example={ }}, {contentType=application/xml, example=<null>
</null>}]
     - examples: [{contentType=application/json, example={ }}, {contentType=application/xml, example=<null>
</null>}]
     - parameter topicHandle: (path) Topic handle being reported on 
     - parameter postReportRequest: (body) Post report request 
     - parameter authorization: (header) Format is: \&quot;Scheme CredentialsList\&quot;. Possible values are:  - Anon AK&#x3D;AppKey  - SocialPlus TK&#x3D;SessionToken  - Facebook AK&#x3D;AppKey|TK&#x3D;AccessToken  - Google AK&#x3D;AppKey|TK&#x3D;AccessToken  - Twitter AK&#x3D;AppKey|RT&#x3D;RequestToken|TK&#x3D;AccessToken  - Microsoft AK&#x3D;AppKey|TK&#x3D;AccessToken  - AADS2S AK&#x3D;AppKey|[UH&#x3D;UserHandle]|TK&#x3D;AADToken 
     - returns: RequestBuilder<Object> 
     */
    open class func topicReportsPostReportWithRequestBuilder(topicHandle: String, postReportRequest: PostReportRequest, authorization: String) -> RequestBuilder<Object> {
        var path = "/v0.7/topics/{topicHandle}/reports"
        path = path.replacingOccurrences(of: "{topicHandle}", with: "\(topicHandle)", options: .literal, range: nil)
        let URLString = EmbeddedSocialClientAPI.basePath + path
        let parameters = postReportRequest.encodeToJSON() as? [String:AnyObject]

        let url = NSURLComponents(string: URLString)
        let nillableHeaders: [String: Any?] = [
            "Authorization": authorization
        ]
        let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)

        let requestBuilder: RequestBuilder<Object>.Type = EmbeddedSocialClientAPI.requestBuilderFactory.getBuilder()

        return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true, headers: headerParameters)
    }

    /**
     Report a user as spam, offensive, etc.
     - parameter userHandle: (path) User handle being reported on 
     - parameter postReportRequest: (body) Post report request 
     - parameter authorization: (header) Format is: \&quot;Scheme CredentialsList\&quot;. Possible values are:  - Anon AK&#x3D;AppKey  - SocialPlus TK&#x3D;SessionToken  - Facebook AK&#x3D;AppKey|TK&#x3D;AccessToken  - Google AK&#x3D;AppKey|TK&#x3D;AccessToken  - Twitter AK&#x3D;AppKey|RT&#x3D;RequestToken|TK&#x3D;AccessToken  - Microsoft AK&#x3D;AppKey|TK&#x3D;AccessToken  - AADS2S AK&#x3D;AppKey|[UH&#x3D;UserHandle]|TK&#x3D;AADToken 
     - parameter completion: completion handler to receive the data and the error objects
     */
    open class func userReportsPostReport(userHandle: String, postReportRequest: PostReportRequest, authorization: String, completion: @escaping ((_ data: Object?, _ error: ErrorResponse?) -> Void)) {
        userReportsPostReportWithRequestBuilder(userHandle: userHandle, postReportRequest: postReportRequest, authorization: authorization).execute { (response, error) -> Void in
            completion(response?.body, error)
        }
    }


    /**
     Report a user as spam, offensive, etc.
     - POST /v0.7/users/{userHandle}/reports
     - This call allows a user to complain about another user's profile content              (photo, bio, name) as containing spam, offensive material, etc.

     - examples: [{contentType=application/json, example={ }}, {contentType=application/xml, example=<null>
</null>}]
     - examples: [{contentType=application/json, example={ }}, {contentType=application/xml, example=<null>
</null>}]
     - parameter userHandle: (path) User handle being reported on 
     - parameter postReportRequest: (body) Post report request 
     - parameter authorization: (header) Format is: \&quot;Scheme CredentialsList\&quot;. Possible values are:  - Anon AK&#x3D;AppKey  - SocialPlus TK&#x3D;SessionToken  - Facebook AK&#x3D;AppKey|TK&#x3D;AccessToken  - Google AK&#x3D;AppKey|TK&#x3D;AccessToken  - Twitter AK&#x3D;AppKey|RT&#x3D;RequestToken|TK&#x3D;AccessToken  - Microsoft AK&#x3D;AppKey|TK&#x3D;AccessToken  - AADS2S AK&#x3D;AppKey|[UH&#x3D;UserHandle]|TK&#x3D;AADToken 
     - returns: RequestBuilder<Object> 
     */
    open class func userReportsPostReportWithRequestBuilder(userHandle: String, postReportRequest: PostReportRequest, authorization: String) -> RequestBuilder<Object> {
        var path = "/v0.7/users/{userHandle}/reports"
        path = path.replacingOccurrences(of: "{userHandle}", with: "\(userHandle)", options: .literal, range: nil)
        let URLString = EmbeddedSocialClientAPI.basePath + path
        let parameters = postReportRequest.encodeToJSON() as? [String:AnyObject]

        let url = NSURLComponents(string: URLString)
        let nillableHeaders: [String: Any?] = [
            "Authorization": authorization
        ]
        let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders)

        let requestBuilder: RequestBuilder<Object>.Type = EmbeddedSocialClientAPI.requestBuilderFactory.getBuilder()

        return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true, headers: headerParameters)
    }

}
