// Generated by Create API
// https://github.com/CreateAPI/CreateAPI

import Foundation
import Get
import URLQueryEncoder

extension Paths.Contests {
    public var votes: Votes {
        Votes(path: path + "/votes")
    }

    public struct Votes {
        /// Path: `/api/contests/votes`
        public let path: String

        /// Get All Votes
        public func get(parameters: GetParameters? = nil) -> Request<GenAPI.PaginatedVotesResponse> {
            Request(path: path, method: "GET", query: parameters?.asQuery, id: "studio_api_contests_api_get_all_votes")
        }

        public struct GetParameters {
            public var page: Int?
            public var pageSize: Int?
            public var contestId: String?

            public init(page: Int? = nil, pageSize: Int? = nil, contestId: String? = nil) {
                self.page = page
                self.pageSize = pageSize
                self.contestId = contestId
            }

            public var asQuery: [(String, String?)] {
                let encoder = URLQueryEncoder()
                encoder.encode(page, forKey: "page")
                encoder.encode(pageSize, forKey: "page_size")
                encoder.encode(contestId, forKey: "contest_id")
                return encoder.items
            }
        }
    }
}
