diff --git a/Examples/FriendlyFlix/app/FriendlyFlixSDK/Package.swift b/Examples/FriendlyFlix/app/FriendlyFlixSDK/Package.swift index 52016e3..e0619f4 100644 --- a/Examples/FriendlyFlix/app/FriendlyFlixSDK/Package.swift +++ b/Examples/FriendlyFlix/app/FriendlyFlixSDK/Package.swift @@ -4,31 +4,30 @@ import PackageDescription let package = Package( - name: "FriendlyFlixSDK", - platforms: [ - .iOS(.v17), - .macOS(.v14), - .watchOS(.v10), - .tvOS(.v17) - ], - products: [ - .library( - name: "FriendlyFlixSDK", - targets: ["FriendlyFlixSDK"]), - ], - dependencies: [ - - .package(url: "https://github.com/firebase/data-connect-ios-sdk", from: "11.3.0-beta"), - - ], - targets: [ - .target( - name: "FriendlyFlixSDK", - dependencies: [ - .product(name:"FirebaseDataConnect", package:"data-connect-ios-sdk") - ], - path: "Sources" - ) - ] -) + name: "FriendlyFlixSDK", + platforms: [ + .iOS(.v17), + .macOS(.v14), + .watchOS(.v10), + .tvOS(.v17), + ], + products: [ + .library( + name: "FriendlyFlixSDK", + targets: ["FriendlyFlixSDK"] + ), + ], + dependencies: [ + .package(url: "https://github.com/firebase/data-connect-ios-sdk", from: "11.3.0-beta"), + ], + targets: [ + .target( + name: "FriendlyFlixSDK", + dependencies: [ + .product(name: "FirebaseDataConnect", package: "data-connect-ios-sdk"), + ], + path: "Sources" + ), + ] +) diff --git a/Examples/FriendlyFlix/app/FriendlyFlixSDK/README.md b/Examples/FriendlyFlix/app/FriendlyFlixSDK/README.md index 10b2114..fdce190 100644 --- a/Examples/FriendlyFlix/app/FriendlyFlixSDK/README.md +++ b/Examples/FriendlyFlix/app/FriendlyFlixSDK/README.md @@ -366,7 +366,7 @@ DataConnect.friendlyFlixConnector.getUserFavoriteMoviesQuery.execute(...) let username: String = ... ``` - + ### One-shot execute ``` @@ -382,7 +382,7 @@ DataConnect.friendlyFlixConnector.upsertUserMutation.execute(...) let movieId: UUID = ... ``` - + ### One-shot execute ``` @@ -398,7 +398,7 @@ DataConnect.friendlyFlixConnector.addFavoritedMovieMutation.execute(...) let movieId: UUID = ... ``` - + ### One-shot execute ``` @@ -416,7 +416,7 @@ let movieId: UUID = ... let rating: Int = ... let reviewText: String = ... ``` - + ### One-shot execute ``` @@ -434,7 +434,7 @@ let movieId: UUID = ... let rating: Int = ... let reviewText: String = ... ``` - + ### One-shot execute ``` @@ -450,7 +450,7 @@ DataConnect.friendlyFlixConnector.updateReviewMutation.execute(...) let movieId: UUID = ... ``` - + ### One-shot execute ``` diff --git a/Examples/FriendlyFlix/app/FriendlyFlixSDK/Sources/FriendlyFlixClient.swift b/Examples/FriendlyFlix/app/FriendlyFlixSDK/Sources/FriendlyFlixClient.swift index 800a4cb..a3406d9 100644 --- a/Examples/FriendlyFlix/app/FriendlyFlixSDK/Sources/FriendlyFlixClient.swift +++ b/Examples/FriendlyFlix/app/FriendlyFlixSDK/Sources/FriendlyFlixClient.swift @@ -4,68 +4,64 @@ import Foundation import FirebaseCore import FirebaseDataConnect - - - - - - - public extension DataConnect { - static let friendlyFlixConnector: FriendlyFlixConnector = { - let dc = DataConnect.dataConnect(connectorConfig: FriendlyFlixConnector.connectorConfig, callerSDKType: .generated) + let dc = DataConnect.dataConnect( + connectorConfig: FriendlyFlixConnector.connectorConfig, + callerSDKType: .generated + ) return FriendlyFlixConnector(dataConnect: dc) }() - } public class FriendlyFlixConnector { - let dataConnect: DataConnect - public static let connectorConfig = ConnectorConfig(serviceId: "dataconnect", location: "us-central1", connector: "friendly-flix") + public static let connectorConfig = ConnectorConfig( + serviceId: "dataconnect", + location: "us-central1", + connector: "friendly-flix" + ) init(dataConnect: DataConnect) { self.dataConnect = dataConnect - // init operations - self.upsertUserMutation = UpsertUserMutation(dataConnect: dataConnect) - self.addFavoritedMovieMutation = AddFavoritedMovieMutation(dataConnect: dataConnect) - self.deleteFavoritedMovieMutation = DeleteFavoritedMovieMutation(dataConnect: dataConnect) - self.addReviewMutation = AddReviewMutation(dataConnect: dataConnect) - self.updateReviewMutation = UpdateReviewMutation(dataConnect: dataConnect) - self.deleteReviewMutation = DeleteReviewMutation(dataConnect: dataConnect) - self.listMoviesQuery = ListMoviesQuery(dataConnect: dataConnect) - self.getMovieByIdQuery = GetMovieByIdQuery(dataConnect: dataConnect) - self.getActorByIdQuery = GetActorByIdQuery(dataConnect: dataConnect) - self.getCurrentUserQuery = GetCurrentUserQuery(dataConnect: dataConnect) - self.getIfFavoritedMovieQuery = GetIfFavoritedMovieQuery(dataConnect: dataConnect) - self.searchAllQuery = SearchAllQuery(dataConnect: dataConnect) - self.listMoviesByPartialTitleQuery = ListMoviesByPartialTitleQuery(dataConnect: dataConnect) - self.getUserFavoriteMoviesQuery = GetUserFavoriteMoviesQuery(dataConnect: dataConnect) - + // init operations + upsertUserMutation = UpsertUserMutation(dataConnect: dataConnect) + addFavoritedMovieMutation = AddFavoritedMovieMutation(dataConnect: dataConnect) + deleteFavoritedMovieMutation = DeleteFavoritedMovieMutation(dataConnect: dataConnect) + addReviewMutation = AddReviewMutation(dataConnect: dataConnect) + updateReviewMutation = UpdateReviewMutation(dataConnect: dataConnect) + deleteReviewMutation = DeleteReviewMutation(dataConnect: dataConnect) + listMoviesQuery = ListMoviesQuery(dataConnect: dataConnect) + getMovieByIdQuery = GetMovieByIdQuery(dataConnect: dataConnect) + getActorByIdQuery = GetActorByIdQuery(dataConnect: dataConnect) + getCurrentUserQuery = GetCurrentUserQuery(dataConnect: dataConnect) + getIfFavoritedMovieQuery = GetIfFavoritedMovieQuery(dataConnect: dataConnect) + searchAllQuery = SearchAllQuery(dataConnect: dataConnect) + listMoviesByPartialTitleQuery = ListMoviesByPartialTitleQuery(dataConnect: dataConnect) + getUserFavoriteMoviesQuery = GetUserFavoriteMoviesQuery(dataConnect: dataConnect) } - public func useEmulator(host: String = DataConnect.EmulatorDefaults.host, port: Int = DataConnect.EmulatorDefaults.port) { - self.dataConnect.useEmulator(host: host, port: port) + public func useEmulator(host: String = DataConnect.EmulatorDefaults.host, + port: Int = DataConnect.EmulatorDefaults.port) { + dataConnect.useEmulator(host: host, port: port) } // MARK: Operations -public let upsertUserMutation: UpsertUserMutation -public let addFavoritedMovieMutation: AddFavoritedMovieMutation -public let deleteFavoritedMovieMutation: DeleteFavoritedMovieMutation -public let addReviewMutation: AddReviewMutation -public let updateReviewMutation: UpdateReviewMutation -public let deleteReviewMutation: DeleteReviewMutation -public let listMoviesQuery: ListMoviesQuery -public let getMovieByIdQuery: GetMovieByIdQuery -public let getActorByIdQuery: GetActorByIdQuery -public let getCurrentUserQuery: GetCurrentUserQuery -public let getIfFavoritedMovieQuery: GetIfFavoritedMovieQuery -public let searchAllQuery: SearchAllQuery -public let listMoviesByPartialTitleQuery: ListMoviesByPartialTitleQuery -public let getUserFavoriteMoviesQuery: GetUserFavoriteMoviesQuery - + public let upsertUserMutation: UpsertUserMutation + public let addFavoritedMovieMutation: AddFavoritedMovieMutation + public let deleteFavoritedMovieMutation: DeleteFavoritedMovieMutation + public let addReviewMutation: AddReviewMutation + public let updateReviewMutation: UpdateReviewMutation + public let deleteReviewMutation: DeleteReviewMutation + public let listMoviesQuery: ListMoviesQuery + public let getMovieByIdQuery: GetMovieByIdQuery + public let getActorByIdQuery: GetActorByIdQuery + public let getCurrentUserQuery: GetCurrentUserQuery + public let getIfFavoritedMovieQuery: GetIfFavoritedMovieQuery + public let searchAllQuery: SearchAllQuery + public let listMoviesByPartialTitleQuery: ListMoviesByPartialTitleQuery + public let getUserFavoriteMoviesQuery: GetUserFavoriteMoviesQuery } diff --git a/Examples/FriendlyFlix/app/FriendlyFlixSDK/Sources/FriendlyFlixKeys.swift b/Examples/FriendlyFlix/app/FriendlyFlixSDK/Sources/FriendlyFlixKeys.swift index a331ec1..39d3051 100644 --- a/Examples/FriendlyFlix/app/FriendlyFlixSDK/Sources/FriendlyFlixKeys.swift +++ b/Examples/FriendlyFlix/app/FriendlyFlixSDK/Sources/FriendlyFlixKeys.swift @@ -2,444 +2,338 @@ import Foundation import FirebaseDataConnect - - public struct ActorKey { - public private(set) var id: UUID - enum CodingKeys: String, CodingKey { - - case id - + case id } } -extension ActorKey : Codable { +extension ActorKey: Codable { public init(from decoder: any Decoder) throws { var container = try decoder.container(keyedBy: CodingKeys.self) let codecHelper = CodecHelper() - - self.id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) - + id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) } public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - try codecHelper.encode(id, forKey: .id, container: &container) - - - } + var container = encoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() + + try codecHelper.encode(id, forKey: .id, container: &container) + } } -extension ActorKey : Equatable { +extension ActorKey: Equatable { public static func == (lhs: ActorKey, rhs: ActorKey) -> Bool { - if lhs.id != rhs.id { return false } - + return true } } -extension ActorKey : Hashable { +extension ActorKey: Hashable { public func hash(into hasher: inout Hasher) { - - hasher.combine(self.id) - + hasher.combine(id) } } -extension ActorKey : Sendable {} - - +extension ActorKey: Sendable {} public struct FavoriteMovieKey { - public private(set) var userId: String - + public private(set) var movieId: UUID - enum CodingKeys: String, CodingKey { - - case userId - - case movieId - + case userId + + case movieId } } -extension FavoriteMovieKey : Codable { +extension FavoriteMovieKey: Codable { public init(from decoder: any Decoder) throws { var container = try decoder.container(keyedBy: CodingKeys.self) let codecHelper = CodecHelper() - - self.userId = try codecHelper.decode(String.self, forKey: .userId, container: &container) - - self.movieId = try codecHelper.decode(UUID.self, forKey: .movieId, container: &container) - + userId = try codecHelper.decode(String.self, forKey: .userId, container: &container) + + movieId = try codecHelper.decode(UUID.self, forKey: .movieId, container: &container) } public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - try codecHelper.encode(userId, forKey: .userId, container: &container) - - - - try codecHelper.encode(movieId, forKey: .movieId, container: &container) - - - } + var container = encoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() + + try codecHelper.encode(userId, forKey: .userId, container: &container) + + try codecHelper.encode(movieId, forKey: .movieId, container: &container) + } } -extension FavoriteMovieKey : Equatable { +extension FavoriteMovieKey: Equatable { public static func == (lhs: FavoriteMovieKey, rhs: FavoriteMovieKey) -> Bool { - if lhs.userId != rhs.userId { return false } - + if lhs.movieId != rhs.movieId { return false } - + return true } } -extension FavoriteMovieKey : Hashable { +extension FavoriteMovieKey: Hashable { public func hash(into hasher: inout Hasher) { - - hasher.combine(self.userId) - - hasher.combine(self.movieId) - + hasher.combine(userId) + + hasher.combine(movieId) } } -extension FavoriteMovieKey : Sendable {} - - +extension FavoriteMovieKey: Sendable {} public struct MovieActorKey { - public private(set) var movieId: UUID - + public private(set) var actorId: UUID - enum CodingKeys: String, CodingKey { - - case movieId - - case actorId - + case movieId + + case actorId } } -extension MovieActorKey : Codable { +extension MovieActorKey: Codable { public init(from decoder: any Decoder) throws { var container = try decoder.container(keyedBy: CodingKeys.self) let codecHelper = CodecHelper() - - self.movieId = try codecHelper.decode(UUID.self, forKey: .movieId, container: &container) - - self.actorId = try codecHelper.decode(UUID.self, forKey: .actorId, container: &container) - + movieId = try codecHelper.decode(UUID.self, forKey: .movieId, container: &container) + + actorId = try codecHelper.decode(UUID.self, forKey: .actorId, container: &container) } public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - try codecHelper.encode(movieId, forKey: .movieId, container: &container) - - - - try codecHelper.encode(actorId, forKey: .actorId, container: &container) - - - } + var container = encoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() + + try codecHelper.encode(movieId, forKey: .movieId, container: &container) + + try codecHelper.encode(actorId, forKey: .actorId, container: &container) + } } -extension MovieActorKey : Equatable { +extension MovieActorKey: Equatable { public static func == (lhs: MovieActorKey, rhs: MovieActorKey) -> Bool { - if lhs.movieId != rhs.movieId { return false } - + if lhs.actorId != rhs.actorId { return false } - + return true } } -extension MovieActorKey : Hashable { +extension MovieActorKey: Hashable { public func hash(into hasher: inout Hasher) { - - hasher.combine(self.movieId) - - hasher.combine(self.actorId) - + hasher.combine(movieId) + + hasher.combine(actorId) } } -extension MovieActorKey : Sendable {} - - +extension MovieActorKey: Sendable {} public struct MovieMetadataKey { - public private(set) var id: UUID - enum CodingKeys: String, CodingKey { - - case id - + case id } } -extension MovieMetadataKey : Codable { +extension MovieMetadataKey: Codable { public init(from decoder: any Decoder) throws { var container = try decoder.container(keyedBy: CodingKeys.self) let codecHelper = CodecHelper() - - self.id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) - + id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) } public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - try codecHelper.encode(id, forKey: .id, container: &container) - - - } + var container = encoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() + + try codecHelper.encode(id, forKey: .id, container: &container) + } } -extension MovieMetadataKey : Equatable { +extension MovieMetadataKey: Equatable { public static func == (lhs: MovieMetadataKey, rhs: MovieMetadataKey) -> Bool { - if lhs.id != rhs.id { return false } - + return true } } -extension MovieMetadataKey : Hashable { +extension MovieMetadataKey: Hashable { public func hash(into hasher: inout Hasher) { - - hasher.combine(self.id) - + hasher.combine(id) } } -extension MovieMetadataKey : Sendable {} - - +extension MovieMetadataKey: Sendable {} public struct MovieKey { - public private(set) var id: UUID - enum CodingKeys: String, CodingKey { - - case id - + case id } } -extension MovieKey : Codable { +extension MovieKey: Codable { public init(from decoder: any Decoder) throws { var container = try decoder.container(keyedBy: CodingKeys.self) let codecHelper = CodecHelper() - - self.id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) - + id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) } public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - try codecHelper.encode(id, forKey: .id, container: &container) - - - } + var container = encoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() + + try codecHelper.encode(id, forKey: .id, container: &container) + } } -extension MovieKey : Equatable { +extension MovieKey: Equatable { public static func == (lhs: MovieKey, rhs: MovieKey) -> Bool { - if lhs.id != rhs.id { return false } - + return true } } -extension MovieKey : Hashable { +extension MovieKey: Hashable { public func hash(into hasher: inout Hasher) { - - hasher.combine(self.id) - + hasher.combine(id) } } -extension MovieKey : Sendable {} - - +extension MovieKey: Sendable {} public struct ReviewKey { - public private(set) var userId: String - + public private(set) var movieId: UUID - enum CodingKeys: String, CodingKey { - - case userId - - case movieId - + case userId + + case movieId } } -extension ReviewKey : Codable { +extension ReviewKey: Codable { public init(from decoder: any Decoder) throws { var container = try decoder.container(keyedBy: CodingKeys.self) let codecHelper = CodecHelper() - - self.userId = try codecHelper.decode(String.self, forKey: .userId, container: &container) - - self.movieId = try codecHelper.decode(UUID.self, forKey: .movieId, container: &container) - + userId = try codecHelper.decode(String.self, forKey: .userId, container: &container) + + movieId = try codecHelper.decode(UUID.self, forKey: .movieId, container: &container) } public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - try codecHelper.encode(userId, forKey: .userId, container: &container) - - - - try codecHelper.encode(movieId, forKey: .movieId, container: &container) - - - } + var container = encoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() + + try codecHelper.encode(userId, forKey: .userId, container: &container) + + try codecHelper.encode(movieId, forKey: .movieId, container: &container) + } } -extension ReviewKey : Equatable { +extension ReviewKey: Equatable { public static func == (lhs: ReviewKey, rhs: ReviewKey) -> Bool { - if lhs.userId != rhs.userId { return false } - + if lhs.movieId != rhs.movieId { return false } - + return true } } -extension ReviewKey : Hashable { +extension ReviewKey: Hashable { public func hash(into hasher: inout Hasher) { - - hasher.combine(self.userId) - - hasher.combine(self.movieId) - + hasher.combine(userId) + + hasher.combine(movieId) } } -extension ReviewKey : Sendable {} - - +extension ReviewKey: Sendable {} public struct UserKey { - public private(set) var id: String - enum CodingKeys: String, CodingKey { - - case id - + case id } } -extension UserKey : Codable { +extension UserKey: Codable { public init(from decoder: any Decoder) throws { var container = try decoder.container(keyedBy: CodingKeys.self) let codecHelper = CodecHelper() - - self.id = try codecHelper.decode(String.self, forKey: .id, container: &container) - + id = try codecHelper.decode(String.self, forKey: .id, container: &container) } public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - try codecHelper.encode(id, forKey: .id, container: &container) - - - } + var container = encoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() + + try codecHelper.encode(id, forKey: .id, container: &container) + } } -extension UserKey : Equatable { +extension UserKey: Equatable { public static func == (lhs: UserKey, rhs: UserKey) -> Bool { - if lhs.id != rhs.id { return false } - + return true } } -extension UserKey : Hashable { +extension UserKey: Hashable { public func hash(into hasher: inout Hasher) { - - hasher.combine(self.id) - + hasher.combine(id) } } -extension UserKey : Sendable {} - - +extension UserKey: Sendable {} diff --git a/Examples/FriendlyFlix/app/FriendlyFlixSDK/Sources/FriendlyFlixOperations.swift b/Examples/FriendlyFlix/app/FriendlyFlixSDK/Sources/FriendlyFlixOperations.swift index 4c72460..46bc78b 100644 --- a/Examples/FriendlyFlix/app/FriendlyFlixSDK/Sources/FriendlyFlixOperations.swift +++ b/Examples/FriendlyFlix/app/FriendlyFlixSDK/Sources/FriendlyFlixOperations.swift @@ -3,44 +3,16 @@ import Foundation import FirebaseCore import FirebaseDataConnect - - - - - - - - - - - - - - - - - - - // MARK: Common Enums public enum OrderDirection: String, Codable, Sendable { - case ASC = "ASC" - case DESC = "DESC" - } + case ASC + case DESC +} // End enum definitions - - - - - - - - -public class UpsertUserMutation{ - +public class UpsertUserMutation { let dataConnect: DataConnect init(dataConnect: DataConnect) { @@ -49,105 +21,70 @@ public class UpsertUserMutation{ public static let OperationName = "UpsertUser" - public typealias Ref = MutationRef + public typealias Ref = MutationRef public struct Variables: OperationVariable { - - - public var -username: String - + public var + username: String - - - - public init ( - -username: String - - - ) { - self.username = username - - - + public init(username: String) { + self.username = username } public static func == (lhs: Variables, rhs: Variables) -> Bool { - - return lhs.username == rhs.username - + return lhs.username == rhs.username } - -public func hash(into hasher: inout Hasher) { - - hasher.combine(username) - -} + public func hash(into hasher: inout Hasher) { + hasher.combine(username) + } enum CodingKeys: String, CodingKey { - case username - } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) let codecHelper = CodecHelper() - - + try codecHelper.encode(username, forKey: .username, container: &container) - - } - } public struct Data: Decodable, Sendable { - - - -public var -user_upsert: UserKey - + public var + user_upsert: UserKey } - public func ref( - -username: String - - ) -> MutationRef { - var variables = UpsertUserMutation.Variables(username:username) - + public func ref(username: String) -> MutationRef< + UpsertUserMutation.Data, + UpsertUserMutation.Variables + > { + var variables = UpsertUserMutation.Variables(username: username) - let ref = dataConnect.mutation(name: "UpsertUser", variables: variables, resultsDataType:UpsertUserMutation.Data.self) - return ref as MutationRef - } + let ref = dataConnect.mutation( + name: "UpsertUser", + variables: variables, + resultsDataType: UpsertUserMutation.Data.self + ) + return ref as MutationRef + } @MainActor - public func execute( - -username: String - - ) async throws -> OperationResult { - var variables = UpsertUserMutation.Variables(username:username) - - - let ref = dataConnect.mutation(name: "UpsertUser", variables: variables, resultsDataType:UpsertUserMutation.Data.self) - - return try await ref.execute() - - } -} - - - - + public func execute(username: String) async throws -> OperationResult { + var variables = UpsertUserMutation.Variables(username: username) + let ref = dataConnect.mutation( + name: "UpsertUser", + variables: variables, + resultsDataType: UpsertUserMutation.Data.self + ) -public class AddFavoritedMovieMutation{ + return try await ref.execute() + } +} +public class AddFavoritedMovieMutation { let dataConnect: DataConnect init(dataConnect: DataConnect) { @@ -156,105 +93,77 @@ public class AddFavoritedMovieMutation{ public static let OperationName = "AddFavoritedMovie" - public typealias Ref = MutationRef + public typealias Ref = MutationRef< + AddFavoritedMovieMutation.Data, + AddFavoritedMovieMutation.Variables + > public struct Variables: OperationVariable { - - - public var -movieId: UUID - + public var + movieId: UUID - - - - public init ( - -movieId: UUID - - - ) { - self.movieId = movieId - - - + public init(movieId: UUID) { + self.movieId = movieId } public static func == (lhs: Variables, rhs: Variables) -> Bool { - - return lhs.movieId == rhs.movieId - + return lhs.movieId == rhs.movieId } - -public func hash(into hasher: inout Hasher) { - - hasher.combine(movieId) - -} + public func hash(into hasher: inout Hasher) { + hasher.combine(movieId) + } enum CodingKeys: String, CodingKey { - case movieId - } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) let codecHelper = CodecHelper() - - + try codecHelper.encode(movieId, forKey: .movieId, container: &container) - - } - } public struct Data: Decodable, Sendable { - - - -public var -favorite_movie_upsert: FavoriteMovieKey - + public var + favorite_movie_upsert: FavoriteMovieKey } - public func ref( - -movieId: UUID - - ) -> MutationRef { - var variables = AddFavoritedMovieMutation.Variables(movieId:movieId) - + public func ref(movieId: UUID) -> MutationRef< + AddFavoritedMovieMutation.Data, + AddFavoritedMovieMutation.Variables + > { + var variables = AddFavoritedMovieMutation.Variables(movieId: movieId) - let ref = dataConnect.mutation(name: "AddFavoritedMovie", variables: variables, resultsDataType:AddFavoritedMovieMutation.Data.self) - return ref as MutationRef - } + let ref = dataConnect.mutation( + name: "AddFavoritedMovie", + variables: variables, + resultsDataType: AddFavoritedMovieMutation.Data.self + ) + return ref as MutationRef< + AddFavoritedMovieMutation.Data, + AddFavoritedMovieMutation.Variables + > + } @MainActor - public func execute( - -movieId: UUID - - ) async throws -> OperationResult { - var variables = AddFavoritedMovieMutation.Variables(movieId:movieId) - - - let ref = dataConnect.mutation(name: "AddFavoritedMovie", variables: variables, resultsDataType:AddFavoritedMovieMutation.Data.self) - - return try await ref.execute() - - } -} - - - - - + public func execute(movieId: UUID) async throws + -> OperationResult { + var variables = AddFavoritedMovieMutation.Variables(movieId: movieId) + + let ref = dataConnect.mutation( + name: "AddFavoritedMovie", + variables: variables, + resultsDataType: AddFavoritedMovieMutation.Data.self + ) -public class DeleteFavoritedMovieMutation{ + return try await ref.execute() + } +} +public class DeleteFavoritedMovieMutation { let dataConnect: DataConnect init(dataConnect: DataConnect) { @@ -263,105 +172,76 @@ public class DeleteFavoritedMovieMutation{ public static let OperationName = "DeleteFavoritedMovie" - public typealias Ref = MutationRef + public typealias Ref = MutationRef< + DeleteFavoritedMovieMutation.Data, + DeleteFavoritedMovieMutation.Variables + > public struct Variables: OperationVariable { - - - public var -movieId: UUID + public var + movieId: UUID - - - - - public init ( - -movieId: UUID - - - ) { - self.movieId = movieId - - - + public init(movieId: UUID) { + self.movieId = movieId } public static func == (lhs: Variables, rhs: Variables) -> Bool { - - return lhs.movieId == rhs.movieId - + return lhs.movieId == rhs.movieId } - -public func hash(into hasher: inout Hasher) { - - hasher.combine(movieId) - -} + public func hash(into hasher: inout Hasher) { + hasher.combine(movieId) + } enum CodingKeys: String, CodingKey { - case movieId - } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) let codecHelper = CodecHelper() - - + try codecHelper.encode(movieId, forKey: .movieId, container: &container) - - } - } public struct Data: Decodable, Sendable { - - - -public var -favorite_movie_delete: FavoriteMovieKey? - + public var + favorite_movie_delete: FavoriteMovieKey? } - public func ref( - -movieId: UUID - - ) -> MutationRef { - var variables = DeleteFavoritedMovieMutation.Variables(movieId:movieId) - + public func ref(movieId: UUID) + -> MutationRef { + var variables = DeleteFavoritedMovieMutation.Variables(movieId: movieId) - let ref = dataConnect.mutation(name: "DeleteFavoritedMovie", variables: variables, resultsDataType:DeleteFavoritedMovieMutation.Data.self) - return ref as MutationRef - } + let ref = dataConnect.mutation( + name: "DeleteFavoritedMovie", + variables: variables, + resultsDataType: DeleteFavoritedMovieMutation.Data.self + ) + return ref as MutationRef< + DeleteFavoritedMovieMutation.Data, + DeleteFavoritedMovieMutation.Variables + > + } @MainActor - public func execute( - -movieId: UUID - - ) async throws -> OperationResult { - var variables = DeleteFavoritedMovieMutation.Variables(movieId:movieId) - - - let ref = dataConnect.mutation(name: "DeleteFavoritedMovie", variables: variables, resultsDataType:DeleteFavoritedMovieMutation.Data.self) - - return try await ref.execute() - - } -} - - - - - + public func execute(movieId: UUID) async throws + -> OperationResult { + var variables = DeleteFavoritedMovieMutation.Variables(movieId: movieId) + + let ref = dataConnect.mutation( + name: "DeleteFavoritedMovie", + variables: variables, + resultsDataType: DeleteFavoritedMovieMutation.Data.self + ) -public class AddReviewMutation{ + return try await ref.execute() + } +} +public class AddReviewMutation { let dataConnect: DataConnect init(dataConnect: DataConnect) { @@ -370,149 +250,110 @@ public class AddReviewMutation{ public static let OperationName = "AddReview" - public typealias Ref = MutationRef + public typealias Ref = MutationRef public struct Variables: OperationVariable { - - - public var -movieId: UUID - - - - public var -rating: Int + public var + movieId: UUID - - - public var -reviewText: String + public var + rating: Int + public var + reviewText: String - - - - public init ( - -movieId: UUID -, - -rating: Int -, - -reviewText: String + public init(movieId: UUID, - - ) { - self.movieId = movieId - self.rating = rating - self.reviewText = reviewText - + rating: Int, - + reviewText: String) { + self.movieId = movieId + self.rating = rating + self.reviewText = reviewText } public static func == (lhs: Variables, rhs: Variables) -> Bool { - - return lhs.movieId == rhs.movieId && - lhs.rating == rhs.rating && - lhs.reviewText == rhs.reviewText - - } - - -public func hash(into hasher: inout Hasher) { - - hasher.combine(movieId) - - hasher.combine(rating) - - hasher.combine(reviewText) - -} + return lhs.movieId == rhs.movieId && + lhs.rating == rhs.rating && + lhs.reviewText == rhs.reviewText + } + + public func hash(into hasher: inout Hasher) { + hasher.combine(movieId) + + hasher.combine(rating) + + hasher.combine(reviewText) + } enum CodingKeys: String, CodingKey { - case movieId - + case rating - + case reviewText - } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) let codecHelper = CodecHelper() - - + try codecHelper.encode(movieId, forKey: .movieId, container: &container) - - - + try codecHelper.encode(rating, forKey: .rating, container: &container) - - - + try codecHelper.encode(reviewText, forKey: .reviewText, container: &container) - - } - } public struct Data: Decodable, Sendable { + public var + review_insert: ReviewKey + } + public func ref(movieId: UUID, + rating: Int, -public var -review_insert: ReviewKey + reviewText: String) + -> MutationRef { + var variables = AddReviewMutation.Variables( + movieId: movieId, + rating: rating, + reviewText: reviewText + ) + let ref = dataConnect.mutation( + name: "AddReview", + variables: variables, + resultsDataType: AddReviewMutation.Data.self + ) + return ref as MutationRef } - public func ref( - -movieId: UUID -, -rating: Int -, -reviewText: String - - ) -> MutationRef { - var variables = AddReviewMutation.Variables(movieId:movieId,rating:rating,reviewText:reviewText) - - - let ref = dataConnect.mutation(name: "AddReview", variables: variables, resultsDataType:AddReviewMutation.Data.self) - return ref as MutationRef - } - @MainActor - public func execute( - -movieId: UUID -, -rating: Int -, -reviewText: String - - ) async throws -> OperationResult { - var variables = AddReviewMutation.Variables(movieId:movieId,rating:rating,reviewText:reviewText) - - - let ref = dataConnect.mutation(name: "AddReview", variables: variables, resultsDataType:AddReviewMutation.Data.self) - - return try await ref.execute() - - } -} - - + public func execute(movieId: UUID, + rating: Int, + reviewText: String) async throws -> OperationResult { + var variables = AddReviewMutation.Variables( + movieId: movieId, + rating: rating, + reviewText: reviewText + ) + let ref = dataConnect.mutation( + name: "AddReview", + variables: variables, + resultsDataType: AddReviewMutation.Data.self + ) -public class UpdateReviewMutation{ + return try await ref.execute() + } +} +public class UpdateReviewMutation { let dataConnect: DataConnect init(dataConnect: DataConnect) { @@ -521,149 +362,111 @@ public class UpdateReviewMutation{ public static let OperationName = "UpdateReview" - public typealias Ref = MutationRef + public typealias Ref = MutationRef public struct Variables: OperationVariable { - - - public var -movieId: UUID - - - - public var -rating: Int + public var + movieId: UUID - - - public var -reviewText: String + public var + rating: Int + public var + reviewText: String - - - - public init ( - -movieId: UUID -, - -rating: Int -, - -reviewText: String + public init(movieId: UUID, - - ) { - self.movieId = movieId - self.rating = rating - self.reviewText = reviewText - + rating: Int, - + reviewText: String) { + self.movieId = movieId + self.rating = rating + self.reviewText = reviewText } public static func == (lhs: Variables, rhs: Variables) -> Bool { - - return lhs.movieId == rhs.movieId && - lhs.rating == rhs.rating && - lhs.reviewText == rhs.reviewText - - } - - -public func hash(into hasher: inout Hasher) { - - hasher.combine(movieId) - - hasher.combine(rating) - - hasher.combine(reviewText) - -} + return lhs.movieId == rhs.movieId && + lhs.rating == rhs.rating && + lhs.reviewText == rhs.reviewText + } + + public func hash(into hasher: inout Hasher) { + hasher.combine(movieId) + + hasher.combine(rating) + + hasher.combine(reviewText) + } enum CodingKeys: String, CodingKey { - case movieId - + case rating - + case reviewText - } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) let codecHelper = CodecHelper() - - + try codecHelper.encode(movieId, forKey: .movieId, container: &container) - - - + try codecHelper.encode(rating, forKey: .rating, container: &container) - - - + try codecHelper.encode(reviewText, forKey: .reviewText, container: &container) - - } - } public struct Data: Decodable, Sendable { + public var + review_update: ReviewKey? + } + public func ref(movieId: UUID, + rating: Int, -public var -review_update: ReviewKey? + reviewText: String) + -> MutationRef { + var variables = UpdateReviewMutation.Variables( + movieId: movieId, + rating: rating, + reviewText: reviewText + ) + let ref = dataConnect.mutation( + name: "UpdateReview", + variables: variables, + resultsDataType: UpdateReviewMutation.Data.self + ) + return ref as MutationRef } - public func ref( - -movieId: UUID -, -rating: Int -, -reviewText: String - - ) -> MutationRef { - var variables = UpdateReviewMutation.Variables(movieId:movieId,rating:rating,reviewText:reviewText) - - - let ref = dataConnect.mutation(name: "UpdateReview", variables: variables, resultsDataType:UpdateReviewMutation.Data.self) - return ref as MutationRef - } - @MainActor - public func execute( - -movieId: UUID -, -rating: Int -, -reviewText: String - - ) async throws -> OperationResult { - var variables = UpdateReviewMutation.Variables(movieId:movieId,rating:rating,reviewText:reviewText) - - - let ref = dataConnect.mutation(name: "UpdateReview", variables: variables, resultsDataType:UpdateReviewMutation.Data.self) - - return try await ref.execute() - - } -} - - + public func execute(movieId: UUID, + rating: Int, + reviewText: String) async throws + -> OperationResult { + var variables = UpdateReviewMutation.Variables( + movieId: movieId, + rating: rating, + reviewText: reviewText + ) + let ref = dataConnect.mutation( + name: "UpdateReview", + variables: variables, + resultsDataType: UpdateReviewMutation.Data.self + ) -public class DeleteReviewMutation{ + return try await ref.execute() + } +} +public class DeleteReviewMutation { let dataConnect: DataConnect init(dataConnect: DataConnect) { @@ -672,105 +475,70 @@ public class DeleteReviewMutation{ public static let OperationName = "DeleteReview" - public typealias Ref = MutationRef + public typealias Ref = MutationRef public struct Variables: OperationVariable { - - - public var -movieId: UUID - - - - - - public init ( - -movieId: UUID - - - ) { - self.movieId = movieId - + public var + movieId: UUID - + public init(movieId: UUID) { + self.movieId = movieId } public static func == (lhs: Variables, rhs: Variables) -> Bool { - - return lhs.movieId == rhs.movieId - + return lhs.movieId == rhs.movieId } - -public func hash(into hasher: inout Hasher) { - - hasher.combine(movieId) - -} + public func hash(into hasher: inout Hasher) { + hasher.combine(movieId) + } enum CodingKeys: String, CodingKey { - case movieId - } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) let codecHelper = CodecHelper() - - + try codecHelper.encode(movieId, forKey: .movieId, container: &container) - - } - } public struct Data: Decodable, Sendable { - - - -public var -review_delete: ReviewKey? - + public var + review_delete: ReviewKey? } - public func ref( - -movieId: UUID - - ) -> MutationRef { - var variables = DeleteReviewMutation.Variables(movieId:movieId) - + public func ref(movieId: UUID) -> MutationRef< + DeleteReviewMutation.Data, + DeleteReviewMutation.Variables + > { + var variables = DeleteReviewMutation.Variables(movieId: movieId) - let ref = dataConnect.mutation(name: "DeleteReview", variables: variables, resultsDataType:DeleteReviewMutation.Data.self) - return ref as MutationRef - } + let ref = dataConnect.mutation( + name: "DeleteReview", + variables: variables, + resultsDataType: DeleteReviewMutation.Data.self + ) + return ref as MutationRef + } @MainActor - public func execute( - -movieId: UUID - - ) async throws -> OperationResult { - var variables = DeleteReviewMutation.Variables(movieId:movieId) - - - let ref = dataConnect.mutation(name: "DeleteReview", variables: variables, resultsDataType:DeleteReviewMutation.Data.self) - - return try await ref.execute() - - } -} - - - - + public func execute(movieId: UUID) async throws -> OperationResult { + var variables = DeleteReviewMutation.Variables(movieId: movieId) + let ref = dataConnect.mutation( + name: "DeleteReview", + variables: variables, + resultsDataType: DeleteReviewMutation.Data.self + ) -public class ListMoviesQuery{ + return try await ref.execute() + } +} +public class ListMoviesQuery { let dataConnect: DataConnect init(dataConnect: DataConnect) { @@ -779,272 +547,201 @@ public class ListMoviesQuery{ public static let OperationName = "ListMovies" - public typealias Ref = QueryRefObservation + public typealias Ref = QueryRefObservation public struct Variables: OperationVariable { - - @OptionalVariable - public var -orderByRating: OrderDirection? + @OptionalVariable + public var + orderByRating: OrderDirection? - - @OptionalVariable - public var -orderByReleaseYear: OrderDirection? + @OptionalVariable + public var + orderByReleaseYear: OrderDirection? - - @OptionalVariable - public var -limit: Int? - - - - - - public init ( - - - - _ optionalVars: ((inout Variables)->())? = nil - ) { - - - - if let optionalVars { - optionalVars(&self) - } - + @OptionalVariable + public var + limit: Int? + + public init(_ optionalVars: ((inout Variables) -> Void)? = nil) { + if let optionalVars { + optionalVars(&self) + } } public static func == (lhs: Variables, rhs: Variables) -> Bool { - - return lhs.orderByRating == rhs.orderByRating && - lhs.orderByReleaseYear == rhs.orderByReleaseYear && - lhs.limit == rhs.limit - - } - - -public func hash(into hasher: inout Hasher) { - - hasher.combine(orderByRating) - - hasher.combine(orderByReleaseYear) - - hasher.combine(limit) - -} + return lhs.orderByRating == rhs.orderByRating && + lhs.orderByReleaseYear == rhs.orderByReleaseYear && + lhs.limit == rhs.limit + } + + public func hash(into hasher: inout Hasher) { + hasher.combine(orderByRating) + + hasher.combine(orderByReleaseYear) + + hasher.combine(limit) + } enum CodingKeys: String, CodingKey { - case orderByRating - + case orderByReleaseYear - + case limit - } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) let codecHelper = CodecHelper() - - if $orderByRating.isSet { - try codecHelper.encode(orderByRating, forKey: .orderByRating, container: &container) + + if $orderByRating.isSet { + try codecHelper.encode(orderByRating, forKey: .orderByRating, container: &container) } - - if $orderByReleaseYear.isSet { - try codecHelper.encode(orderByReleaseYear, forKey: .orderByReleaseYear, container: &container) + + if $orderByReleaseYear.isSet { + try codecHelper.encode( + orderByReleaseYear, + forKey: .orderByReleaseYear, + container: &container + ) } - - if $limit.isSet { - try codecHelper.encode(limit, forKey: .limit, container: &container) + + if $limit.isSet { + try codecHelper.encode(limit, forKey: .limit, container: &container) } - } - } public struct Data: Decodable, Sendable { + public struct Movie: Decodable, Sendable, Hashable, Equatable, Identifiable { + public var + id: UUID + public var + title: String + public var + imageUrl: String + public var + releaseYear: Int? -public struct Movie: Decodable, Sendable ,Hashable, Equatable, Identifiable { - - - -public var -id: UUID + public var + genre: String? + public var + rating: Double? + public var + tags: [String]? -public var -title: String + public var + description: String? + public var movieKey: MovieKey { + return MovieKey( + id: id + ) + } + public func hash(into hasher: inout Hasher) { + hasher.combine(id) + } -public var -imageUrl: String + public static func == (lhs: Movie, rhs: Movie) -> Bool { + return lhs.id == rhs.id + } + enum CodingKeys: String, CodingKey { + case id + case title -public var -releaseYear: Int? + case imageUrl + case releaseYear + case genre -public var -genre: String? + case rating + case tags + case description + } -public var -rating: Double? + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() + id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) + title = try codecHelper.decode(String.self, forKey: .title, container: &container) -public var -tags: [String]? + imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) + releaseYear = try codecHelper.decode(Int?.self, forKey: .releaseYear, container: &container) + genre = try codecHelper.decode(String?.self, forKey: .genre, container: &container) -public var -description: String? + rating = try codecHelper.decode(Double?.self, forKey: .rating, container: &container) + tags = try codecHelper.decode([String].self, forKey: .tags, container: &container) - - public var movieKey: MovieKey { - return MovieKey( - - id: id - ) - } + description = try codecHelper.decode( + String?.self, + forKey: .description, + container: &container + ) + } + } - -public func hash(into hasher: inout Hasher) { - - hasher.combine(id) - -} -public static func == (lhs: Movie, rhs: Movie) -> Bool { - - return lhs.id == rhs.id - - } - - - - - enum CodingKeys: String, CodingKey { - - case id - - case title - - case imageUrl - - case releaseYear - - case genre - - case rating - - case tags - - case description - - } - - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - - self.id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) - - - - self.title = try codecHelper.decode(String.self, forKey: .title, container: &container) - - - - self.imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) - - - - self.releaseYear = try codecHelper.decode(Int?.self, forKey: .releaseYear, container: &container) - - - - self.genre = try codecHelper.decode(String?.self, forKey: .genre, container: &container) - - - - self.rating = try codecHelper.decode(Double?.self, forKey: .rating, container: &container) - - - self.tags = try codecHelper.decode([String].self, forKey: .tags, container: &container) - - - - self.description = try codecHelper.decode(String?.self, forKey: .description, container: &container) - - + public var + movies: [Movie] } -} -public var -movies: [Movie] - } + public func ref(_ optionalVars: ((inout ListMoviesQuery.Variables) -> Void)? = nil) + -> QueryRefObservation< + ListMoviesQuery.Data, + ListMoviesQuery.Variables + > { + var variables = ListMoviesQuery.Variables() - public func ref( - - - - _ optionalVars: ((inout ListMoviesQuery.Variables)->())? = nil - ) -> QueryRefObservation { - var variables = ListMoviesQuery.Variables() - - if let optionalVars { - optionalVars(&variables) - } - + if let optionalVars { + optionalVars(&variables) + } - let ref = dataConnect.query(name: "ListMovies", variables: variables, resultsDataType:ListMoviesQuery.Data.self, publisher: .observableMacro) - return ref as! QueryRefObservation - } + let ref = dataConnect.query( + name: "ListMovies", + variables: variables, + resultsDataType: ListMoviesQuery.Data.self, + publisher: .observableMacro + ) + return ref as! QueryRefObservation + } @MainActor - public func execute( - - - - _ optionalVars: (@MainActor (inout ListMoviesQuery.Variables)->())? = nil - ) async throws -> OperationResult { - var variables = ListMoviesQuery.Variables() - - if let optionalVars { - optionalVars(&variables) - } - - - let ref = dataConnect.query(name: "ListMovies", variables: variables, resultsDataType:ListMoviesQuery.Data.self, publisher: .observableMacro) - - let refCast = ref as! QueryRefObservation - return try await refCast.execute() - - } -} - - - + public func execute(_ optionalVars: (@MainActor (inout ListMoviesQuery.Variables) -> Void)? = + nil) async throws -> OperationResult { + var variables = ListMoviesQuery.Variables() + if let optionalVars { + optionalVars(&variables) + } + let ref = dataConnect.query( + name: "ListMovies", + variables: variables, + resultsDataType: ListMoviesQuery.Data.self, + publisher: .observableMacro + ) -public class GetMovieByIdQuery{ + let refCast = ref as! QueryRefObservation + return try await refCast.execute() + } +} +public class GetMovieByIdQuery { let dataConnect: DataConnect init(dataConnect: DataConnect) { @@ -1053,580 +750,396 @@ public class GetMovieByIdQuery{ public static let OperationName = "GetMovieById" - public typealias Ref = QueryRefObservation + public typealias Ref = QueryRefObservation public struct Variables: OperationVariable { - - - public var -id: UUID - + public var + id: UUID - - - - public init ( - -id: UUID - - - ) { - self.id = id - - - + public init(id: UUID) { + self.id = id } public static func == (lhs: Variables, rhs: Variables) -> Bool { - - return lhs.id == rhs.id - + return lhs.id == rhs.id } - -public func hash(into hasher: inout Hasher) { - - hasher.combine(id) - -} + public func hash(into hasher: inout Hasher) { + hasher.combine(id) + } enum CodingKeys: String, CodingKey { - case id - } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) let codecHelper = CodecHelper() - - + try codecHelper.encode(id, forKey: .id, container: &container) - - } - } public struct Data: Decodable, Sendable { + public struct Movie: Decodable, Sendable, Hashable, Equatable, Identifiable { + public var + id: UUID + public var + title: String + public var + imageUrl: String + public var + releaseYear: Int? -public struct Movie: Decodable, Sendable ,Hashable, Equatable, Identifiable { - + public var + genre: String? + public var + rating: Double? -public var -id: UUID + public var + description: String? + public var + tags: [String]? + public struct MovieMetadataMetadata: Decodable, Sendable { + public var + director: String? -public var -title: String + enum CodingKeys: String, CodingKey { + case director + } + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() + director = try codecHelper.decode(String?.self, forKey: .director, container: &container) + } + } -public var -imageUrl: String + public var + metadata: [MovieMetadataMetadata] + public struct ActorMainActors: Decodable, Sendable, Hashable, Equatable, Identifiable { + public var + id: UUID + public var + name: String -public var -releaseYear: Int? + public var + imageUrl: String + public var actorMainActorsKey: ActorKey { + return ActorKey( + id: id + ) + } + public func hash(into hasher: inout Hasher) { + hasher.combine(id) + } -public var -genre: String? + public static func == (lhs: ActorMainActors, rhs: ActorMainActors) -> Bool { + return lhs.id == rhs.id + } + enum CodingKeys: String, CodingKey { + case id + case name -public var -rating: Double? + case imageUrl + } + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() + id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) -public var -description: String? + name = try codecHelper.decode(String.self, forKey: .name, container: &container) + imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) + } + } + public var + mainActors: [ActorMainActors] -public var -tags: [String]? - - - - - -public struct MovieMetadataMetadata: Decodable, Sendable { - - - -public var -director: String? + public struct ActorSupportingActors: Decodable, Sendable, Hashable, Equatable, Identifiable { + public var + id: UUID + public var + name: String - + public var + imageUrl: String - - enum CodingKeys: String, CodingKey { - - case director - - } + public var actorSupportingActorsKey: ActorKey { + return ActorKey( + id: id + ) + } - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() + public func hash(into hasher: inout Hasher) { + hasher.combine(id) + } - - - self.director = try codecHelper.decode(String?.self, forKey: .director, container: &container) - - - } -} -public var -metadata: [MovieMetadataMetadata] + public static func == (lhs: ActorSupportingActors, rhs: ActorSupportingActors) -> Bool { + return lhs.id == rhs.id + } + enum CodingKeys: String, CodingKey { + case id + case name + case imageUrl + } + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() -public struct ActorMainActors: Decodable, Sendable ,Hashable, Equatable, Identifiable { - + id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) + name = try codecHelper.decode(String.self, forKey: .name, container: &container) -public var -id: UUID + imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) + } + } + public var + supportingActors: [ActorSupportingActors] + public struct ReviewReviews: Decodable, Sendable { + public var + id: UUID -public var -name: String + public var + reviewText: String? + public var + reviewDate: LocalDate + public var + rating: Int? -public var -imageUrl: String + public struct User: Decodable, Sendable, Hashable, Equatable, Identifiable { + public var + id: String + public var + username: String - - public var actorMainActorsKey: ActorKey { - return ActorKey( - - id: id - ) - } + public var userKey: UserKey { + return UserKey( + id: id + ) + } - -public func hash(into hasher: inout Hasher) { - - hasher.combine(id) - -} -public static func == (lhs: ActorMainActors, rhs: ActorMainActors) -> Bool { - - return lhs.id == rhs.id - - } - - - - - enum CodingKeys: String, CodingKey { - - case id - - case name - - case imageUrl - - } - - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - - self.id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) - - - - self.name = try codecHelper.decode(String.self, forKey: .name, container: &container) - - - - self.imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) - - - } -} -public var -mainActors: [ActorMainActors] + public func hash(into hasher: inout Hasher) { + hasher.combine(id) + } + public static func == (lhs: User, rhs: User) -> Bool { + return lhs.id == rhs.id + } + enum CodingKeys: String, CodingKey { + case id + case username + } + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() -public struct ActorSupportingActors: Decodable, Sendable ,Hashable, Equatable, Identifiable { - + id = try codecHelper.decode(String.self, forKey: .id, container: &container) + username = try codecHelper.decode(String.self, forKey: .username, container: &container) + } + } -public var -id: UUID + public var + user: User + enum CodingKeys: String, CodingKey { + case id + case reviewText -public var -name: String + case reviewDate + case rating + case user + } -public var -imageUrl: String + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() + id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) - - public var actorSupportingActorsKey: ActorKey { - return ActorKey( - - id: id - ) - } - - -public func hash(into hasher: inout Hasher) { - - hasher.combine(id) - -} -public static func == (lhs: ActorSupportingActors, rhs: ActorSupportingActors) -> Bool { - - return lhs.id == rhs.id - - } - - - - - enum CodingKeys: String, CodingKey { - - case id - - case name - - case imageUrl - - } - - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - - self.id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) - - - - self.name = try codecHelper.decode(String.self, forKey: .name, container: &container) - - - - self.imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) - - - } -} -public var -supportingActors: [ActorSupportingActors] + reviewText = try codecHelper.decode( + String?.self, + forKey: .reviewText, + container: &container + ) + reviewDate = try codecHelper.decode( + LocalDate.self, + forKey: .reviewDate, + container: &container + ) + rating = try codecHelper.decode(Int?.self, forKey: .rating, container: &container) + user = try codecHelper.decode(User.self, forKey: .user, container: &container) + } + } + public var + reviews: [ReviewReviews] -public struct ReviewReviews: Decodable, Sendable { - + public var movieKey: MovieKey { + return MovieKey( + id: id + ) + } + public func hash(into hasher: inout Hasher) { + hasher.combine(id) + } -public var -id: UUID + public static func == (lhs: Movie, rhs: Movie) -> Bool { + return lhs.id == rhs.id + } + enum CodingKeys: String, CodingKey { + case id + case title -public var -reviewText: String? + case imageUrl + case releaseYear + case genre -public var -reviewDate: LocalDate + case rating + case description + case tags -public var -rating: Int? + case metadata + case mainActors + case supportingActors + case reviews + } + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() -public struct User: Decodable, Sendable ,Hashable, Equatable, Identifiable { - + id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) + title = try codecHelper.decode(String.self, forKey: .title, container: &container) -public var -id: String + imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) + releaseYear = try codecHelper.decode(Int?.self, forKey: .releaseYear, container: &container) + genre = try codecHelper.decode(String?.self, forKey: .genre, container: &container) -public var -username: String + rating = try codecHelper.decode(Double?.self, forKey: .rating, container: &container) + description = try codecHelper.decode( + String?.self, + forKey: .description, + container: &container + ) - - public var userKey: UserKey { - return UserKey( - - id: id - ) - } + tags = try codecHelper.decode([String].self, forKey: .tags, container: &container) - -public func hash(into hasher: inout Hasher) { - - hasher.combine(id) - -} -public static func == (lhs: User, rhs: User) -> Bool { - - return lhs.id == rhs.id - - } + metadata = try codecHelper.decode( + [MovieMetadataMetadata].self, + forKey: .metadata, + container: &container + ) - + mainActors = try codecHelper.decode( + [ActorMainActors].self, + forKey: .mainActors, + container: &container + ) - - enum CodingKeys: String, CodingKey { - - case id - - case username - - } + supportingActors = try codecHelper.decode( + [ActorSupportingActors].self, + forKey: .supportingActors, + container: &container + ) - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() + reviews = try codecHelper.decode( + [ReviewReviews].self, + forKey: .reviews, + container: &container + ) + } + } - - - self.id = try codecHelper.decode(String.self, forKey: .id, container: &container) - - - - self.username = try codecHelper.decode(String.self, forKey: .username, container: &container) - - - } -} -public var -user: User - - - - - - enum CodingKeys: String, CodingKey { - - case id - - case reviewText - - case reviewDate - - case rating - - case user - - } - - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - - self.id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) - - - - self.reviewText = try codecHelper.decode(String?.self, forKey: .reviewText, container: &container) - - - - self.reviewDate = try codecHelper.decode(LocalDate.self, forKey: .reviewDate, container: &container) - - - - self.rating = try codecHelper.decode(Int?.self, forKey: .rating, container: &container) - - - - self.user = try codecHelper.decode(User.self, forKey: .user, container: &container) - - + public var + movie: Movie? } -} -public var -reviews: [ReviewReviews] + public func ref(id: UUID) -> QueryRefObservation< + GetMovieByIdQuery.Data, + GetMovieByIdQuery.Variables + > { + var variables = GetMovieByIdQuery.Variables(id: id) - - public var movieKey: MovieKey { - return MovieKey( - - id: id + let ref = dataConnect.query( + name: "GetMovieById", + variables: variables, + resultsDataType: GetMovieByIdQuery.Data.self, + publisher: .observableMacro ) + return ref as! QueryRefObservation } - -public func hash(into hasher: inout Hasher) { - - hasher.combine(id) - -} -public static func == (lhs: Movie, rhs: Movie) -> Bool { - - return lhs.id == rhs.id - - } - - - - - enum CodingKeys: String, CodingKey { - - case id - - case title - - case imageUrl - - case releaseYear - - case genre - - case rating - - case description - - case tags - - case metadata - - case mainActors - - case supportingActors - - case reviews - - } - - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - - self.id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) - - - - self.title = try codecHelper.decode(String.self, forKey: .title, container: &container) - - - - self.imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) - - - - self.releaseYear = try codecHelper.decode(Int?.self, forKey: .releaseYear, container: &container) - - - - self.genre = try codecHelper.decode(String?.self, forKey: .genre, container: &container) - - - - self.rating = try codecHelper.decode(Double?.self, forKey: .rating, container: &container) - - - - self.description = try codecHelper.decode(String?.self, forKey: .description, container: &container) - - - self.tags = try codecHelper.decode([String].self, forKey: .tags, container: &container) - - - self.metadata = try codecHelper.decode([MovieMetadataMetadata].self, forKey: .metadata, container: &container) - - - self.mainActors = try codecHelper.decode([ActorMainActors].self, forKey: .mainActors, container: &container) - - - self.supportingActors = try codecHelper.decode([ActorSupportingActors].self, forKey: .supportingActors, container: &container) - - - self.reviews = try codecHelper.decode([ReviewReviews].self, forKey: .reviews, container: &container) - - - } -} -public var -movie: Movie? + @MainActor + public func execute(id: UUID) async throws -> OperationResult { + var variables = GetMovieByIdQuery.Variables(id: id) + + let ref = dataConnect.query( + name: "GetMovieById", + variables: variables, + resultsDataType: GetMovieByIdQuery.Data.self, + publisher: .observableMacro + ) + let refCast = ref as! QueryRefObservation< + GetMovieByIdQuery.Data, + GetMovieByIdQuery.Variables + > + return try await refCast.execute() } - - public func ref( - -id: UUID - - ) -> QueryRefObservation { - var variables = GetMovieByIdQuery.Variables(id:id) - - - let ref = dataConnect.query(name: "GetMovieById", variables: variables, resultsDataType:GetMovieByIdQuery.Data.self, publisher: .observableMacro) - return ref as! QueryRefObservation - } - - @MainActor - public func execute( - -id: UUID - - ) async throws -> OperationResult { - var variables = GetMovieByIdQuery.Variables(id:id) - - - let ref = dataConnect.query(name: "GetMovieById", variables: variables, resultsDataType:GetMovieByIdQuery.Data.self, publisher: .observableMacro) - - let refCast = ref as! QueryRefObservation - return try await refCast.execute() - - } } - - - - - -public class GetActorByIdQuery{ - +public class GetActorByIdQuery { let dataConnect: DataConnect init(dataConnect: DataConnect) { @@ -1635,383 +1148,258 @@ public class GetActorByIdQuery{ public static let OperationName = "GetActorById" - public typealias Ref = QueryRefObservation + public typealias Ref = QueryRefObservation public struct Variables: OperationVariable { - - - public var -id: UUID - + public var + id: UUID - - - - public init ( - -id: UUID - - - ) { - self.id = id - - - + public init(id: UUID) { + self.id = id } public static func == (lhs: Variables, rhs: Variables) -> Bool { - - return lhs.id == rhs.id - + return lhs.id == rhs.id } - -public func hash(into hasher: inout Hasher) { - - hasher.combine(id) - -} + public func hash(into hasher: inout Hasher) { + hasher.combine(id) + } enum CodingKeys: String, CodingKey { - case id - } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) let codecHelper = CodecHelper() - - + try codecHelper.encode(id, forKey: .id, container: &container) - - } - } public struct Data: Decodable, Sendable { + public struct Actor: Decodable, Sendable, Hashable, Equatable, Identifiable { + public var + id: UUID + + public var + name: String + public var + imageUrl: String + public struct MovieMainActors: Decodable, Sendable, Hashable, Equatable, Identifiable { + public var + id: UUID + public var + title: String -public struct Actor: Decodable, Sendable ,Hashable, Equatable, Identifiable { - + public var + genre: String? + public var + tags: [String]? -public var -id: UUID + public var + imageUrl: String + public var movieMainActorsKey: MovieKey { + return MovieKey( + id: id + ) + } + public func hash(into hasher: inout Hasher) { + hasher.combine(id) + } -public var -name: String + public static func == (lhs: MovieMainActors, rhs: MovieMainActors) -> Bool { + return lhs.id == rhs.id + } + enum CodingKeys: String, CodingKey { + case id + case title -public var -imageUrl: String + case genre + case tags + case imageUrl + } + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() + id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) -public struct MovieMainActors: Decodable, Sendable ,Hashable, Equatable, Identifiable { - + title = try codecHelper.decode(String.self, forKey: .title, container: &container) + genre = try codecHelper.decode(String?.self, forKey: .genre, container: &container) -public var -id: UUID + tags = try codecHelper.decode([String].self, forKey: .tags, container: &container) + imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) + } + } + public var + mainActors: [MovieMainActors] -public var -title: String + public struct MovieSupportingActors: Decodable, Sendable, Hashable, Equatable, Identifiable { + public var + id: UUID + public var + title: String + public var + genre: String? -public var -genre: String? + public var + tags: [String]? + public var + imageUrl: String + public var movieSupportingActorsKey: MovieKey { + return MovieKey( + id: id + ) + } -public var -tags: [String]? + public func hash(into hasher: inout Hasher) { + hasher.combine(id) + } + public static func == (lhs: MovieSupportingActors, rhs: MovieSupportingActors) -> Bool { + return lhs.id == rhs.id + } + enum CodingKeys: String, CodingKey { + case id -public var -imageUrl: String + case title + case genre - - public var movieMainActorsKey: MovieKey { - return MovieKey( - - id: id - ) - } + case tags - -public func hash(into hasher: inout Hasher) { - - hasher.combine(id) - -} -public static func == (lhs: MovieMainActors, rhs: MovieMainActors) -> Bool { - - return lhs.id == rhs.id - - } - - - - - enum CodingKeys: String, CodingKey { - - case id - - case title - - case genre - - case tags - - case imageUrl - - } - - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - - self.id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) - - - - self.title = try codecHelper.decode(String.self, forKey: .title, container: &container) - - - - self.genre = try codecHelper.decode(String?.self, forKey: .genre, container: &container) - - - self.tags = try codecHelper.decode([String].self, forKey: .tags, container: &container) - - - - self.imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) - - - } -} -public var -mainActors: [MovieMainActors] + case imageUrl + } + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() + id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) + title = try codecHelper.decode(String.self, forKey: .title, container: &container) + genre = try codecHelper.decode(String?.self, forKey: .genre, container: &container) -public struct MovieSupportingActors: Decodable, Sendable ,Hashable, Equatable, Identifiable { - + tags = try codecHelper.decode([String].self, forKey: .tags, container: &container) + imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) + } + } -public var -id: UUID + public var + supportingActors: [MovieSupportingActors] + public var actorKey: ActorKey { + return ActorKey( + id: id + ) + } + public func hash(into hasher: inout Hasher) { + hasher.combine(id) + } -public var -title: String + public static func == (lhs: Actor, rhs: Actor) -> Bool { + return lhs.id == rhs.id + } + enum CodingKeys: String, CodingKey { + case id + case name -public var -genre: String? + case imageUrl + case mainActors + case supportingActors + } -public var -tags: [String]? + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() + id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) + name = try codecHelper.decode(String.self, forKey: .name, container: &container) -public var -imageUrl: String + imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) + mainActors = try codecHelper.decode( + [MovieMainActors].self, + forKey: .mainActors, + container: &container + ) - - public var movieSupportingActorsKey: MovieKey { - return MovieKey( - - id: id - ) - } + supportingActors = try codecHelper.decode( + [MovieSupportingActors].self, + forKey: .supportingActors, + container: &container + ) + } + } - -public func hash(into hasher: inout Hasher) { - - hasher.combine(id) - -} -public static func == (lhs: MovieSupportingActors, rhs: MovieSupportingActors) -> Bool { - - return lhs.id == rhs.id - - } - - - - - enum CodingKeys: String, CodingKey { - - case id - - case title - - case genre - - case tags - - case imageUrl - - } - - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - - self.id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) - - - - self.title = try codecHelper.decode(String.self, forKey: .title, container: &container) - - - - self.genre = try codecHelper.decode(String?.self, forKey: .genre, container: &container) - - - self.tags = try codecHelper.decode([String].self, forKey: .tags, container: &container) - - - - self.imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) - - + public var + actor: Actor? } -} -public var -supportingActors: [MovieSupportingActors] + public func ref(id: UUID) -> QueryRefObservation< + GetActorByIdQuery.Data, + GetActorByIdQuery.Variables + > { + var variables = GetActorByIdQuery.Variables(id: id) - - public var actorKey: ActorKey { - return ActorKey( - - id: id + let ref = dataConnect.query( + name: "GetActorById", + variables: variables, + resultsDataType: GetActorByIdQuery.Data.self, + publisher: .observableMacro ) + return ref as! QueryRefObservation } - -public func hash(into hasher: inout Hasher) { - - hasher.combine(id) - -} -public static func == (lhs: Actor, rhs: Actor) -> Bool { - - return lhs.id == rhs.id - - } - - - - - enum CodingKeys: String, CodingKey { - - case id - - case name - - case imageUrl - - case mainActors - - case supportingActors - - } - - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - - self.id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) - - - - self.name = try codecHelper.decode(String.self, forKey: .name, container: &container) - - - - self.imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) - - - self.mainActors = try codecHelper.decode([MovieMainActors].self, forKey: .mainActors, container: &container) - - - self.supportingActors = try codecHelper.decode([MovieSupportingActors].self, forKey: .supportingActors, container: &container) - - - } -} -public var -actor: Actor? + @MainActor + public func execute(id: UUID) async throws -> OperationResult { + var variables = GetActorByIdQuery.Variables(id: id) + + let ref = dataConnect.query( + name: "GetActorById", + variables: variables, + resultsDataType: GetActorByIdQuery.Data.self, + publisher: .observableMacro + ) + let refCast = ref as! QueryRefObservation< + GetActorByIdQuery.Data, + GetActorByIdQuery.Variables + > + return try await refCast.execute() } - - public func ref( - -id: UUID - - ) -> QueryRefObservation { - var variables = GetActorByIdQuery.Variables(id:id) - - - let ref = dataConnect.query(name: "GetActorById", variables: variables, resultsDataType:GetActorByIdQuery.Data.self, publisher: .observableMacro) - return ref as! QueryRefObservation - } - - @MainActor - public func execute( - -id: UUID - - ) async throws -> OperationResult { - var variables = GetActorByIdQuery.Variables(id:id) - - - let ref = dataConnect.query(name: "GetActorById", variables: variables, resultsDataType:GetActorByIdQuery.Data.self, publisher: .observableMacro) - - let refCast = ref as! QueryRefObservation - return try await refCast.execute() - - } } - - - - - -public class GetCurrentUserQuery{ - +public class GetCurrentUserQuery { let dataConnect: DataConnect init(dataConnect: DataConnect) { @@ -2020,466 +1408,334 @@ public class GetCurrentUserQuery{ public static let OperationName = "GetCurrentUser" - public typealias Ref = QueryRefObservation + public typealias Ref = QueryRefObservation< + GetCurrentUserQuery.Data, + GetCurrentUserQuery.Variables + > - public struct Variables: OperationVariable { - - - - } + public struct Variables: OperationVariable {} public struct Data: Decodable, Sendable { + public struct User: Decodable, Sendable, Hashable, Equatable, Identifiable { + public var + id: String + public var + username: String + public struct ReviewReviews: Decodable, Sendable { + public var + id: UUID + public var + rating: Int? -public struct User: Decodable, Sendable ,Hashable, Equatable, Identifiable { - - - -public var -id: String - - - -public var -username: String + public var + reviewDate: LocalDate + public var + reviewText: String? + public struct Movie: Decodable, Sendable, Hashable, Equatable, Identifiable { + public var + id: UUID + public var + title: String + public var movieKey: MovieKey { + return MovieKey( + id: id + ) + } -public struct ReviewReviews: Decodable, Sendable { - + public func hash(into hasher: inout Hasher) { + hasher.combine(id) + } + public static func == (lhs: Movie, rhs: Movie) -> Bool { + return lhs.id == rhs.id + } -public var -id: UUID + enum CodingKeys: String, CodingKey { + case id + case title + } + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() -public var -rating: Int? + id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) + title = try codecHelper.decode(String.self, forKey: .title, container: &container) + } + } + public var + movie: Movie -public var -reviewDate: LocalDate + enum CodingKeys: String, CodingKey { + case id + case rating + case reviewDate -public var -reviewText: String? + case reviewText + case movie + } + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() + id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) + rating = try codecHelper.decode(Int?.self, forKey: .rating, container: &container) -public struct Movie: Decodable, Sendable ,Hashable, Equatable, Identifiable { - + reviewDate = try codecHelper.decode( + LocalDate.self, + forKey: .reviewDate, + container: &container + ) + reviewText = try codecHelper.decode( + String?.self, + forKey: .reviewText, + container: &container + ) -public var -id: UUID + movie = try codecHelper.decode(Movie.self, forKey: .movie, container: &container) + } + } + public var + reviews: [ReviewReviews] + public struct FavoriteMovieFavoriteMovies: Decodable, Sendable { + public struct Movie: Decodable, Sendable, Hashable, Equatable, Identifiable { + public var + id: UUID -public var -title: String + public var + title: String + public var + genre: String? - - public var movieKey: MovieKey { - return MovieKey( - - id: id - ) - } + public var + imageUrl: String - -public func hash(into hasher: inout Hasher) { - - hasher.combine(id) - -} -public static func == (lhs: Movie, rhs: Movie) -> Bool { - - return lhs.id == rhs.id - - } + public var + releaseYear: Int? - + public var + rating: Double? - - enum CodingKeys: String, CodingKey { - - case id - - case title - - } + public var + description: String? - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() + public var + tags: [String]? - - - self.id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) - - - - self.title = try codecHelper.decode(String.self, forKey: .title, container: &container) - - - } -} -public var -movie: Movie - - - - - - enum CodingKeys: String, CodingKey { - - case id - - case rating - - case reviewDate - - case reviewText - - case movie - - } - - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - - self.id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) - - - - self.rating = try codecHelper.decode(Int?.self, forKey: .rating, container: &container) - - - - self.reviewDate = try codecHelper.decode(LocalDate.self, forKey: .reviewDate, container: &container) - - - - self.reviewText = try codecHelper.decode(String?.self, forKey: .reviewText, container: &container) - - - - self.movie = try codecHelper.decode(Movie.self, forKey: .movie, container: &container) - - - } -} -public var -reviews: [ReviewReviews] + public struct MovieMetadataMetadata: Decodable, Sendable { + public var + director: String? + enum CodingKeys: String, CodingKey { + case director + } + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() + director = try codecHelper.decode( + String?.self, + forKey: .director, + container: &container + ) + } + } + public var + metadata: [MovieMetadataMetadata] -public struct FavoriteMovieFavoriteMovies: Decodable, Sendable { - + public var movieKey: MovieKey { + return MovieKey( + id: id + ) + } + public func hash(into hasher: inout Hasher) { + hasher.combine(id) + } + public static func == (lhs: Movie, rhs: Movie) -> Bool { + return lhs.id == rhs.id + } + enum CodingKeys: String, CodingKey { + case id -public struct Movie: Decodable, Sendable ,Hashable, Equatable, Identifiable { - + case title + case genre -public var -id: UUID + case imageUrl + case releaseYear + case rating -public var -title: String + case description + case tags + case metadata + } -public var -genre: String? + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() + id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) + title = try codecHelper.decode(String.self, forKey: .title, container: &container) -public var -imageUrl: String + genre = try codecHelper.decode(String?.self, forKey: .genre, container: &container) + imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) + releaseYear = try codecHelper.decode( + Int?.self, + forKey: .releaseYear, + container: &container + ) -public var -releaseYear: Int? + rating = try codecHelper.decode(Double?.self, forKey: .rating, container: &container) + description = try codecHelper.decode( + String?.self, + forKey: .description, + container: &container + ) + tags = try codecHelper.decode([String].self, forKey: .tags, container: &container) -public var -rating: Double? + metadata = try codecHelper.decode( + [MovieMetadataMetadata].self, + forKey: .metadata, + container: &container + ) + } + } + public var + movie: Movie + enum CodingKeys: String, CodingKey { + case movie + } -public var -description: String? + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() + movie = try codecHelper.decode(Movie.self, forKey: .movie, container: &container) + } + } + public var + favoriteMovies: [FavoriteMovieFavoriteMovies] -public var -tags: [String]? + public var userKey: UserKey { + return UserKey( + id: id + ) + } + public func hash(into hasher: inout Hasher) { + hasher.combine(id) + } + public static func == (lhs: User, rhs: User) -> Bool { + return lhs.id == rhs.id + } + enum CodingKeys: String, CodingKey { + case id + case username -public struct MovieMetadataMetadata: Decodable, Sendable { - + case reviews + case favoriteMovies + } -public var -director: String? + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() + id = try codecHelper.decode(String.self, forKey: .id, container: &container) - + username = try codecHelper.decode(String.self, forKey: .username, container: &container) - - enum CodingKeys: String, CodingKey { - - case director - - } + reviews = try codecHelper.decode( + [ReviewReviews].self, + forKey: .reviews, + container: &container + ) - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() + favoriteMovies = try codecHelper.decode( + [FavoriteMovieFavoriteMovies].self, + forKey: .favoriteMovies, + container: &container + ) + } + } - - - self.director = try codecHelper.decode(String?.self, forKey: .director, container: &container) - - + public var + user: User? } -} -public var -metadata: [MovieMetadataMetadata] - - - public var movieKey: MovieKey { - return MovieKey( - - id: id + public func ref( + ) -> QueryRefObservation { + var variables = GetCurrentUserQuery.Variables() + + let ref = dataConnect.query( + name: "GetCurrentUser", + variables: variables, + resultsDataType: GetCurrentUserQuery.Data.self, + publisher: .observableMacro ) + return ref as! QueryRefObservation } - -public func hash(into hasher: inout Hasher) { - - hasher.combine(id) - -} -public static func == (lhs: Movie, rhs: Movie) -> Bool { - - return lhs.id == rhs.id - - } - - - - - enum CodingKeys: String, CodingKey { - - case id - - case title - - case genre - - case imageUrl - - case releaseYear - - case rating - - case description - - case tags - - case metadata - - } - - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - - self.id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) - - - - self.title = try codecHelper.decode(String.self, forKey: .title, container: &container) - - - - self.genre = try codecHelper.decode(String?.self, forKey: .genre, container: &container) - - - - self.imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) - - - - self.releaseYear = try codecHelper.decode(Int?.self, forKey: .releaseYear, container: &container) - - - - self.rating = try codecHelper.decode(Double?.self, forKey: .rating, container: &container) - - - - self.description = try codecHelper.decode(String?.self, forKey: .description, container: &container) - - - self.tags = try codecHelper.decode([String].self, forKey: .tags, container: &container) - - - self.metadata = try codecHelper.decode([MovieMetadataMetadata].self, forKey: .metadata, container: &container) - - - } -} -public var -movie: Movie - - - - - - enum CodingKeys: String, CodingKey { - - case movie - - } - - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - - self.movie = try codecHelper.decode(Movie.self, forKey: .movie, container: &container) - - - } -} -public var -favoriteMovies: [FavoriteMovieFavoriteMovies] - - - - public var userKey: UserKey { - return UserKey( - - id: id + @MainActor + public func execute( + ) async throws -> OperationResult { + var variables = GetCurrentUserQuery.Variables() + + let ref = dataConnect.query( + name: "GetCurrentUser", + variables: variables, + resultsDataType: GetCurrentUserQuery.Data.self, + publisher: .observableMacro ) - } - -public func hash(into hasher: inout Hasher) { - - hasher.combine(id) - -} -public static func == (lhs: User, rhs: User) -> Bool { - - return lhs.id == rhs.id - - } - - - - - enum CodingKeys: String, CodingKey { - - case id - - case username - - case reviews - - case favoriteMovies - - } - - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - - self.id = try codecHelper.decode(String.self, forKey: .id, container: &container) - - - - self.username = try codecHelper.decode(String.self, forKey: .username, container: &container) - - - self.reviews = try codecHelper.decode([ReviewReviews].self, forKey: .reviews, container: &container) - - - self.favoriteMovies = try codecHelper.decode([FavoriteMovieFavoriteMovies].self, forKey: .favoriteMovies, container: &container) - - + let refCast = ref as! QueryRefObservation< + GetCurrentUserQuery.Data, + GetCurrentUserQuery.Variables + > + return try await refCast.execute() } } -public var -user: User? - - } - - public func ref( - - ) -> QueryRefObservation { - var variables = GetCurrentUserQuery.Variables() - - - let ref = dataConnect.query(name: "GetCurrentUser", variables: variables, resultsDataType:GetCurrentUserQuery.Data.self, publisher: .observableMacro) - return ref as! QueryRefObservation - } - - @MainActor - public func execute( - - ) async throws -> OperationResult { - var variables = GetCurrentUserQuery.Variables() - - - let ref = dataConnect.query(name: "GetCurrentUser", variables: variables, resultsDataType:GetCurrentUserQuery.Data.self, publisher: .observableMacro) - - let refCast = ref as! QueryRefObservation - return try await refCast.execute() - - } -} - - - - - - -public class GetIfFavoritedMovieQuery{ +public class GetIfFavoritedMovieQuery { let dataConnect: DataConnect init(dataConnect: DataConnect) { @@ -2488,847 +1744,590 @@ public class GetIfFavoritedMovieQuery{ public static let OperationName = "GetIfFavoritedMovie" - public typealias Ref = QueryRefObservation + public typealias Ref = QueryRefObservation< + GetIfFavoritedMovieQuery.Data, + GetIfFavoritedMovieQuery.Variables + > public struct Variables: OperationVariable { - - - public var -movieId: UUID - - - - - - public init ( - -movieId: UUID - - - ) { - self.movieId = movieId - + public var + movieId: UUID - + public init(movieId: UUID) { + self.movieId = movieId } public static func == (lhs: Variables, rhs: Variables) -> Bool { - - return lhs.movieId == rhs.movieId - + return lhs.movieId == rhs.movieId } - -public func hash(into hasher: inout Hasher) { - - hasher.combine(movieId) - -} + public func hash(into hasher: inout Hasher) { + hasher.combine(movieId) + } enum CodingKeys: String, CodingKey { - case movieId - } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) let codecHelper = CodecHelper() - - + try codecHelper.encode(movieId, forKey: .movieId, container: &container) - - } - } public struct Data: Decodable, Sendable { + public struct FavoriteMovie: Decodable, Sendable { + public var + movieId: UUID + enum CodingKeys: String, CodingKey { + case movieId + } + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() + movieId = try codecHelper.decode(UUID.self, forKey: .movieId, container: &container) + } + } -public struct FavoriteMovie: Decodable, Sendable { - - - -public var -movieId: UUID - + public var + favorite_movie: FavoriteMovie? + } - + public func ref(movieId: UUID) + -> QueryRefObservation { + var variables = GetIfFavoritedMovieQuery.Variables(movieId: movieId) - - enum CodingKeys: String, CodingKey { - - case movieId - + let ref = dataConnect.query( + name: "GetIfFavoritedMovie", + variables: variables, + resultsDataType: GetIfFavoritedMovieQuery.Data.self, + publisher: .observableMacro + ) + return ref as! QueryRefObservation< + GetIfFavoritedMovieQuery.Data, + GetIfFavoritedMovieQuery.Variables + > } - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() + @MainActor + public func execute(movieId: UUID) async throws + -> OperationResult { + var variables = GetIfFavoritedMovieQuery.Variables(movieId: movieId) + + let ref = dataConnect.query( + name: "GetIfFavoritedMovie", + variables: variables, + resultsDataType: GetIfFavoritedMovieQuery.Data.self, + publisher: .observableMacro + ) - - - self.movieId = try codecHelper.decode(UUID.self, forKey: .movieId, container: &container) - - + let refCast = ref as! QueryRefObservation< + GetIfFavoritedMovieQuery.Data, + GetIfFavoritedMovieQuery.Variables + > + return try await refCast.execute() } } -public var -favorite_movie: FavoriteMovie? +public class SearchAllQuery { + let dataConnect: DataConnect + + init(dataConnect: DataConnect) { + self.dataConnect = dataConnect } - public func ref( - -movieId: UUID + public static let OperationName = "SearchAll" - ) -> QueryRefObservation { - var variables = GetIfFavoritedMovieQuery.Variables(movieId:movieId) - + public typealias Ref = QueryRefObservation - let ref = dataConnect.query(name: "GetIfFavoritedMovie", variables: variables, resultsDataType:GetIfFavoritedMovieQuery.Data.self, publisher: .observableMacro) - return ref as! QueryRefObservation - } + public struct Variables: OperationVariable { + @OptionalVariable + public var + input: String? - @MainActor - public func execute( - -movieId: UUID - - ) async throws -> OperationResult { - var variables = GetIfFavoritedMovieQuery.Variables(movieId:movieId) - - - let ref = dataConnect.query(name: "GetIfFavoritedMovie", variables: variables, resultsDataType:GetIfFavoritedMovieQuery.Data.self, publisher: .observableMacro) - - let refCast = ref as! QueryRefObservation - return try await refCast.execute() - - } -} + public var + minYear: Int + public var + maxYear: Int + public var + minRating: Double + public var + maxRating: Double + public var + genre: String + public init(minYear: Int, -public class SearchAllQuery{ + maxYear: Int, - let dataConnect: DataConnect + minRating: Double, - init(dataConnect: DataConnect) { - self.dataConnect = dataConnect - } + maxRating: Double, - public static let OperationName = "SearchAll" + genre: String, - public typealias Ref = QueryRefObservation + _ optionalVars: ((inout Variables) -> Void)? = nil) { + self.minYear = minYear + self.maxYear = maxYear + self.minRating = minRating + self.maxRating = maxRating + self.genre = genre - public struct Variables: OperationVariable { - - @OptionalVariable - public var -input: String? + if let optionalVars { + optionalVars(&self) + } + } - - - public var -minYear: Int + public static func == (lhs: Variables, rhs: Variables) -> Bool { + return lhs.input == rhs.input && + lhs.minYear == rhs.minYear && + lhs.maxYear == rhs.maxYear && + lhs.minRating == rhs.minRating && + lhs.maxRating == rhs.maxRating && + lhs.genre == rhs.genre + } - - - public var -maxYear: Int + public func hash(into hasher: inout Hasher) { + hasher.combine(input) - - - public var -minRating: Double + hasher.combine(minYear) - - - public var -maxRating: Double + hasher.combine(maxYear) - - - public var -genre: String - - - - - - public init ( - -minYear: Int -, - -maxYear: Int -, - -minRating: Double -, - -maxRating: Double -, - -genre: String - - - - , - _ optionalVars: ((inout Variables)->())? = nil - ) { - self.minYear = minYear - self.maxYear = maxYear - self.minRating = minRating - self.maxRating = maxRating - self.genre = genre - - - - if let optionalVars { - optionalVars(&self) - } - - } + hasher.combine(minRating) - public static func == (lhs: Variables, rhs: Variables) -> Bool { - - return lhs.input == rhs.input && - lhs.minYear == rhs.minYear && - lhs.maxYear == rhs.maxYear && - lhs.minRating == rhs.minRating && - lhs.maxRating == rhs.maxRating && - lhs.genre == rhs.genre - - } - - -public func hash(into hasher: inout Hasher) { - - hasher.combine(input) - - hasher.combine(minYear) - - hasher.combine(maxYear) - - hasher.combine(minRating) - - hasher.combine(maxRating) - - hasher.combine(genre) - -} + hasher.combine(maxRating) + + hasher.combine(genre) + } enum CodingKeys: String, CodingKey { - case input - + case minYear - + case maxYear - + case minRating - + case maxRating - + case genre - } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) let codecHelper = CodecHelper() - - if $input.isSet { - try codecHelper.encode(input, forKey: .input, container: &container) + + if $input.isSet { + try codecHelper.encode(input, forKey: .input, container: &container) } - - + try codecHelper.encode(minYear, forKey: .minYear, container: &container) - - - + try codecHelper.encode(maxYear, forKey: .maxYear, container: &container) - - - + try codecHelper.encode(minRating, forKey: .minRating, container: &container) - - - + try codecHelper.encode(maxRating, forKey: .maxRating, container: &container) - - - + try codecHelper.encode(genre, forKey: .genre, container: &container) - - } - } public struct Data: Decodable, Sendable { + public struct MovieMoviesMatchingTitle: Decodable, Sendable, Hashable, Equatable, Identifiable { + public var + id: UUID + public var + title: String + public var + genre: String? + public var + rating: Double? -public struct MovieMoviesMatchingTitle: Decodable, Sendable ,Hashable, Equatable, Identifiable { - - - -public var -id: UUID - + public var + imageUrl: String + public var movieMoviesMatchingTitleKey: MovieKey { + return MovieKey( + id: id + ) + } -public var -title: String + public func hash(into hasher: inout Hasher) { + hasher.combine(id) + } + public static func == (lhs: MovieMoviesMatchingTitle, rhs: MovieMoviesMatchingTitle) -> Bool { + return lhs.id == rhs.id + } + enum CodingKeys: String, CodingKey { + case id -public var -genre: String? + case title + case genre + case rating -public var -rating: Double? + case imageUrl + } + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() + id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) -public var -imageUrl: String + title = try codecHelper.decode(String.self, forKey: .title, container: &container) + genre = try codecHelper.decode(String?.self, forKey: .genre, container: &container) - - public var movieMoviesMatchingTitleKey: MovieKey { - return MovieKey( - - id: id - ) - } + rating = try codecHelper.decode(Double?.self, forKey: .rating, container: &container) - -public func hash(into hasher: inout Hasher) { - - hasher.combine(id) - -} -public static func == (lhs: MovieMoviesMatchingTitle, rhs: MovieMoviesMatchingTitle) -> Bool { - - return lhs.id == rhs.id - - } - - - - - enum CodingKeys: String, CodingKey { - - case id - - case title - - case genre - - case rating - - case imageUrl - - } - - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - - self.id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) - - - - self.title = try codecHelper.decode(String.self, forKey: .title, container: &container) - - - - self.genre = try codecHelper.decode(String?.self, forKey: .genre, container: &container) - - - - self.rating = try codecHelper.decode(Double?.self, forKey: .rating, container: &container) - - - - self.imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) - - - } -} -public var -moviesMatchingTitle: [MovieMoviesMatchingTitle] + imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) + } + } + public var + moviesMatchingTitle: [MovieMoviesMatchingTitle] + public struct MovieMoviesMatchingDescription: Decodable, Sendable, Hashable, Equatable, + Identifiable { + public var + id: UUID + public var + title: String + public var + genre: String? -public struct MovieMoviesMatchingDescription: Decodable, Sendable ,Hashable, Equatable, Identifiable { - + public var + rating: Double? + public var + imageUrl: String -public var -id: UUID + public var movieMoviesMatchingDescriptionKey: MovieKey { + return MovieKey( + id: id + ) + } + public func hash(into hasher: inout Hasher) { + hasher.combine(id) + } + public static func == (lhs: MovieMoviesMatchingDescription, + rhs: MovieMoviesMatchingDescription) -> Bool { + return lhs.id == rhs.id + } -public var -title: String + enum CodingKeys: String, CodingKey { + case id + case title + case genre -public var -genre: String? + case rating + case imageUrl + } + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() -public var -rating: Double? + id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) + title = try codecHelper.decode(String.self, forKey: .title, container: &container) + genre = try codecHelper.decode(String?.self, forKey: .genre, container: &container) -public var -imageUrl: String + rating = try codecHelper.decode(Double?.self, forKey: .rating, container: &container) + imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) + } + } - - public var movieMoviesMatchingDescriptionKey: MovieKey { - return MovieKey( - - id: id - ) - } + public var + moviesMatchingDescription: [MovieMoviesMatchingDescription] - -public func hash(into hasher: inout Hasher) { - - hasher.combine(id) - -} -public static func == (lhs: MovieMoviesMatchingDescription, rhs: MovieMoviesMatchingDescription) -> Bool { - - return lhs.id == rhs.id - - } - - - - - enum CodingKeys: String, CodingKey { - - case id - - case title - - case genre - - case rating - - case imageUrl - - } - - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - - self.id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) - - - - self.title = try codecHelper.decode(String.self, forKey: .title, container: &container) - - - - self.genre = try codecHelper.decode(String?.self, forKey: .genre, container: &container) - - - - self.rating = try codecHelper.decode(Double?.self, forKey: .rating, container: &container) - - - - self.imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) - - - } -} -public var -moviesMatchingDescription: [MovieMoviesMatchingDescription] + public struct ActorActorsMatchingName: Decodable, Sendable, Hashable, Equatable, Identifiable { + public var + id: UUID + public var + name: String + public var + imageUrl: String + public var actorActorsMatchingNameKey: ActorKey { + return ActorKey( + id: id + ) + } + public func hash(into hasher: inout Hasher) { + hasher.combine(id) + } -public struct ActorActorsMatchingName: Decodable, Sendable ,Hashable, Equatable, Identifiable { - + public static func == (lhs: ActorActorsMatchingName, rhs: ActorActorsMatchingName) -> Bool { + return lhs.id == rhs.id + } + enum CodingKeys: String, CodingKey { + case id -public var -id: UUID + case name + case imageUrl + } + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() -public var -name: String + id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) + name = try codecHelper.decode(String.self, forKey: .name, container: &container) + imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) + } + } -public var -imageUrl: String + public var + actorsMatchingName: [ActorActorsMatchingName] + public struct ReviewReviewsMatchingText: Decodable, Sendable { + public var + id: UUID - - public var actorActorsMatchingNameKey: ActorKey { - return ActorKey( - - id: id - ) - } + public var + rating: Int? - -public func hash(into hasher: inout Hasher) { - - hasher.combine(id) - -} -public static func == (lhs: ActorActorsMatchingName, rhs: ActorActorsMatchingName) -> Bool { - - return lhs.id == rhs.id - - } - - - - - enum CodingKeys: String, CodingKey { - - case id - - case name - - case imageUrl - - } - - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - - self.id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) - - - - self.name = try codecHelper.decode(String.self, forKey: .name, container: &container) - - - - self.imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) - - - } -} -public var -actorsMatchingName: [ActorActorsMatchingName] + public var + reviewText: String? + public var + reviewDate: LocalDate + public struct Movie: Decodable, Sendable, Hashable, Equatable, Identifiable { + public var + id: UUID + public var + title: String + public var movieKey: MovieKey { + return MovieKey( + id: id + ) + } -public struct ReviewReviewsMatchingText: Decodable, Sendable { - + public func hash(into hasher: inout Hasher) { + hasher.combine(id) + } + public static func == (lhs: Movie, rhs: Movie) -> Bool { + return lhs.id == rhs.id + } -public var -id: UUID + enum CodingKeys: String, CodingKey { + case id + case title + } + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() -public var -rating: Int? + id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) + title = try codecHelper.decode(String.self, forKey: .title, container: &container) + } + } + public var + movie: Movie -public var -reviewText: String? + public struct User: Decodable, Sendable, Hashable, Equatable, Identifiable { + public var + id: String + public var + username: String + public var userKey: UserKey { + return UserKey( + id: id + ) + } -public var -reviewDate: LocalDate + public func hash(into hasher: inout Hasher) { + hasher.combine(id) + } + public static func == (lhs: User, rhs: User) -> Bool { + return lhs.id == rhs.id + } + enum CodingKeys: String, CodingKey { + case id + case username + } + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() -public struct Movie: Decodable, Sendable ,Hashable, Equatable, Identifiable { - + id = try codecHelper.decode(String.self, forKey: .id, container: &container) + username = try codecHelper.decode(String.self, forKey: .username, container: &container) + } + } -public var -id: UUID + public var + user: User + enum CodingKeys: String, CodingKey { + case id + case rating -public var -title: String + case reviewText + case reviewDate - - public var movieKey: MovieKey { - return MovieKey( - - id: id - ) - } + case movie - -public func hash(into hasher: inout Hasher) { - - hasher.combine(id) - -} -public static func == (lhs: Movie, rhs: Movie) -> Bool { - - return lhs.id == rhs.id - - } + case user + } - + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() - - enum CodingKeys: String, CodingKey { - - case id - - case title - - } + id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() + rating = try codecHelper.decode(Int?.self, forKey: .rating, container: &container) - - - self.id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) - - - - self.title = try codecHelper.decode(String.self, forKey: .title, container: &container) - - - } -} -public var -movie: Movie + reviewText = try codecHelper.decode( + String?.self, + forKey: .reviewText, + container: &container + ) + reviewDate = try codecHelper.decode( + LocalDate.self, + forKey: .reviewDate, + container: &container + ) + movie = try codecHelper.decode(Movie.self, forKey: .movie, container: &container) + user = try codecHelper.decode(User.self, forKey: .user, container: &container) + } + } + public var + reviewsMatchingText: [ReviewReviewsMatchingText] + } -public struct User: Decodable, Sendable ,Hashable, Equatable, Identifiable { - + public func ref(minYear: Int, + maxYear: Int, -public var -id: String + minRating: Double, + maxRating: Double, + genre: String, -public var -username: String + _ optionalVars: ((inout SearchAllQuery.Variables) -> Void)? = nil) + -> QueryRefObservation< + SearchAllQuery.Data, + SearchAllQuery.Variables + > { + var variables = SearchAllQuery.Variables( + minYear: minYear, + maxYear: maxYear, + minRating: minRating, + maxRating: maxRating, + genre: genre + ) + if let optionalVars { + optionalVars(&variables) + } - - public var userKey: UserKey { - return UserKey( - - id: id + let ref = dataConnect.query( + name: "SearchAll", + variables: variables, + resultsDataType: SearchAllQuery.Data.self, + publisher: .observableMacro ) + return ref as! QueryRefObservation } - -public func hash(into hasher: inout Hasher) { - - hasher.combine(id) - -} -public static func == (lhs: User, rhs: User) -> Bool { - - return lhs.id == rhs.id - - } + @MainActor + public func execute(minYear: Int, - + maxYear: Int, - - enum CodingKeys: String, CodingKey { - - case id - - case username - - } + minRating: Double, - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() + maxRating: Double, - - - self.id = try codecHelper.decode(String.self, forKey: .id, container: &container) - - - - self.username = try codecHelper.decode(String.self, forKey: .username, container: &container) - - - } -} -public var -user: User - - - - - - enum CodingKeys: String, CodingKey { - - case id - - case rating - - case reviewText - - case reviewDate - - case movie - - case user - - } - - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - - self.id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) - - - - self.rating = try codecHelper.decode(Int?.self, forKey: .rating, container: &container) - - - - self.reviewText = try codecHelper.decode(String?.self, forKey: .reviewText, container: &container) - - - - self.reviewDate = try codecHelper.decode(LocalDate.self, forKey: .reviewDate, container: &container) - - - - self.movie = try codecHelper.decode(Movie.self, forKey: .movie, container: &container) - - - - self.user = try codecHelper.decode(User.self, forKey: .user, container: &container) - - - } -} -public var -reviewsMatchingText: [ReviewReviewsMatchingText] + genre: String, - } + _ optionalVars: (@MainActor (inout SearchAllQuery.Variables) -> Void)? = + nil) async throws -> OperationResult { + var variables = SearchAllQuery.Variables( + minYear: minYear, + maxYear: maxYear, + minRating: minRating, + maxRating: maxRating, + genre: genre + ) - public func ref( - -minYear: Int -, -maxYear: Int -, -minRating: Double -, -maxRating: Double -, -genre: String - - - , - _ optionalVars: ((inout SearchAllQuery.Variables)->())? = nil - ) -> QueryRefObservation { - var variables = SearchAllQuery.Variables(minYear:minYear,maxYear:maxYear,minRating:minRating,maxRating:maxRating,genre:genre) - - if let optionalVars { - optionalVars(&variables) - } - + if let optionalVars { + optionalVars(&variables) + } - let ref = dataConnect.query(name: "SearchAll", variables: variables, resultsDataType:SearchAllQuery.Data.self, publisher: .observableMacro) - return ref as! QueryRefObservation - } + let ref = dataConnect.query( + name: "SearchAll", + variables: variables, + resultsDataType: SearchAllQuery.Data.self, + publisher: .observableMacro + ) - @MainActor - public func execute( - -minYear: Int -, -maxYear: Int -, -minRating: Double -, -maxRating: Double -, -genre: String - - - , - _ optionalVars: (@MainActor (inout SearchAllQuery.Variables)->())? = nil - ) async throws -> OperationResult { - var variables = SearchAllQuery.Variables(minYear:minYear,maxYear:maxYear,minRating:minRating,maxRating:maxRating,genre:genre) - - if let optionalVars { - optionalVars(&variables) - } - - - let ref = dataConnect.query(name: "SearchAll", variables: variables, resultsDataType:SearchAllQuery.Data.self, publisher: .observableMacro) - - let refCast = ref as! QueryRefObservation - return try await refCast.execute() - - } + let refCast = ref as! QueryRefObservation + return try await refCast.execute() + } } - - - - - -public class ListMoviesByPartialTitleQuery{ - +public class ListMoviesByPartialTitleQuery { let dataConnect: DataConnect init(dataConnect: DataConnect) { @@ -3337,221 +2336,158 @@ public class ListMoviesByPartialTitleQuery{ public static let OperationName = "ListMoviesByPartialTitle" - public typealias Ref = QueryRefObservation + public typealias Ref = QueryRefObservation< + ListMoviesByPartialTitleQuery.Data, + ListMoviesByPartialTitleQuery.Variables + > public struct Variables: OperationVariable { - - - public var -searchTerm: String + public var + searchTerm: String - - - - - public init ( - -searchTerm: String - - - ) { - self.searchTerm = searchTerm - - - + public init(searchTerm: String) { + self.searchTerm = searchTerm } public static func == (lhs: Variables, rhs: Variables) -> Bool { - - return lhs.searchTerm == rhs.searchTerm - + return lhs.searchTerm == rhs.searchTerm } - -public func hash(into hasher: inout Hasher) { - - hasher.combine(searchTerm) - -} + public func hash(into hasher: inout Hasher) { + hasher.combine(searchTerm) + } enum CodingKeys: String, CodingKey { - case searchTerm - } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) let codecHelper = CodecHelper() - - + try codecHelper.encode(searchTerm, forKey: .searchTerm, container: &container) - - } - } public struct Data: Decodable, Sendable { + public struct Movie: Decodable, Sendable, Hashable, Equatable, Identifiable { + public var + id: UUID + public var + title: String + public var + imageUrl: String + public var + releaseYear: Int? -public struct Movie: Decodable, Sendable ,Hashable, Equatable, Identifiable { - + public var + genre: String? + public var + rating: Double? -public var -id: UUID - + public var + description: String? + public var movieKey: MovieKey { + return MovieKey( + id: id + ) + } -public var -title: String + public func hash(into hasher: inout Hasher) { + hasher.combine(id) + } + public static func == (lhs: Movie, rhs: Movie) -> Bool { + return lhs.id == rhs.id + } + enum CodingKeys: String, CodingKey { + case id -public var -imageUrl: String + case title + case imageUrl + case releaseYear -public var -releaseYear: Int? + case genre + case rating + case description + } -public var -genre: String? + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() + id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) + title = try codecHelper.decode(String.self, forKey: .title, container: &container) -public var -rating: Double? + imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) + releaseYear = try codecHelper.decode(Int?.self, forKey: .releaseYear, container: &container) + genre = try codecHelper.decode(String?.self, forKey: .genre, container: &container) -public var -description: String? + rating = try codecHelper.decode(Double?.self, forKey: .rating, container: &container) + description = try codecHelper.decode( + String?.self, + forKey: .description, + container: &container + ) + } + } - - public var movieKey: MovieKey { - return MovieKey( - - id: id - ) + public var + movies: [Movie] } - -public func hash(into hasher: inout Hasher) { - - hasher.combine(id) - -} -public static func == (lhs: Movie, rhs: Movie) -> Bool { - - return lhs.id == rhs.id - - } - - - - - enum CodingKeys: String, CodingKey { - - case id - - case title - - case imageUrl - - case releaseYear - - case genre - - case rating - - case description - - } - - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - - self.id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) - - - - self.title = try codecHelper.decode(String.self, forKey: .title, container: &container) - - - - self.imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) - - - - self.releaseYear = try codecHelper.decode(Int?.self, forKey: .releaseYear, container: &container) - - - - self.genre = try codecHelper.decode(String?.self, forKey: .genre, container: &container) - - - - self.rating = try codecHelper.decode(Double?.self, forKey: .rating, container: &container) - - - - self.description = try codecHelper.decode(String?.self, forKey: .description, container: &container) - - - } -} -public var -movies: [Movie] + public func ref(searchTerm: String) + -> QueryRefObservation { + var variables = ListMoviesByPartialTitleQuery.Variables(searchTerm: searchTerm) + let ref = dataConnect.query( + name: "ListMoviesByPartialTitle", + variables: variables, + resultsDataType: ListMoviesByPartialTitleQuery.Data.self, + publisher: .observableMacro + ) + return ref as! QueryRefObservation< + ListMoviesByPartialTitleQuery.Data, + ListMoviesByPartialTitleQuery.Variables + > } - public func ref( - -searchTerm: String - - ) -> QueryRefObservation { - var variables = ListMoviesByPartialTitleQuery.Variables(searchTerm:searchTerm) - - - let ref = dataConnect.query(name: "ListMoviesByPartialTitle", variables: variables, resultsDataType:ListMoviesByPartialTitleQuery.Data.self, publisher: .observableMacro) - return ref as! QueryRefObservation - } - @MainActor - public func execute( - -searchTerm: String - - ) async throws -> OperationResult { - var variables = ListMoviesByPartialTitleQuery.Variables(searchTerm:searchTerm) - - - let ref = dataConnect.query(name: "ListMoviesByPartialTitle", variables: variables, resultsDataType:ListMoviesByPartialTitleQuery.Data.self, publisher: .observableMacro) - - let refCast = ref as! QueryRefObservation - return try await refCast.execute() - - } -} - - - - - + public func execute(searchTerm: String) async throws + -> OperationResult { + var variables = ListMoviesByPartialTitleQuery.Variables(searchTerm: searchTerm) + + let ref = dataConnect.query( + name: "ListMoviesByPartialTitle", + variables: variables, + resultsDataType: ListMoviesByPartialTitleQuery.Data.self, + publisher: .observableMacro + ) -public class GetUserFavoriteMoviesQuery{ + let refCast = ref as! QueryRefObservation< + ListMoviesByPartialTitleQuery.Data, + ListMoviesByPartialTitleQuery.Variables + > + return try await refCast.execute() + } +} +public class GetUserFavoriteMoviesQuery { let dataConnect: DataConnect init(dataConnect: DataConnect) { @@ -3560,220 +2496,168 @@ public class GetUserFavoriteMoviesQuery{ public static let OperationName = "GetUserFavoriteMovies" - public typealias Ref = QueryRefObservation + public typealias Ref = QueryRefObservation< + GetUserFavoriteMoviesQuery.Data, + GetUserFavoriteMoviesQuery.Variables + > - public struct Variables: OperationVariable { - - - - } + public struct Variables: OperationVariable {} public struct Data: Decodable, Sendable { + public struct User: Decodable, Sendable { + public struct FavoriteMovieFavoriteMovies: Decodable, Sendable { + public struct Movie: Decodable, Sendable, Hashable, Equatable, Identifiable { + public var + id: UUID + public var + title: String + public var + genre: String? + public var + imageUrl: String -public struct User: Decodable, Sendable { - - - - - -public struct FavoriteMovieFavoriteMovies: Decodable, Sendable { - - + public var + releaseYear: Int? + public var + rating: Double? + public var + description: String? -public struct Movie: Decodable, Sendable ,Hashable, Equatable, Identifiable { - + public var movieKey: MovieKey { + return MovieKey( + id: id + ) + } + public func hash(into hasher: inout Hasher) { + hasher.combine(id) + } -public var -id: UUID + public static func == (lhs: Movie, rhs: Movie) -> Bool { + return lhs.id == rhs.id + } + enum CodingKeys: String, CodingKey { + case id + case title -public var -title: String + case genre + case imageUrl + case releaseYear -public var -genre: String? + case rating + case description + } + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() -public var -imageUrl: String + id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) + title = try codecHelper.decode(String.self, forKey: .title, container: &container) + genre = try codecHelper.decode(String?.self, forKey: .genre, container: &container) -public var -releaseYear: Int? + imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) + releaseYear = try codecHelper.decode( + Int?.self, + forKey: .releaseYear, + container: &container + ) + rating = try codecHelper.decode(Double?.self, forKey: .rating, container: &container) -public var -rating: Double? - - + description = try codecHelper.decode( + String?.self, + forKey: .description, + container: &container + ) + } + } -public var -description: String? + public var + movie: Movie + enum CodingKeys: String, CodingKey { + case movie + } - - public var movieKey: MovieKey { - return MovieKey( - - id: id - ) - } + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() - -public func hash(into hasher: inout Hasher) { - - hasher.combine(id) - -} -public static func == (lhs: Movie, rhs: Movie) -> Bool { - - return lhs.id == rhs.id - - } - - - - - enum CodingKeys: String, CodingKey { - - case id - - case title - - case genre - - case imageUrl - - case releaseYear - - case rating - - case description - - } - - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() - - - - self.id = try codecHelper.decode(UUID.self, forKey: .id, container: &container) - - - - self.title = try codecHelper.decode(String.self, forKey: .title, container: &container) - - - - self.genre = try codecHelper.decode(String?.self, forKey: .genre, container: &container) - - - - self.imageUrl = try codecHelper.decode(String.self, forKey: .imageUrl, container: &container) - - - - self.releaseYear = try codecHelper.decode(Int?.self, forKey: .releaseYear, container: &container) - - - - self.rating = try codecHelper.decode(Double?.self, forKey: .rating, container: &container) - - - - self.description = try codecHelper.decode(String?.self, forKey: .description, container: &container) - - - } -} -public var -movie: Movie + movie = try codecHelper.decode(Movie.self, forKey: .movie, container: &container) + } + } + public var + favoriteMovies: [FavoriteMovieFavoriteMovies] - + enum CodingKeys: String, CodingKey { + case favoriteMovies + } - - enum CodingKeys: String, CodingKey { - - case movie - - } + public init(from decoder: any Decoder) throws { + var container = try decoder.container(keyedBy: CodingKeys.self) + let codecHelper = CodecHelper() - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() + favoriteMovies = try codecHelper.decode( + [FavoriteMovieFavoriteMovies].self, + forKey: .favoriteMovies, + container: &container + ) + } + } - - - self.movie = try codecHelper.decode(Movie.self, forKey: .movie, container: &container) - - + public var + user: User? } -} -public var -favoriteMovies: [FavoriteMovieFavoriteMovies] - - - - - enum CodingKeys: String, CodingKey { - - case favoriteMovies - + public func ref( + ) + -> QueryRefObservation { + var variables = GetUserFavoriteMoviesQuery.Variables() + + let ref = dataConnect.query( + name: "GetUserFavoriteMovies", + variables: variables, + resultsDataType: GetUserFavoriteMoviesQuery.Data.self, + publisher: .observableMacro + ) + return ref as! QueryRefObservation< + GetUserFavoriteMoviesQuery.Data, + GetUserFavoriteMoviesQuery.Variables + > } - public init(from decoder: any Decoder) throws { - var container = try decoder.container(keyedBy: CodingKeys.self) - let codecHelper = CodecHelper() + @MainActor + public func execute( + ) async throws -> OperationResult { + var variables = GetUserFavoriteMoviesQuery.Variables() + + let ref = dataConnect.query( + name: "GetUserFavoriteMovies", + variables: variables, + resultsDataType: GetUserFavoriteMoviesQuery.Data.self, + publisher: .observableMacro + ) - - self.favoriteMovies = try codecHelper.decode([FavoriteMovieFavoriteMovies].self, forKey: .favoriteMovies, container: &container) - - + let refCast = ref as! QueryRefObservation< + GetUserFavoriteMoviesQuery.Data, + GetUserFavoriteMoviesQuery.Variables + > + return try await refCast.execute() } } -public var -user: User? - - } - - public func ref( - - ) -> QueryRefObservation { - var variables = GetUserFavoriteMoviesQuery.Variables() - - - let ref = dataConnect.query(name: "GetUserFavoriteMovies", variables: variables, resultsDataType:GetUserFavoriteMoviesQuery.Data.self, publisher: .observableMacro) - return ref as! QueryRefObservation - } - - @MainActor - public func execute( - - ) async throws -> OperationResult { - var variables = GetUserFavoriteMoviesQuery.Variables() - - - let ref = dataConnect.query(name: "GetUserFavoriteMovies", variables: variables, resultsDataType:GetUserFavoriteMoviesQuery.Data.self, publisher: .observableMacro) - - let refCast = ref as! QueryRefObservation - return try await refCast.execute() - - } -} - -