Skip to content

Commit

Permalink
feat(core): Core 2.0.0 (#137)
Browse files Browse the repository at this point in the history
- 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
mohnoor94 authored Feb 16, 2023
1 parent 11cf7ee commit e20d87c
Show file tree
Hide file tree
Showing 104 changed files with 568 additions and 1,424 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<artifactId>openworld-java-sdk-core</artifactId>
<name>EG Open World SDK :: Core</name>
<description>Core Modules of EG Travel SDK</description>
<version>1.0.0</version>
<version>2.0.0</version>
<inceptionYear>2022</inceptionYear>
<url>https://github.com/ExpediaGroup/openworld-sdk-java-core</url>

Expand Down Expand Up @@ -427,7 +427,7 @@

<exclude>**/authentication/AuthenticationConfiguration*</exclude>
<exclude>**/authentication/AuthenticationPlugin*</exclude>
<exclude>**/authentication/strategy/TokenResponse*</exclude>
<exclude>**/authentication/strategy/OpenWorldAuthenticationStrategy*</exclude>
<exclude>**/authentication/AuthenticationHook*</exclude>
<exclude>**/authentication/AuthenticationPlugin*</exclude>

Expand Down
133 changes: 0 additions & 133 deletions src/main/kotlin/com/expediagroup/common/sdk/core/client/Client.kt

This file was deleted.

This file was deleted.

This file was deleted.

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>()
}
Loading

0 comments on commit e20d87c

Please sign in to comment.