Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Friese <[email protected]>
  • Loading branch information
peterfriese committed Nov 9, 2024
1 parent ef9920d commit 41493e5
Show file tree
Hide file tree
Showing 5 changed files with 1,891 additions and 3,118 deletions.
53 changes: 26 additions & 27 deletions Examples/FriendlyFlix/app/FriendlyFlixSDK/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
),
]
)
12 changes: 6 additions & 6 deletions Examples/FriendlyFlix/app/FriendlyFlixSDK/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ DataConnect.friendlyFlixConnector.getUserFavoriteMoviesQuery.execute(...)

let username: String = ...
```


### One-shot execute
```
Expand All @@ -382,7 +382,7 @@ DataConnect.friendlyFlixConnector.upsertUserMutation.execute(...)

let movieId: UUID = ...
```


### One-shot execute
```
Expand All @@ -398,7 +398,7 @@ DataConnect.friendlyFlixConnector.addFavoritedMovieMutation.execute(...)

let movieId: UUID = ...
```


### One-shot execute
```
Expand All @@ -416,7 +416,7 @@ let movieId: UUID = ...
let rating: Int = ...
let reviewText: String = ...
```


### One-shot execute
```
Expand All @@ -434,7 +434,7 @@ let movieId: UUID = ...
let rating: Int = ...
let reviewText: String = ...
```


### One-shot execute
```
Expand All @@ -450,7 +450,7 @@ DataConnect.friendlyFlixConnector.updateReviewMutation.execute(...)

let movieId: UUID = ...
```


### One-shot execute
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Loading

0 comments on commit 41493e5

Please sign in to comment.