-
Notifications
You must be signed in to change notification settings - Fork 585
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(clients): change runtime config from constant to provider functi…
…ons (#2574) * chore: update codegen to make runtime config functional * feat(clients): change runtime config from constant to functional * chore: use inline nullish coalescing instead of helper * feat(clients): use inline nullish coalescing * feat(clients): set configs not modeled in runtimeConfig * test: fix codegen test
- Loading branch information
1 parent
e643735
commit 5eca565
Showing
1,387 changed files
with
19,284 additions
and
16,526 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
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
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 |
---|---|---|
@@ -1,12 +1,16 @@ | ||
import { Sha256 } from "@aws-crypto/sha256-js"; | ||
import { ClientDefaults } from "./AccessAnalyzerClient"; | ||
import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser"; | ||
import { AccessAnalyzerClientConfig } from "./AccessAnalyzerClient"; | ||
import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export const ClientDefaultValues: Required<ClientDefaults> = { | ||
...BrowserDefaults, | ||
runtime: "react-native", | ||
sha256: Sha256, | ||
export const getRuntimeConfig = (config: AccessAnalyzerClientConfig) => { | ||
const browserDefaults = getBrowserRuntimeConfig(config); | ||
return { | ||
...browserDefaults, | ||
...config, | ||
runtime: "react-native", | ||
sha256: config.sha256 ?? Sha256, | ||
}; | ||
}; |
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 |
---|---|---|
@@ -1,15 +1,16 @@ | ||
import { defaultRegionInfoProvider } from "./endpoints"; | ||
import { Logger as __Logger } from "@aws-sdk/types"; | ||
import { parseUrl } from "@aws-sdk/url-parser"; | ||
import { AccessAnalyzerClientConfig } from "./AccessAnalyzerClient"; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export const ClientSharedValues = { | ||
export const getRuntimeConfig = (config: AccessAnalyzerClientConfig) => ({ | ||
apiVersion: "2019-11-01", | ||
disableHostPrefix: false, | ||
logger: {} as __Logger, | ||
regionInfoProvider: defaultRegionInfoProvider, | ||
serviceId: "AccessAnalyzer", | ||
urlParser: parseUrl, | ||
}; | ||
disableHostPrefix: config.disableHostPrefix ?? false, | ||
logger: config.logger ?? ({} as __Logger), | ||
regionInfoProvider: config.regionInfoProvider ?? defaultRegionInfoProvider, | ||
serviceId: config.serviceId ?? "AccessAnalyzer", | ||
urlParser: config.urlParser ?? parseUrl, | ||
}); |
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
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
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
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 |
---|---|---|
@@ -1,12 +1,16 @@ | ||
import { Sha256 } from "@aws-crypto/sha256-js"; | ||
import { ClientDefaults } from "./ACMPCAClient"; | ||
import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser"; | ||
import { ACMPCAClientConfig } from "./ACMPCAClient"; | ||
import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export const ClientDefaultValues: Required<ClientDefaults> = { | ||
...BrowserDefaults, | ||
runtime: "react-native", | ||
sha256: Sha256, | ||
export const getRuntimeConfig = (config: ACMPCAClientConfig) => { | ||
const browserDefaults = getBrowserRuntimeConfig(config); | ||
return { | ||
...browserDefaults, | ||
...config, | ||
runtime: "react-native", | ||
sha256: config.sha256 ?? Sha256, | ||
}; | ||
}; |
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 |
---|---|---|
@@ -1,15 +1,16 @@ | ||
import { defaultRegionInfoProvider } from "./endpoints"; | ||
import { Logger as __Logger } from "@aws-sdk/types"; | ||
import { parseUrl } from "@aws-sdk/url-parser"; | ||
import { ACMPCAClientConfig } from "./ACMPCAClient"; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export const ClientSharedValues = { | ||
export const getRuntimeConfig = (config: ACMPCAClientConfig) => ({ | ||
apiVersion: "2017-08-22", | ||
disableHostPrefix: false, | ||
logger: {} as __Logger, | ||
regionInfoProvider: defaultRegionInfoProvider, | ||
serviceId: "ACM PCA", | ||
urlParser: parseUrl, | ||
}; | ||
disableHostPrefix: config.disableHostPrefix ?? false, | ||
logger: config.logger ?? ({} as __Logger), | ||
regionInfoProvider: config.regionInfoProvider ?? defaultRegionInfoProvider, | ||
serviceId: config.serviceId ?? "ACM PCA", | ||
urlParser: config.urlParser ?? parseUrl, | ||
}); |
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
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
Oops, something went wrong.