-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
22b9d77
commit 5fc4790
Showing
24 changed files
with
1,027 additions
and
304 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
Sources/TMDb/Domain/Services/TVSeries/Requests/PopularTVSeriesRequest.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// PopularTVSeriesRequest.swift | ||
// TMDb | ||
// | ||
// Copyright © 2024 Adam Young. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an AS IS BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import Foundation | ||
|
||
final class PopularTVSeriesRequest: DecodableAPIRequest<TVSeriesPageableList> { | ||
|
||
init(page: Int? = nil) { | ||
let path = "/tv/popular" | ||
let queryItems = APIRequestQueryItems(page: page) | ||
|
||
super.init(path: path, queryItems: queryItems) | ||
} | ||
|
||
} | ||
|
||
private extension APIRequestQueryItems { | ||
|
||
init(page: Int?) { | ||
self.init() | ||
|
||
if let page { | ||
self[.page] = page | ||
} | ||
} | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
Sources/TMDb/Domain/Services/TVSeries/Requests/SimilarTVSeriesRequest.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// SimilarTVSeriesRequest.swift | ||
// TMDb | ||
// | ||
// Copyright © 2024 Adam Young. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an AS IS BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import Foundation | ||
|
||
final class SimilarTVSeriesRequest: DecodableAPIRequest<TVSeriesPageableList> { | ||
|
||
init(id: TVSeries.ID, page: Int? = nil) { | ||
let path = "/tv/\(id)/similar" | ||
let queryItems = APIRequestQueryItems(page: page) | ||
|
||
super.init(path: path, queryItems: queryItems) | ||
} | ||
|
||
} | ||
|
||
private extension APIRequestQueryItems { | ||
|
||
init(page: Int?) { | ||
self.init() | ||
|
||
if let page { | ||
self[.page] = page | ||
} | ||
} | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
Sources/TMDb/Domain/Services/TVSeries/Requests/TVSeriesCreditsRequest.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// TVSeriesCreditsRequest.swift | ||
// TMDb | ||
// | ||
// Copyright © 2024 Adam Young. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an AS IS BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import Foundation | ||
|
||
final class TVSeriesCreditsRequest: DecodableAPIRequest<ShowCredits> { | ||
|
||
init(id: TVSeries.ID) { | ||
let path = "/tv/\(id)/credits" | ||
|
||
super.init(path: path) | ||
} | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
Sources/TMDb/Domain/Services/TVSeries/Requests/TVSeriesExternalLinksRequest.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// TVSeriesExternalLinksRequest.swift | ||
// TMDb | ||
// | ||
// Copyright © 2024 Adam Young. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an AS IS BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import Foundation | ||
|
||
final class TVSeriesExternalLinksRequest: DecodableAPIRequest<TVSeriesExternalLinksCollection> { | ||
|
||
init(id: TVSeries.ID) { | ||
let path = "/tv/\(id)/external_ids" | ||
|
||
super.init(path: path) | ||
} | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
Sources/TMDb/Domain/Services/TVSeries/Requests/TVSeriesImagesRequest.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// TVSeriesImagesRequest.swift | ||
// TMDb | ||
// | ||
// Copyright © 2024 Adam Young. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an AS IS BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import Foundation | ||
|
||
final class TVSeriesImagesRequest: DecodableAPIRequest<ImageCollection> { | ||
|
||
init(id: TVSeries.ID, languageCode: String? = nil) { | ||
let path = "/tv/\(id)/images" | ||
let queryItems = APIRequestQueryItems(languageCode: languageCode) | ||
|
||
super.init(path: path, queryItems: queryItems) | ||
} | ||
|
||
} | ||
|
||
private extension APIRequestQueryItems { | ||
|
||
init(languageCode: String?) { | ||
self.init() | ||
|
||
if let languageCode { | ||
self[.includeImageLanguage] = [languageCode, "null"].joined(separator: ",") | ||
} | ||
} | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
Sources/TMDb/Domain/Services/TVSeries/Requests/TVSeriesRecommendationsRequest.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// TVSeriesRecommendationsRequest.swift | ||
// TMDb | ||
// | ||
// Copyright © 2024 Adam Young. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an AS IS BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import Foundation | ||
|
||
final class TVSeriesRecommendationsRequest: DecodableAPIRequest<TVSeriesPageableList> { | ||
|
||
init(id: TVSeries.ID, page: Int? = nil) { | ||
let path = "/tv/\(id)/recommendations" | ||
let queryItems = APIRequestQueryItems(page: page) | ||
|
||
super.init(path: path, queryItems: queryItems) | ||
} | ||
|
||
} | ||
|
||
private extension APIRequestQueryItems { | ||
|
||
init(page: Int?) { | ||
self.init() | ||
|
||
if let page { | ||
self[.page] = page | ||
} | ||
} | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
Sources/TMDb/Domain/Services/TVSeries/Requests/TVSeriesRequest.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// TVSeriesRequest.swift | ||
// TMDb | ||
// | ||
// Copyright © 2024 Adam Young. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an AS IS BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import Foundation | ||
|
||
final class TVSeriesRequest: DecodableAPIRequest<TVSeries> { | ||
|
||
init(id: TVSeries.ID) { | ||
let path = "/tv/\(id)" | ||
|
||
super.init(path: path) | ||
} | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
Sources/TMDb/Domain/Services/TVSeries/Requests/TVSeriesReviewsRequest.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// TVSeriesReviewsRequest.swift | ||
// TMDb | ||
// | ||
// Copyright © 2024 Adam Young. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an AS IS BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import Foundation | ||
|
||
final class TVSeriesReviewsRequest: DecodableAPIRequest<ReviewPageableList> { | ||
|
||
init(id: TVSeries.ID, page: Int? = nil) { | ||
let path = "/tv/\(id)/reviews" | ||
let queryItems = APIRequestQueryItems(page: page) | ||
|
||
super.init(path: path, queryItems: queryItems) | ||
} | ||
|
||
} | ||
|
||
private extension APIRequestQueryItems { | ||
|
||
init(page: Int?) { | ||
self.init() | ||
|
||
if let page { | ||
self[.page] = page | ||
} | ||
} | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
Sources/TMDb/Domain/Services/TVSeries/Requests/TVSeriesVideosRequest.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// TVSeriesVideosRequest.swift | ||
// TMDb | ||
// | ||
// Copyright © 2024 Adam Young. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an AS IS BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import Foundation | ||
|
||
final class TVSeriesVideosRequest: DecodableAPIRequest<VideoCollection> { | ||
|
||
init(id: TVSeries.ID, languageCode: String? = nil) { | ||
let path = "/tv/\(id)/videos" | ||
let queryItems = APIRequestQueryItems(languageCode: languageCode) | ||
|
||
super.init(path: path, queryItems: queryItems) | ||
} | ||
|
||
} | ||
|
||
private extension APIRequestQueryItems { | ||
|
||
init(languageCode: String?) { | ||
self.init() | ||
|
||
if let languageCode { | ||
self[.includeVideoLanguage] = [languageCode, "null"].joined(separator: ",") | ||
} | ||
} | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
Sources/TMDb/Domain/Services/TVSeries/Requests/TVSeriesWatchProvidersRequest.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// TVSeriesWatchProvidersRequest.swift | ||
// TMDb | ||
// | ||
// Copyright © 2024 Adam Young. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an AS IS BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import Foundation | ||
|
||
final class TVSeriesWatchProvidersRequest: DecodableAPIRequest<ShowWatchProviderResult> { | ||
|
||
init(id: TVSeries.ID) { | ||
let path = "/tv/\(id)/watch/providers" | ||
|
||
super.init(path: path) | ||
} | ||
|
||
} |
Oops, something went wrong.