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

import Foundation
import Get
import URLQueryEncoder

extension Paths.Video.Hooks.Comments.WithCommentId {
    public var replies: Replies {
        Replies(path: path + "/replies")
    }

    public struct Replies {
        /// Path: `/api/video/hooks/comments/{comment_id}/replies`
        public let path: String

        /// Get Comment Replies
        ///
        /// Get the replies to a comment.
        public func get(parameters: GetParameters? = nil) -> Request<GenAPI.GetCommentRepliesResponse> {
            Request(path: path, method: "GET", query: parameters?.asQuery, id: "studio_api_video_hooks_comments_api_get_comment_replies")
        }

        public struct GetParameters {
            public var cursor: String?
            public var pageSize: Int?
            public var deeplinkedCommentId: String?
            /// CommentEntityType
            public var entityType: EntityType?

            /// CommentEntityType
            public struct EntityType: RawRepresentable, Codable, Equatable {
                public let rawValue: String

                public init(rawValue: String) {
                    self.rawValue = rawValue
                }

                public static let clip = Self(rawValue: "clip")
                public static let hook = Self(rawValue: "hook")
            }

            public init(cursor: String? = nil, pageSize: Int? = nil, deeplinkedCommentId: String? = nil, entityType: EntityType? = nil) {
                self.cursor = cursor
                self.pageSize = pageSize
                self.deeplinkedCommentId = deeplinkedCommentId
                self.entityType = entityType
            }

            public var asQuery: [(String, String?)] {
                let encoder = URLQueryEncoder()
                encoder.encode(cursor, forKey: "cursor")
                encoder.encode(pageSize, forKey: "page_size")
                encoder.encode(deeplinkedCommentId, forKey: "deeplinked_comment_id")
                encoder.encode(entityType, forKey: "entity_type")
                return encoder.items
            }
        }
    }
}
