@aws-sdk/client-migrationhub-config 3.310.0 → 3.312.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,30 +6,21 @@ const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const MigrationHubConfigServiceException_1 = require("../models/MigrationHubConfigServiceException");
7
7
  const models_0_1 = require("../models/models_0");
8
8
  const se_CreateHomeRegionControlCommand = async (input, context) => {
9
- const headers = {
10
- "content-type": "application/x-amz-json-1.1",
11
- "x-amz-target": "AWSMigrationHubMultiAccountService.CreateHomeRegionControl",
12
- };
9
+ const headers = sharedHeaders("CreateHomeRegionControl");
13
10
  let body;
14
11
  body = JSON.stringify(se_CreateHomeRegionControlRequest(input, context));
15
12
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
16
13
  };
17
14
  exports.se_CreateHomeRegionControlCommand = se_CreateHomeRegionControlCommand;
18
15
  const se_DescribeHomeRegionControlsCommand = async (input, context) => {
19
- const headers = {
20
- "content-type": "application/x-amz-json-1.1",
21
- "x-amz-target": "AWSMigrationHubMultiAccountService.DescribeHomeRegionControls",
22
- };
16
+ const headers = sharedHeaders("DescribeHomeRegionControls");
23
17
  let body;
24
18
  body = JSON.stringify(se_DescribeHomeRegionControlsRequest(input, context));
25
19
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
26
20
  };
27
21
  exports.se_DescribeHomeRegionControlsCommand = se_DescribeHomeRegionControlsCommand;
28
22
  const se_GetHomeRegionCommand = async (input, context) => {
29
- const headers = {
30
- "content-type": "application/x-amz-json-1.1",
31
- "x-amz-target": "AWSMigrationHubMultiAccountService.GetHomeRegion",
32
- };
23
+ const headers = sharedHeaders("GetHomeRegion");
33
24
  let body;
34
25
  body = JSON.stringify(se_GetHomeRegionRequest(input, context));
35
26
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
@@ -360,6 +351,12 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
360
351
  }
361
352
  return new protocol_http_1.HttpRequest(contents);
362
353
  };
354
+ function sharedHeaders(operation) {
355
+ return {
356
+ "content-type": "application/x-amz-json-1.1",
357
+ "x-amz-target": `AWSMigrationHubMultiAccountService.${operation}`,
358
+ };
359
+ }
363
360
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
364
361
  if (encoded.length) {
365
362
  return JSON.parse(encoded);
@@ -3,28 +3,19 @@ import { decorateServiceException as __decorateServiceException, expectInt32 as
3
3
  import { MigrationHubConfigServiceException as __BaseException } from "../models/MigrationHubConfigServiceException";
4
4
  import { AccessDeniedException, DryRunOperation, InternalServerError, InvalidInputException, ServiceUnavailableException, ThrottlingException, } from "../models/models_0";
5
5
  export const se_CreateHomeRegionControlCommand = async (input, context) => {
6
- const headers = {
7
- "content-type": "application/x-amz-json-1.1",
8
- "x-amz-target": "AWSMigrationHubMultiAccountService.CreateHomeRegionControl",
9
- };
6
+ const headers = sharedHeaders("CreateHomeRegionControl");
10
7
  let body;
11
8
  body = JSON.stringify(se_CreateHomeRegionControlRequest(input, context));
12
9
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
10
  };
14
11
  export const se_DescribeHomeRegionControlsCommand = async (input, context) => {
15
- const headers = {
16
- "content-type": "application/x-amz-json-1.1",
17
- "x-amz-target": "AWSMigrationHubMultiAccountService.DescribeHomeRegionControls",
18
- };
12
+ const headers = sharedHeaders("DescribeHomeRegionControls");
19
13
  let body;
20
14
  body = JSON.stringify(se_DescribeHomeRegionControlsRequest(input, context));
21
15
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
16
  };
23
17
  export const se_GetHomeRegionCommand = async (input, context) => {
24
- const headers = {
25
- "content-type": "application/x-amz-json-1.1",
26
- "x-amz-target": "AWSMigrationHubMultiAccountService.GetHomeRegion",
27
- };
18
+ const headers = sharedHeaders("GetHomeRegion");
28
19
  let body;
29
20
  body = JSON.stringify(se_GetHomeRegionRequest(input, context));
30
21
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
@@ -351,6 +342,12 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
351
342
  }
352
343
  return new __HttpRequest(contents);
353
344
  };
345
+ function sharedHeaders(operation) {
346
+ return {
347
+ "content-type": "application/x-amz-json-1.1",
348
+ "x-amz-target": `AWSMigrationHubMultiAccountService.${operation}`,
349
+ };
350
+ }
354
351
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
355
352
  if (encoded.length) {
356
353
  return JSON.parse(encoded);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-migrationhub-config",
3
3
  "description": "AWS SDK for JavaScript Migrationhub Config Client for Node.js, Browser and React Native",
4
- "version": "3.310.0",
4
+ "version": "3.312.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@aws-crypto/sha256-browser": "3.0.0",
23
23
  "@aws-crypto/sha256-js": "3.0.0",
24
- "@aws-sdk/client-sts": "3.310.0",
24
+ "@aws-sdk/client-sts": "3.312.0",
25
25
  "@aws-sdk/config-resolver": "3.310.0",
26
26
  "@aws-sdk/credential-provider-node": "3.310.0",
27
27
  "@aws-sdk/fetch-http-handler": "3.310.0",