-
Notifications
You must be signed in to change notification settings - Fork 0
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
dcc048f
commit bc26e3f
Showing
322 changed files
with
42,175 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
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. |
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,14 @@ | ||
# Welcome to the xap-sdk SDK! | ||
|
||
## Usage | ||
```xml | ||
<dependency> | ||
<groupId>com.expediagroup</groupId> | ||
<artifactId>xap-sdk</artifactId> | ||
<version>0.0.18-SNAPSHOT</version> | ||
</dependency> | ||
``` | ||
|
||
## License | ||
|
||
This project is licensed under the Apache License v2.0 - see the [LICENSE](LICENSE) for details. |
Large diffs are not rendered by default.
Oops, something went wrong.
57 changes: 57 additions & 0 deletions
57
code/src/main/kotlin/com/expediagroup/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,57 @@ | ||
/* | ||
* 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.sdk.core.client | ||
|
||
import com.expediagroup.sdk.core.configuration.RapidClientConfiguration | ||
import com.expediagroup.sdk.core.configuration.collector.ConfigurationCollector | ||
import com.expediagroup.sdk.core.configuration.provider.ConfigurationProvider | ||
import com.expediagroup.sdk.core.configuration.provider.RapidConfigurationProvider | ||
import com.expediagroup.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( | ||
namespace: String, | ||
clientConfiguration: RapidClientConfiguration, | ||
httpClientEngine: HttpClientEngine = DEFAULT_HTTP_CLIENT_ENGINE | ||
) : Client(namespace) { | ||
private val _configurationProvider: ConfigurationProvider = | ||
ConfigurationCollector.create( | ||
clientConfiguration.toProvider(), | ||
RapidConfigurationProvider | ||
) | ||
private val _httpClient: HttpClient = buildHttpClient(_configurationProvider, AuthenticationStrategy.AuthenticationType.SIGNATURE, httpClientEngine) | ||
|
||
init { | ||
finalize() | ||
} | ||
|
||
override val configurationProvider: ConfigurationProvider | ||
get() = _configurationProvider | ||
|
||
override val httpClient: HttpClient | ||
get() = _httpClient | ||
|
||
/** A [BaseRapidClient] builder. */ | ||
@Suppress("unused", "UnnecessaryAbstractClass") // This is used by the generated SDK clients. | ||
abstract class Builder<SELF : Builder<SELF>> : Client.Builder<SELF>() | ||
} |
57 changes: 57 additions & 0 deletions
57
code/src/main/kotlin/com/expediagroup/sdk/core/client/BaseXapClient.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,57 @@ | ||
/* | ||
* 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.sdk.core.client | ||
|
||
import com.expediagroup.sdk.core.configuration.XapClientConfiguration | ||
import com.expediagroup.sdk.core.configuration.collector.ConfigurationCollector | ||
import com.expediagroup.sdk.core.configuration.provider.ConfigurationProvider | ||
import com.expediagroup.sdk.core.configuration.provider.XapConfigurationProvider | ||
import com.expediagroup.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 BaseXapClient( | ||
namespace: String, | ||
clientConfiguration: XapClientConfiguration, | ||
httpClientEngine: HttpClientEngine = DEFAULT_HTTP_CLIENT_ENGINE | ||
) : Client(namespace) { | ||
private val _configurationProvider: ConfigurationProvider = | ||
ConfigurationCollector.create( | ||
clientConfiguration.toProvider(), | ||
XapConfigurationProvider | ||
) | ||
private val _httpClient: HttpClient = buildHttpClient(_configurationProvider, AuthenticationStrategy.AuthenticationType.BASIC, httpClientEngine) | ||
|
||
init { | ||
finalize() | ||
} | ||
|
||
override val configurationProvider: ConfigurationProvider | ||
get() = _configurationProvider | ||
|
||
override val httpClient: HttpClient | ||
get() = _httpClient | ||
|
||
/** A [BaseXapClient] builder. */ | ||
@Suppress("unused", "UnnecessaryAbstractClass") // This is used by the generated SDK clients. | ||
abstract class Builder<SELF : Builder<SELF>> : Client.Builder<SELF>() | ||
} |
Oops, something went wrong.