Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): manual updates #43

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,4 @@ internal fun <K, V> ListMultimap<K, V>.toUnmodifiable(): ListMultimap<K, V> {
return Multimaps.unmodifiableListMultimap(this)
}

@JvmSynthetic
internal fun ListMultimap<String, String>.getRequiredHeader(header: String): String {
val value =
entries()
.stream()
.filter { entry -> entry.key.equals(header, ignoreCase = true) }
.map { entry -> entry.value }
.findFirst()
if (!value.isPresent) {
throw OpenlayerInvalidDataException("Could not find $header header")
}
return value.get()
}

internal interface Enum
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.openlayer.api.core.http

import com.google.common.util.concurrent.MoreExecutors
import com.openlayer.api.core.RequestOptions
import com.openlayer.api.errors.OpenlayerIoException
import java.io.IOException
Expand Down Expand Up @@ -116,8 +115,10 @@ private constructor(
executeWithRetries(request, requestOptions)
}
},
MoreExecutors.directExecutor()
)
) {
// Run in the same thread.
it.run()
}
.thenCompose(Function.identity())
}

Expand Down
Loading