import { requestBuilder } from './TNPXNMQM.js';
import { NoAuthSigner } from './GZ7KTF4Q.js';
import { parseJsonBody, parseJsonErrorBody, loadRestJsonErrorCode } from './WDAYI6EQ.js';
import { EndpointCache, awsEndpointFunctions, customEndpointFunctions, resolveUserAgentConfig, resolveRetryConfig, resolveRegionConfig, resolveHostHeaderConfig, resolveEndpointConfig, getUserAgentPlugin, getRetryPlugin, getContentLengthPlugin, getHostHeaderPlugin, getLoggerPlugin, getRecursionDetectionPlugin, getHttpAuthSchemeEndpointRuleSetPlugin, DefaultIdentityProviderConfig, getHttpSigningPlugin, getSerdePlugin, getEndpointPlugin, resolveDefaultsModeConfig, emitWarningIfUnsupportedVersion as emitWarningIfUnsupportedVersion$1, Hash, createDefaultUserAgentProvider, calculateBodyLength, NODE_APP_ID_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS, DEFAULT_RETRY_MODE, NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, resolveAwsSdkSigV4Config, normalizeProvider, getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, getSmithyContext, AwsSdkSigV4Signer, resolveEndpoint } from './TXDLSUBD.js';
import { Client, ServiceException, withBaseException, Command, emitWarningIfUnsupportedVersion, streamCollector, NodeHttpHandler, getDefaultExtensionConfiguration, getHttpHandlerExtensionConfiguration, resolveDefaultRuntimeConfig, resolveHttpHandlerRuntimeConfig, SENSITIVE_STRING, map, isSerializableHeaderValue, expectNonNull, expectObject, take, _json, NoOpLogger, toBase64, fromBase64, loadConfigsForDefaultMode, expectString, decorateServiceException } from './4Q36MQI5.js';
import { toUtf8, fromUtf8 } from './LMCIXUBF.js';
import './NDUVZQ7S.js';
import { loadConfig, parseUrl } from './VLSIEZLM.js';
import './ELFNCT57.js';
import './OH4A2VLX.js';
import './TTKDG2NN.js';
import { init_esm_shims, __name } from './4RNWLMHM.js';

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.879.0/node_modules/@aws-sdk/credential-provider-sso/dist-es/loadSso.js
init_esm_shims();

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/SSOClient.js
init_esm_shims();

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/auth/httpAuthSchemeProvider.js
init_esm_shims();
var defaultSSOHttpAuthSchemeParametersProvider = /* @__PURE__ */ __name(async (config, context, input) => {
  return {
    operation: getSmithyContext(context).operation,
    region: await normalizeProvider(config.region)() || (() => {
      throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
    })()
  };
}, "defaultSSOHttpAuthSchemeParametersProvider");
function createAwsAuthSigv4HttpAuthOption(authParameters) {
  return {
    schemeId: "aws.auth#sigv4",
    signingProperties: {
      name: "awsssoportal",
      region: authParameters.region
    },
    propertiesExtractor: /* @__PURE__ */ __name((config, context) => ({
      signingProperties: {
        config,
        context
      }
    }), "propertiesExtractor")
  };
}
__name(createAwsAuthSigv4HttpAuthOption, "createAwsAuthSigv4HttpAuthOption");
function createSmithyApiNoAuthHttpAuthOption(authParameters) {
  return {
    schemeId: "smithy.api#noAuth"
  };
}
__name(createSmithyApiNoAuthHttpAuthOption, "createSmithyApiNoAuthHttpAuthOption");
var defaultSSOHttpAuthSchemeProvider = /* @__PURE__ */ __name((authParameters) => {
  const options = [];
  switch (authParameters.operation) {
    case "GetRoleCredentials": {
      options.push(createSmithyApiNoAuthHttpAuthOption());
      break;
    }
    case "ListAccountRoles": {
      options.push(createSmithyApiNoAuthHttpAuthOption());
      break;
    }
    case "ListAccounts": {
      options.push(createSmithyApiNoAuthHttpAuthOption());
      break;
    }
    case "Logout": {
      options.push(createSmithyApiNoAuthHttpAuthOption());
      break;
    }
    default: {
      options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
    }
  }
  return options;
}, "defaultSSOHttpAuthSchemeProvider");
var resolveHttpAuthSchemeConfig = /* @__PURE__ */ __name((config) => {
  const config_0 = resolveAwsSdkSigV4Config(config);
  return Object.assign(config_0, {
    authSchemePreference: normalizeProvider(config.authSchemePreference ?? [])
  });
}, "resolveHttpAuthSchemeConfig");

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/endpoint/EndpointParameters.js
init_esm_shims();
var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
  return Object.assign(options, {
    useDualstackEndpoint: options.useDualstackEndpoint ?? false,
    useFipsEndpoint: options.useFipsEndpoint ?? false,
    defaultSigningName: "awsssoportal"
  });
}, "resolveClientEndpointParameters");
var commonParams = {
  UseFIPS: {
    type: "builtInParams",
    name: "useFipsEndpoint"
  },
  Endpoint: {
    type: "builtInParams",
    name: "endpoint"
  },
  Region: {
    type: "builtInParams",
    name: "region"
  },
  UseDualStack: {
    type: "builtInParams",
    name: "useDualstackEndpoint"
  }
};

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.js
init_esm_shims();

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/package.json
var package_default = {
  version: "3.879.0"};

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.shared.js
init_esm_shims();

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/endpoint/endpointResolver.js
init_esm_shims();

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/endpoint/ruleset.js
init_esm_shims();
var u = "required";
var v = "fn";
var w = "argv";
var x = "ref";
var a = true;
var b = "isSet";
var c = "booleanEquals";
var d = "error";
var e = "endpoint";
var f = "tree";
var g = "PartitionResult";
var h = "getAttr";
var i = {
  [u]: false,
  "type": "String"
};
var j = {
  [u]: true,
  "default": false,
  "type": "Boolean"
};
var k = {
  [x]: "Endpoint"
};
var l = {
  [v]: c,
  [w]: [
    {
      [x]: "UseFIPS"
    },
    true
  ]
};
var m = {
  [v]: c,
  [w]: [
    {
      [x]: "UseDualStack"
    },
    true
  ]
};
var n = {};
var o = {
  [v]: h,
  [w]: [
    {
      [x]: g
    },
    "supportsFIPS"
  ]
};
var p = {
  [x]: g
};
var q = {
  [v]: c,
  [w]: [
    true,
    {
      [v]: h,
      [w]: [
        p,
        "supportsDualStack"
      ]
    }
  ]
};
var r = [
  l
];
var s = [
  m
];
var t = [
  {
    [x]: "Region"
  }
];
var _data = {
  version: "1.0",
  parameters: {
    Region: i,
    UseDualStack: j,
    UseFIPS: j,
    Endpoint: i
  },
  rules: [
    {
      conditions: [
        {
          [v]: b,
          [w]: [
            k
          ]
        }
      ],
      rules: [
        {
          conditions: r,
          error: "Invalid Configuration: FIPS and custom endpoint are not supported",
          type: d
        },
        {
          conditions: s,
          error: "Invalid Configuration: Dualstack and custom endpoint are not supported",
          type: d
        },
        {
          endpoint: {
            url: k,
            properties: n,
            headers: n
          },
          type: e
        }
      ],
      type: f
    },
    {
      conditions: [
        {
          [v]: b,
          [w]: t
        }
      ],
      rules: [
        {
          conditions: [
            {
              [v]: "aws.partition",
              [w]: t,
              assign: g
            }
          ],
          rules: [
            {
              conditions: [
                l,
                m
              ],
              rules: [
                {
                  conditions: [
                    {
                      [v]: c,
                      [w]: [
                        a,
                        o
                      ]
                    },
                    q
                  ],
                  rules: [
                    {
                      endpoint: {
                        url: "https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",
                        properties: n,
                        headers: n
                      },
                      type: e
                    }
                  ],
                  type: f
                },
                {
                  error: "FIPS and DualStack are enabled, but this partition does not support one or both",
                  type: d
                }
              ],
              type: f
            },
            {
              conditions: r,
              rules: [
                {
                  conditions: [
                    {
                      [v]: c,
                      [w]: [
                        o,
                        a
                      ]
                    }
                  ],
                  rules: [
                    {
                      conditions: [
                        {
                          [v]: "stringEquals",
                          [w]: [
                            {
                              [v]: h,
                              [w]: [
                                p,
                                "name"
                              ]
                            },
                            "aws-us-gov"
                          ]
                        }
                      ],
                      endpoint: {
                        url: "https://portal.sso.{Region}.amazonaws.com",
                        properties: n,
                        headers: n
                      },
                      type: e
                    },
                    {
                      endpoint: {
                        url: "https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",
                        properties: n,
                        headers: n
                      },
                      type: e
                    }
                  ],
                  type: f
                },
                {
                  error: "FIPS is enabled but this partition does not support FIPS",
                  type: d
                }
              ],
              type: f
            },
            {
              conditions: s,
              rules: [
                {
                  conditions: [
                    q
                  ],
                  rules: [
                    {
                      endpoint: {
                        url: "https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",
                        properties: n,
                        headers: n
                      },
                      type: e
                    }
                  ],
                  type: f
                },
                {
                  error: "DualStack is enabled but this partition does not support DualStack",
                  type: d
                }
              ],
              type: f
            },
            {
              endpoint: {
                url: "https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",
                properties: n,
                headers: n
              },
              type: e
            }
          ],
          type: f
        }
      ],
      type: f
    },
    {
      error: "Invalid Configuration: Missing Region",
      type: d
    }
  ]
};
var ruleSet = _data;

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/endpoint/endpointResolver.js
var cache = new EndpointCache({
  size: 50,
  params: [
    "Endpoint",
    "Region",
    "UseDualStack",
    "UseFIPS"
  ]
});
var defaultEndpointResolver = /* @__PURE__ */ __name((endpointParams, context = {}) => {
  return cache.get(endpointParams, () => resolveEndpoint(ruleSet, {
    endpointParams,
    logger: context.logger
  }));
}, "defaultEndpointResolver");
customEndpointFunctions.aws = awsEndpointFunctions;

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.shared.js
var getRuntimeConfig = /* @__PURE__ */ __name((config) => {
  return {
    apiVersion: "2019-06-10",
    base64Decoder: config?.base64Decoder ?? fromBase64,
    base64Encoder: config?.base64Encoder ?? toBase64,
    disableHostPrefix: config?.disableHostPrefix ?? false,
    endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
    extensions: config?.extensions ?? [],
    httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSSOHttpAuthSchemeProvider,
    httpAuthSchemes: config?.httpAuthSchemes ?? [
      {
        schemeId: "aws.auth#sigv4",
        identityProvider: /* @__PURE__ */ __name((ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), "identityProvider"),
        signer: new AwsSdkSigV4Signer()
      },
      {
        schemeId: "smithy.api#noAuth",
        identityProvider: /* @__PURE__ */ __name((ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), "identityProvider"),
        signer: new NoAuthSigner()
      }
    ],
    logger: config?.logger ?? new NoOpLogger(),
    serviceId: config?.serviceId ?? "SSO",
    urlParser: config?.urlParser ?? parseUrl,
    utf8Decoder: config?.utf8Decoder ?? fromUtf8,
    utf8Encoder: config?.utf8Encoder ?? toUtf8
  };
}, "getRuntimeConfig");

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.js
var getRuntimeConfig2 = /* @__PURE__ */ __name((config) => {
  emitWarningIfUnsupportedVersion(process.version);
  const defaultsMode = resolveDefaultsModeConfig(config);
  const defaultConfigProvider = /* @__PURE__ */ __name(() => defaultsMode().then(loadConfigsForDefaultMode), "defaultConfigProvider");
  const clientSharedValues = getRuntimeConfig(config);
  emitWarningIfUnsupportedVersion$1(process.version);
  const loaderConfig = {
    profile: config?.profile,
    logger: clientSharedValues.logger
  };
  return {
    ...clientSharedValues,
    ...config,
    runtime: "node",
    defaultsMode,
    authSchemePreference: config?.authSchemePreference ?? loadConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
    bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
    defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({
      serviceId: clientSharedValues.serviceId,
      clientVersion: package_default.version
    }),
    maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
    region: config?.region ?? loadConfig(NODE_REGION_CONFIG_OPTIONS, {
      ...NODE_REGION_CONFIG_FILE_OPTIONS,
      ...loaderConfig
    }),
    requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
    retryMode: config?.retryMode ?? loadConfig({
      ...NODE_RETRY_MODE_CONFIG_OPTIONS,
      default: /* @__PURE__ */ __name(async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, "default")
    }, config),
    sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
    streamCollector: config?.streamCollector ?? streamCollector,
    useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
    useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
    userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig)
  };
}, "getRuntimeConfig");

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeExtensions.js
init_esm_shims();

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/auth/httpAuthExtensionConfiguration.js
init_esm_shims();
var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
  const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
  let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
  let _credentials = runtimeConfig.credentials;
  return {
    setHttpAuthScheme(httpAuthScheme) {
      const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
      if (index === -1) {
        _httpAuthSchemes.push(httpAuthScheme);
      } else {
        _httpAuthSchemes.splice(index, 1, httpAuthScheme);
      }
    },
    httpAuthSchemes() {
      return _httpAuthSchemes;
    },
    setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
      _httpAuthSchemeProvider = httpAuthSchemeProvider;
    },
    httpAuthSchemeProvider() {
      return _httpAuthSchemeProvider;
    },
    setCredentials(credentials) {
      _credentials = credentials;
    },
    credentials() {
      return _credentials;
    }
  };
}, "getHttpAuthExtensionConfiguration");
var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
  return {
    httpAuthSchemes: config.httpAuthSchemes(),
    httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
    credentials: config.credentials()
  };
}, "resolveHttpAuthRuntimeConfig");

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeExtensions.js
var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
  const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
  extensions.forEach((extension) => extension.configure(extensionConfiguration));
  return Object.assign(runtimeConfig, resolveAwsRegionExtensionConfiguration(extensionConfiguration), resolveDefaultRuntimeConfig(extensionConfiguration), resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
}, "resolveRuntimeExtensions");

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/SSOClient.js
var SSOClient = class extends Client {
  static {
    __name(this, "SSOClient");
  }
  config;
  constructor(...[configuration]) {
    const _config_0 = getRuntimeConfig2(configuration || {});
    super(_config_0);
    this.initConfig = _config_0;
    const _config_1 = resolveClientEndpointParameters(_config_0);
    const _config_2 = resolveUserAgentConfig(_config_1);
    const _config_3 = resolveRetryConfig(_config_2);
    const _config_4 = resolveRegionConfig(_config_3);
    const _config_5 = resolveHostHeaderConfig(_config_4);
    const _config_6 = resolveEndpointConfig(_config_5);
    const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
    const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
    this.config = _config_8;
    this.middlewareStack.use(getUserAgentPlugin(this.config));
    this.middlewareStack.use(getRetryPlugin(this.config));
    this.middlewareStack.use(getContentLengthPlugin(this.config));
    this.middlewareStack.use(getHostHeaderPlugin(this.config));
    this.middlewareStack.use(getLoggerPlugin(this.config));
    this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
    this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
      httpAuthSchemeParametersProvider: defaultSSOHttpAuthSchemeParametersProvider,
      identityProviderConfigProvider: /* @__PURE__ */ __name(async (config) => new DefaultIdentityProviderConfig({
        "aws.auth#sigv4": config.credentials
      }), "identityProviderConfigProvider")
    }));
    this.middlewareStack.use(getHttpSigningPlugin(this.config));
  }
  destroy() {
    super.destroy();
  }
};

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/commands/GetRoleCredentialsCommand.js
init_esm_shims();

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/models/models_0.js
init_esm_shims();

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/models/SSOServiceException.js
init_esm_shims();
var SSOServiceException = class _SSOServiceException extends ServiceException {
  static {
    __name(this, "SSOServiceException");
  }
  constructor(options) {
    super(options);
    Object.setPrototypeOf(this, _SSOServiceException.prototype);
  }
};

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/models/models_0.js
var InvalidRequestException = class _InvalidRequestException extends SSOServiceException {
  static {
    __name(this, "InvalidRequestException");
  }
  name = "InvalidRequestException";
  $fault = "client";
  constructor(opts) {
    super({
      name: "InvalidRequestException",
      $fault: "client",
      ...opts
    });
    Object.setPrototypeOf(this, _InvalidRequestException.prototype);
  }
};
var ResourceNotFoundException = class _ResourceNotFoundException extends SSOServiceException {
  static {
    __name(this, "ResourceNotFoundException");
  }
  name = "ResourceNotFoundException";
  $fault = "client";
  constructor(opts) {
    super({
      name: "ResourceNotFoundException",
      $fault: "client",
      ...opts
    });
    Object.setPrototypeOf(this, _ResourceNotFoundException.prototype);
  }
};
var TooManyRequestsException = class _TooManyRequestsException extends SSOServiceException {
  static {
    __name(this, "TooManyRequestsException");
  }
  name = "TooManyRequestsException";
  $fault = "client";
  constructor(opts) {
    super({
      name: "TooManyRequestsException",
      $fault: "client",
      ...opts
    });
    Object.setPrototypeOf(this, _TooManyRequestsException.prototype);
  }
};
var UnauthorizedException = class _UnauthorizedException extends SSOServiceException {
  static {
    __name(this, "UnauthorizedException");
  }
  name = "UnauthorizedException";
  $fault = "client";
  constructor(opts) {
    super({
      name: "UnauthorizedException",
      $fault: "client",
      ...opts
    });
    Object.setPrototypeOf(this, _UnauthorizedException.prototype);
  }
};
var GetRoleCredentialsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
  ...obj,
  ...obj.accessToken && {
    accessToken: SENSITIVE_STRING
  }
}), "GetRoleCredentialsRequestFilterSensitiveLog");
var RoleCredentialsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
  ...obj,
  ...obj.secretAccessKey && {
    secretAccessKey: SENSITIVE_STRING
  },
  ...obj.sessionToken && {
    sessionToken: SENSITIVE_STRING
  }
}), "RoleCredentialsFilterSensitiveLog");
var GetRoleCredentialsResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
  ...obj,
  ...obj.roleCredentials && {
    roleCredentials: RoleCredentialsFilterSensitiveLog(obj.roleCredentials)
  }
}), "GetRoleCredentialsResponseFilterSensitiveLog");

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/protocols/Aws_restJson1.js
init_esm_shims();
var se_GetRoleCredentialsCommand = /* @__PURE__ */ __name(async (input, context) => {
  const b2 = requestBuilder(input, context);
  const headers = map({}, isSerializableHeaderValue, {
    [_xasbt]: input[_aT]
  });
  b2.bp("/federation/credentials");
  const query = map({
    [_rn]: [
      ,
      expectNonNull(input[_rN], `roleName`)
    ],
    [_ai]: [
      ,
      expectNonNull(input[_aI], `accountId`)
    ]
  });
  let body;
  b2.m("GET").h(headers).q(query).b(body);
  return b2.build();
}, "se_GetRoleCredentialsCommand");
var de_GetRoleCredentialsCommand = /* @__PURE__ */ __name(async (output, context) => {
  if (output.statusCode !== 200 && output.statusCode >= 300) {
    return de_CommandError(output, context);
  }
  const contents = map({
    $metadata: deserializeMetadata(output)
  });
  const data = expectNonNull(expectObject(await parseJsonBody(output.body, context)), "body");
  const doc = take(data, {
    roleCredentials: _json
  });
  Object.assign(contents, doc);
  return contents;
}, "de_GetRoleCredentialsCommand");
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
  const parsedOutput = {
    ...output,
    body: await parseJsonErrorBody(output.body, context)
  };
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
  switch (errorCode) {
    case "InvalidRequestException":
    case "com.amazonaws.sso#InvalidRequestException":
      throw await de_InvalidRequestExceptionRes(parsedOutput, context);
    case "ResourceNotFoundException":
    case "com.amazonaws.sso#ResourceNotFoundException":
      throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
    case "TooManyRequestsException":
    case "com.amazonaws.sso#TooManyRequestsException":
      throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
    case "UnauthorizedException":
    case "com.amazonaws.sso#UnauthorizedException":
      throw await de_UnauthorizedExceptionRes(parsedOutput, context);
    default:
      const parsedBody = parsedOutput.body;
      return throwDefaultError({
        output,
        parsedBody,
        errorCode
      });
  }
}, "de_CommandError");
var throwDefaultError = withBaseException(SSOServiceException);
var de_InvalidRequestExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
  const contents = map({});
  const data = parsedOutput.body;
  const doc = take(data, {
    message: expectString
  });
  Object.assign(contents, doc);
  const exception = new InvalidRequestException({
    $metadata: deserializeMetadata(parsedOutput),
    ...contents
  });
  return decorateServiceException(exception, parsedOutput.body);
}, "de_InvalidRequestExceptionRes");
var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
  const contents = map({});
  const data = parsedOutput.body;
  const doc = take(data, {
    message: expectString
  });
  Object.assign(contents, doc);
  const exception = new ResourceNotFoundException({
    $metadata: deserializeMetadata(parsedOutput),
    ...contents
  });
  return decorateServiceException(exception, parsedOutput.body);
}, "de_ResourceNotFoundExceptionRes");
var de_TooManyRequestsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
  const contents = map({});
  const data = parsedOutput.body;
  const doc = take(data, {
    message: expectString
  });
  Object.assign(contents, doc);
  const exception = new TooManyRequestsException({
    $metadata: deserializeMetadata(parsedOutput),
    ...contents
  });
  return decorateServiceException(exception, parsedOutput.body);
}, "de_TooManyRequestsExceptionRes");
var de_UnauthorizedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
  const contents = map({});
  const data = parsedOutput.body;
  const doc = take(data, {
    message: expectString
  });
  Object.assign(contents, doc);
  const exception = new UnauthorizedException({
    $metadata: deserializeMetadata(parsedOutput),
    ...contents
  });
  return decorateServiceException(exception, parsedOutput.body);
}, "de_UnauthorizedExceptionRes");
var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
  httpStatusCode: output.statusCode,
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
  extendedRequestId: output.headers["x-amz-id-2"],
  cfId: output.headers["x-amz-cf-id"]
}), "deserializeMetadata");
var _aI = "accountId";
var _aT = "accessToken";
var _ai = "account_id";
var _rN = "roleName";
var _rn = "role_name";
var _xasbt = "x-amz-sso_bearer_token";

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/commands/GetRoleCredentialsCommand.js
var GetRoleCredentialsCommand = class extends Command.classBuilder().ep(commonParams).m(function(Command2, cs, config, o2) {
  return [
    getSerdePlugin(config, this.serialize, this.deserialize),
    getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
  ];
}).s("SWBPortalService", "GetRoleCredentials", {}).n("SSOClient", "GetRoleCredentialsCommand").f(GetRoleCredentialsRequestFilterSensitiveLog, GetRoleCredentialsResponseFilterSensitiveLog).ser(se_GetRoleCredentialsCommand).de(de_GetRoleCredentialsCommand).build() {
  static {
    __name(this, "GetRoleCredentialsCommand");
  }
};

export { GetRoleCredentialsCommand, SSOClient };
//# sourceMappingURL=GLJJOBCM.js.map
//# sourceMappingURL=GLJJOBCM.js.map