Skip to content

Commit

Permalink
Fix CocoaPods compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jkmassel committed Nov 27, 2024
1 parent 625914e commit 3046c6f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import Foundation

#if canImport(WordPressAPIInternal)
@preconcurrency import WordPressAPIInternal
#endif

#if os(Linux)
import FoundationNetworking
Expand Down Expand Up @@ -107,74 +110,74 @@ extension MediaRequestPerformer: RequestPerformer {
// Allows the performer to respond to everything the PostsRequestExecutor does
extension MediaRequestPerformer: MediaRequestExecutorProtocol {
public func listWithViewContext(
params: WordPressAPIInternal.MediaListParams
) async throws -> WordPressAPIInternal.MediaRequestListWithViewContextResponse {
params: MediaListParams
) async throws -> MediaRequestListWithViewContextResponse {
try await self.executor.listWithViewContext(params: params)
}

public func listWithEmbedContext(
params: WordPressAPIInternal.MediaListParams
) async throws -> WordPressAPIInternal.MediaRequestListWithEmbedContextResponse {
params: MediaListParams
) async throws -> MediaRequestListWithEmbedContextResponse {
try await self.executor.listWithEmbedContext(params: params)
}

public func listWithEditContext(
params: WordPressAPIInternal.MediaListParams
) async throws -> WordPressAPIInternal.MediaRequestListWithEditContextResponse {
params: MediaListParams
) async throws -> MediaRequestListWithEditContextResponse {
try await self.executor.listWithEditContext(params: params)
}

public func delete(
mediaId: WordPressAPIInternal.MediaId
) async throws -> WordPressAPIInternal.MediaRequestDeleteResponse {
mediaId: MediaId
) async throws -> MediaRequestDeleteResponse {
try await self.executor.delete(mediaId: mediaId)
}

public func filterListWithEditContext(
params: WordPressAPIInternal.MediaListParams,
fields: [WordPressAPIInternal.SparseMediaFieldWithEditContext]
) async throws -> WordPressAPIInternal.MediaRequestFilterListWithEditContextResponse {
params: MediaListParams,
fields: [SparseMediaFieldWithEditContext]
) async throws -> MediaRequestFilterListWithEditContextResponse {
try await self.executor.filterListWithEditContext(params: params, fields: fields)
}

public func filterListWithEmbedContext(
params: WordPressAPIInternal.MediaListParams,
fields: [WordPressAPIInternal.SparseMediaFieldWithEmbedContext]
) async throws -> WordPressAPIInternal.MediaRequestFilterListWithEmbedContextResponse {
params: MediaListParams,
fields: [SparseMediaFieldWithEmbedContext]
) async throws -> MediaRequestFilterListWithEmbedContextResponse {
try await self.executor.filterListWithEmbedContext(params: params, fields: fields)
}

public func filterListWithViewContext(
params: WordPressAPIInternal.MediaListParams,
fields: [WordPressAPIInternal.SparseMediaFieldWithViewContext]
) async throws -> WordPressAPIInternal.MediaRequestFilterListWithViewContextResponse {
params: MediaListParams,
fields: [SparseMediaFieldWithViewContext]
) async throws -> MediaRequestFilterListWithViewContextResponse {
try await self.executor.filterListWithViewContext(params: params, fields: fields)
}

public func filterRetrieveWithEditContext(
mediaId: WordPressAPIInternal.MediaId,
fields: [WordPressAPIInternal.SparseMediaFieldWithEditContext]
) async throws -> WordPressAPIInternal.MediaRequestFilterRetrieveWithEditContextResponse {
mediaId: MediaId,
fields: [SparseMediaFieldWithEditContext]
) async throws -> MediaRequestFilterRetrieveWithEditContextResponse {
try await self.executor.filterRetrieveWithEditContext(mediaId: mediaId, fields: fields)
}

public func filterRetrieveWithEmbedContext(
mediaId: WordPressAPIInternal.MediaId,
fields: [WordPressAPIInternal.SparseMediaFieldWithEmbedContext]
) async throws -> WordPressAPIInternal.MediaRequestFilterRetrieveWithEmbedContextResponse {
mediaId: MediaId,
fields: [SparseMediaFieldWithEmbedContext]
) async throws -> MediaRequestFilterRetrieveWithEmbedContextResponse {
try await self.executor.filterRetrieveWithEmbedContext(mediaId: mediaId, fields: fields)
}

public func filterRetrieveWithViewContext(
mediaId: WordPressAPIInternal.MediaId,
fields: [WordPressAPIInternal.SparseMediaFieldWithViewContext]
) async throws -> WordPressAPIInternal.MediaRequestFilterRetrieveWithViewContextResponse {
mediaId: MediaId,
fields: [SparseMediaFieldWithViewContext]
) async throws -> MediaRequestFilterRetrieveWithViewContextResponse {
try await self.executor.filterRetrieveWithViewContext(mediaId: mediaId, fields: fields)
}

public func retrieveWithEditContext(
mediaId: WordPressAPIInternal.MediaId
) async throws -> WordPressAPIInternal.MediaRequestRetrieveWithEditContextResponse {
mediaId: MediaId
) async throws -> MediaRequestRetrieveWithEditContextResponse {
try await self.executor.retrieveWithEditContext(mediaId: mediaId)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extension PostTypeRequestPerformer: PostTypesRequestExecutorProtocol {
public func filterRetrieveWithEditContext(
postType: PostType,
fields: [SparsePostTypeDetailsFieldWithEditContext]
) async throws -> WordPressAPIInternal.PostTypesRequestFilterRetrieveWithEditContextResponse {
) async throws -> PostTypesRequestFilterRetrieveWithEditContextResponse {
try await executor.filterRetrieveWithEditContext(postType: postType, fields: fields)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ extension PostsRequestPerformer: PublisherAwarePerformer {}
extension PostsRequestPerformer: PostsRequestExecutorProtocol {

public func create(
params: WordPressAPIInternal.PostCreateParams
) async throws -> WordPressAPIInternal.PostsRequestCreateResponse {
params: PostCreateParams
) async throws -> PostsRequestCreateResponse {
try await self.executor.create(params: params)
}

Expand Down

0 comments on commit 3046c6f

Please sign in to comment.