Skip to content

Commit fa5bbbe

Browse files
anssari1github-actions[bot]
authored andcommitted
chore: Publish v0.0.17-SNAPSHOT
1 parent bc743b3 commit fa5bbbe

File tree

324 files changed

+38111
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

324 files changed

+38111
-0
lines changed

code/LICENSE-HEADER.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright (C) 2022 Expedia, Inc.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

code/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Welcome to the xap-sdk SDK!
2+
3+
## Usage
4+
```xml
5+
<dependency>
6+
<groupId>com.expediagroup</groupId>
7+
<artifactId>xap-sdk</artifactId>
8+
<version>0.0.17-SNAPSHOT</version>
9+
</dependency>
10+
```
11+
12+
## License
13+
14+
This project is licensed under the Apache License v2.0 - see the [LICENSE](LICENSE) for details.

code/pom.xml

Lines changed: 874 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* Copyright (C) 2022 Expedia, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.expediagroup.sdk.core.client
17+
18+
import com.expediagroup.sdk.core.configuration.RapidClientConfiguration
19+
import com.expediagroup.sdk.core.configuration.collector.ConfigurationCollector
20+
import com.expediagroup.sdk.core.configuration.provider.ConfigurationProvider
21+
import com.expediagroup.sdk.core.configuration.provider.RapidConfigurationProvider
22+
import com.expediagroup.sdk.core.plugin.authentication.strategy.AuthenticationStrategy
23+
import io.ktor.client.HttpClient
24+
import io.ktor.client.engine.HttpClientEngine
25+
26+
/**
27+
* The integration point between the SDK Core and the product SDKs.
28+
*
29+
* @param httpClientEngine The HTTP client engine to use.
30+
* @param clientConfiguration The configuration for the client.
31+
*/
32+
abstract class BaseRapidClient(
33+
namespace: String,
34+
clientConfiguration: RapidClientConfiguration,
35+
httpClientEngine: HttpClientEngine = DEFAULT_HTTP_CLIENT_ENGINE
36+
) : Client(namespace) {
37+
private val _configurationProvider: ConfigurationProvider =
38+
ConfigurationCollector.create(
39+
clientConfiguration.toProvider(),
40+
RapidConfigurationProvider
41+
)
42+
private val _httpClient: HttpClient = buildHttpClient(_configurationProvider, AuthenticationStrategy.AuthenticationType.SIGNATURE, httpClientEngine)
43+
44+
init {
45+
finalize()
46+
}
47+
48+
override val configurationProvider: ConfigurationProvider
49+
get() = _configurationProvider
50+
51+
override val httpClient: HttpClient
52+
get() = _httpClient
53+
54+
/** A [BaseRapidClient] builder. */
55+
@Suppress("unused", "UnnecessaryAbstractClass") // This is used by the generated SDK clients.
56+
abstract class Builder<SELF : Builder<SELF>> : Client.Builder<SELF>()
57+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* Copyright (C) 2022 Expedia, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.expediagroup.sdk.core.client
17+
18+
import com.expediagroup.sdk.core.configuration.XapClientConfiguration
19+
import com.expediagroup.sdk.core.configuration.collector.ConfigurationCollector
20+
import com.expediagroup.sdk.core.configuration.provider.ConfigurationProvider
21+
import com.expediagroup.sdk.core.configuration.provider.XapConfigurationProvider
22+
import com.expediagroup.sdk.core.plugin.authentication.strategy.AuthenticationStrategy
23+
import io.ktor.client.HttpClient
24+
import io.ktor.client.engine.HttpClientEngine
25+
26+
/**
27+
* The integration point between the SDK Core and the product SDKs.
28+
*
29+
* @param httpClientEngine The HTTP client engine to use.
30+
* @param clientConfiguration The configuration for the client.
31+
*/
32+
abstract class BaseXapClient(
33+
namespace: String,
34+
clientConfiguration: XapClientConfiguration,
35+
httpClientEngine: HttpClientEngine = DEFAULT_HTTP_CLIENT_ENGINE
36+
) : Client(namespace) {
37+
private val _configurationProvider: ConfigurationProvider =
38+
ConfigurationCollector.create(
39+
clientConfiguration.toProvider(),
40+
XapConfigurationProvider
41+
)
42+
private val _httpClient: HttpClient = buildHttpClient(_configurationProvider, AuthenticationStrategy.AuthenticationType.BASIC, httpClientEngine)
43+
44+
init {
45+
finalize()
46+
}
47+
48+
override val configurationProvider: ConfigurationProvider
49+
get() = _configurationProvider
50+
51+
override val httpClient: HttpClient
52+
get() = _httpClient
53+
54+
/** A [BaseXapClient] builder. */
55+
@Suppress("unused", "UnnecessaryAbstractClass") // This is used by the generated SDK clients.
56+
abstract class Builder<SELF : Builder<SELF>> : Client.Builder<SELF>()
57+
}

0 commit comments

Comments
 (0)