-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Merge OpenWorld & Rapid Logic - Remove Error Models - Remove Rapid Specific Exceptions - Refactor Multiple Classes BREAKING CHANGE: Imports & Types Changed - Builders Merged With Base Classes PR: #137
- Loading branch information
Showing
104 changed files
with
568 additions
and
1,424 deletions.
There are no files selected for viewing
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
133 changes: 0 additions & 133 deletions
133
src/main/kotlin/com/expediagroup/common/sdk/core/client/Client.kt
This file was deleted.
Oops, something went wrong.
69 changes: 0 additions & 69 deletions
69
src/main/kotlin/com/expediagroup/common/sdk/core/configuration/ClientBuilder.kt
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
src/main/kotlin/com/expediagroup/common/sdk/core/model/exception/BaseException.kt
This file was deleted.
Oops, something went wrong.
58 changes: 58 additions & 0 deletions
58
src/main/kotlin/com/expediagroup/openworld/sdk/core/client/BaseRapidClient.kt
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,58 @@ | ||
/* | ||
* Copyright (C) 2022 Expedia, Inc. | ||
* | ||
* 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. | ||
*/ | ||
package com.expediagroup.openworld.sdk.core.client | ||
|
||
import com.expediagroup.openworld.sdk.core.configuration.RapidClientConfiguration | ||
import com.expediagroup.openworld.sdk.core.configuration.collector.ConfigurationCollector | ||
import com.expediagroup.openworld.sdk.core.configuration.provider.ConfigurationProvider | ||
import com.expediagroup.openworld.sdk.core.configuration.provider.RapidConfigurationProvider | ||
import com.expediagroup.openworld.sdk.core.plugin.authentication.strategy.AuthenticationStrategy | ||
import io.ktor.client.HttpClient | ||
import io.ktor.client.engine.HttpClientEngine | ||
|
||
/** | ||
* The integration point between the SDK Core and the product SDKs. | ||
* | ||
* @param httpClientEngine The HTTP client engine to use. | ||
* @param clientConfiguration The configuration for the client. | ||
*/ | ||
abstract class BaseRapidClient( | ||
clientConfiguration: RapidClientConfiguration, | ||
httpClientEngine: HttpClientEngine = DEFAULT_HTTP_CLIENT_ENGINE | ||
) : Client() { | ||
private val configurationProvider: ConfigurationProvider = ConfigurationCollector.create( | ||
clientConfiguration.toProvider(), | ||
RapidConfigurationProvider | ||
) | ||
private val _httpClient: HttpClient = buildHttpClient(configurationProvider, AuthenticationStrategy.AuthenticationType.SIGNATURE, httpClientEngine) | ||
|
||
init { | ||
finalize() | ||
} | ||
|
||
override val httpClient: HttpClient | ||
get() = _httpClient | ||
|
||
/** | ||
* A [BaseRapidClient] builder. | ||
* | ||
* @property key The API key to use for authentication. | ||
* @property secret The API secret to use for authentication. | ||
* @property endpoint The API endpoint to use for requests. | ||
*/ | ||
@Suppress("unused", "UnnecessaryAbstractClass") // This is used by the generated SDK clients. | ||
abstract class Builder<SELF : Builder<SELF>> : Client.Builder<SELF>() | ||
} |
Oops, something went wrong.