"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/index.ts
var src_exports = {};
__export(src_exports, {
  AccessDeniedException: () => AccessDeniedException,
  CloudFrontKeyValueStore: () => CloudFrontKeyValueStore,
  CloudFrontKeyValueStoreClient: () => CloudFrontKeyValueStoreClient,
  CloudFrontKeyValueStoreServiceException: () => CloudFrontKeyValueStoreServiceException,
  ConflictException: () => ConflictException,
  DeleteKeyCommand: () => DeleteKeyCommand,
  DescribeKeyValueStoreCommand: () => DescribeKeyValueStoreCommand,
  GetKeyCommand: () => GetKeyCommand,
  GetKeyResponseFilterSensitiveLog: () => GetKeyResponseFilterSensitiveLog,
  InternalServerException: () => InternalServerException,
  ListKeysCommand: () => ListKeysCommand,
  ListKeysResponseFilterSensitiveLog: () => ListKeysResponseFilterSensitiveLog,
  ListKeysResponseListItemFilterSensitiveLog: () => ListKeysResponseListItemFilterSensitiveLog,
  PutKeyCommand: () => PutKeyCommand,
  PutKeyRequestFilterSensitiveLog: () => PutKeyRequestFilterSensitiveLog,
  PutKeyRequestListItemFilterSensitiveLog: () => PutKeyRequestListItemFilterSensitiveLog,
  ResourceNotFoundException: () => ResourceNotFoundException,
  ServiceQuotaExceededException: () => ServiceQuotaExceededException,
  UpdateKeysCommand: () => UpdateKeysCommand,
  UpdateKeysRequestFilterSensitiveLog: () => UpdateKeysRequestFilterSensitiveLog,
  ValidationException: () => ValidationException,
  __Client: () => import_smithy_client.Client,
  paginateListKeys: () => paginateListKeys
});
module.exports = __toCommonJS(src_exports);

// src/CloudFrontKeyValueStoreClient.ts
var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
var import_middleware_logger = require("@aws-sdk/middleware-logger");
var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
var import_middleware_signing = require("@aws-sdk/middleware-signing");
var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
var import_config_resolver = require("@smithy/config-resolver");
var import_middleware_content_length = require("@smithy/middleware-content-length");
var import_middleware_endpoint = require("@smithy/middleware-endpoint");
var import_middleware_retry = require("@smithy/middleware-retry");


// src/endpoint/EndpointParameters.ts
var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
  return {
    ...options,
    useFipsEndpoint: options.useFipsEndpoint ?? false,
    defaultSigningName: "cloudfront-keyvaluestore"
  };
}, "resolveClientEndpointParameters");
var commonParams = {
  UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
  Endpoint: { type: "builtInParams", name: "endpoint" },
  Region: { type: "builtInParams", name: "region" }
};

// src/CloudFrontKeyValueStoreClient.ts
var import_runtimeConfig = require("././runtimeConfig");

// src/runtimeExtensions.ts
var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
var import_protocol_http = require("@smithy/protocol-http");
var import_smithy_client = require("@smithy/smithy-client");
var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
  const extensionConfiguration = {
    ...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
    ...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
    ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig))
  };
  extensions.forEach((extension) => extension.configure(extensionConfiguration));
  return {
    ...runtimeConfig,
    ...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
    ...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
    ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration)
  };
}, "resolveRuntimeExtensions");

// src/CloudFrontKeyValueStoreClient.ts
var _CloudFrontKeyValueStoreClient = class _CloudFrontKeyValueStoreClient extends import_smithy_client.Client {
  constructor(...[configuration]) {
    const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
    const _config_1 = resolveClientEndpointParameters(_config_0);
    const _config_2 = (0, import_config_resolver.resolveRegionConfig)(_config_1);
    const _config_3 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_2);
    const _config_4 = (0, import_middleware_retry.resolveRetryConfig)(_config_3);
    const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
    const _config_6 = (0, import_middleware_signing.resolveAwsAuthConfig)(_config_5);
    const _config_7 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_6);
    const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []);
    super(_config_8);
    this.config = _config_8;
    this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
    this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
    this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
    this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
    this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
    this.middlewareStack.use((0, import_middleware_signing.getAwsAuthPlugin)(this.config));
    this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
  }
  /**
   * Destroy underlying resources, like sockets. It's usually not necessary to do this.
   * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
   * Otherwise, sockets might stay open for quite a long time before the server terminates them.
   */
  destroy() {
    super.destroy();
  }
};
__name(_CloudFrontKeyValueStoreClient, "CloudFrontKeyValueStoreClient");
var CloudFrontKeyValueStoreClient = _CloudFrontKeyValueStoreClient;

// src/CloudFrontKeyValueStore.ts


// src/commands/DeleteKeyCommand.ts

var import_middleware_serde = require("@smithy/middleware-serde");

var import_types = require("@smithy/types");

// src/protocols/Aws_restJson1.ts
var import_core = require("@smithy/core");


// src/models/CloudFrontKeyValueStoreServiceException.ts

var _CloudFrontKeyValueStoreServiceException = class _CloudFrontKeyValueStoreServiceException extends import_smithy_client.ServiceException {
  /**
   * @internal
   */
  constructor(options) {
    super(options);
    Object.setPrototypeOf(this, _CloudFrontKeyValueStoreServiceException.prototype);
  }
};
__name(_CloudFrontKeyValueStoreServiceException, "CloudFrontKeyValueStoreServiceException");
var CloudFrontKeyValueStoreServiceException = _CloudFrontKeyValueStoreServiceException;

// src/models/models_0.ts

var _AccessDeniedException = class _AccessDeniedException extends CloudFrontKeyValueStoreServiceException {
  /**
   * @internal
   */
  constructor(opts) {
    super({
      name: "AccessDeniedException",
      $fault: "client",
      ...opts
    });
    this.name = "AccessDeniedException";
    this.$fault = "client";
    Object.setPrototypeOf(this, _AccessDeniedException.prototype);
    this.Message = opts.Message;
  }
};
__name(_AccessDeniedException, "AccessDeniedException");
var AccessDeniedException = _AccessDeniedException;
var _ConflictException = class _ConflictException extends CloudFrontKeyValueStoreServiceException {
  /**
   * @internal
   */
  constructor(opts) {
    super({
      name: "ConflictException",
      $fault: "client",
      ...opts
    });
    this.name = "ConflictException";
    this.$fault = "client";
    Object.setPrototypeOf(this, _ConflictException.prototype);
    this.Message = opts.Message;
  }
};
__name(_ConflictException, "ConflictException");
var ConflictException = _ConflictException;
var _InternalServerException = class _InternalServerException extends CloudFrontKeyValueStoreServiceException {
  /**
   * @internal
   */
  constructor(opts) {
    super({
      name: "InternalServerException",
      $fault: "server",
      ...opts
    });
    this.name = "InternalServerException";
    this.$fault = "server";
    Object.setPrototypeOf(this, _InternalServerException.prototype);
    this.Message = opts.Message;
  }
};
__name(_InternalServerException, "InternalServerException");
var InternalServerException = _InternalServerException;
var _ResourceNotFoundException = class _ResourceNotFoundException extends CloudFrontKeyValueStoreServiceException {
  /**
   * @internal
   */
  constructor(opts) {
    super({
      name: "ResourceNotFoundException",
      $fault: "client",
      ...opts
    });
    this.name = "ResourceNotFoundException";
    this.$fault = "client";
    Object.setPrototypeOf(this, _ResourceNotFoundException.prototype);
    this.Message = opts.Message;
  }
};
__name(_ResourceNotFoundException, "ResourceNotFoundException");
var ResourceNotFoundException = _ResourceNotFoundException;
var _ServiceQuotaExceededException = class _ServiceQuotaExceededException extends CloudFrontKeyValueStoreServiceException {
  /**
   * @internal
   */
  constructor(opts) {
    super({
      name: "ServiceQuotaExceededException",
      $fault: "client",
      ...opts
    });
    this.name = "ServiceQuotaExceededException";
    this.$fault = "client";
    Object.setPrototypeOf(this, _ServiceQuotaExceededException.prototype);
    this.Message = opts.Message;
  }
};
__name(_ServiceQuotaExceededException, "ServiceQuotaExceededException");
var ServiceQuotaExceededException = _ServiceQuotaExceededException;
var _ValidationException = class _ValidationException extends CloudFrontKeyValueStoreServiceException {
  /**
   * @internal
   */
  constructor(opts) {
    super({
      name: "ValidationException",
      $fault: "client",
      ...opts
    });
    this.name = "ValidationException";
    this.$fault = "client";
    Object.setPrototypeOf(this, _ValidationException.prototype);
    this.Message = opts.Message;
  }
};
__name(_ValidationException, "ValidationException");
var ValidationException = _ValidationException;
var GetKeyResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
  ...obj,
  ...obj.Value && { Value: import_smithy_client.SENSITIVE_STRING }
}), "GetKeyResponseFilterSensitiveLog");
var ListKeysResponseListItemFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
  ...obj,
  ...obj.Value && { Value: import_smithy_client.SENSITIVE_STRING }
}), "ListKeysResponseListItemFilterSensitiveLog");
var ListKeysResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
  ...obj,
  ...obj.Items && { Items: obj.Items.map((item) => ListKeysResponseListItemFilterSensitiveLog(item)) }
}), "ListKeysResponseFilterSensitiveLog");
var PutKeyRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
  ...obj,
  ...obj.Value && { Value: import_smithy_client.SENSITIVE_STRING }
}), "PutKeyRequestFilterSensitiveLog");
var PutKeyRequestListItemFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
  ...obj,
  ...obj.Value && { Value: import_smithy_client.SENSITIVE_STRING }
}), "PutKeyRequestListItemFilterSensitiveLog");
var UpdateKeysRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
  ...obj,
  ...obj.Puts && { Puts: obj.Puts.map((item) => PutKeyRequestListItemFilterSensitiveLog(item)) }
}), "UpdateKeysRequestFilterSensitiveLog");

// src/protocols/Aws_restJson1.ts
var se_DeleteKeyCommand = /* @__PURE__ */ __name(async (input, context) => {
  const b = (0, import_core.requestBuilder)(input, context);
  const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
    [_im]: input[_IM]
  });
  b.bp("/key-value-stores/{KvsARN}/keys/{Key}");
  b.p("KvsARN", () => input.KvsARN, "{KvsARN}", false);
  b.p("Key", () => input.Key, "{Key}", false);
  let body;
  b.m("DELETE").h(headers).b(body);
  return b.build();
}, "se_DeleteKeyCommand");
var se_DescribeKeyValueStoreCommand = /* @__PURE__ */ __name(async (input, context) => {
  const b = (0, import_core.requestBuilder)(input, context);
  const headers = {};
  b.bp("/key-value-stores/{KvsARN}");
  b.p("KvsARN", () => input.KvsARN, "{KvsARN}", false);
  let body;
  b.m("GET").h(headers).b(body);
  return b.build();
}, "se_DescribeKeyValueStoreCommand");
var se_GetKeyCommand = /* @__PURE__ */ __name(async (input, context) => {
  const b = (0, import_core.requestBuilder)(input, context);
  const headers = {};
  b.bp("/key-value-stores/{KvsARN}/keys/{Key}");
  b.p("KvsARN", () => input.KvsARN, "{KvsARN}", false);
  b.p("Key", () => input.Key, "{Key}", false);
  let body;
  b.m("GET").h(headers).b(body);
  return b.build();
}, "se_GetKeyCommand");
var se_ListKeysCommand = /* @__PURE__ */ __name(async (input, context) => {
  const b = (0, import_core.requestBuilder)(input, context);
  const headers = {};
  b.bp("/key-value-stores/{KvsARN}/keys");
  b.p("KvsARN", () => input.KvsARN, "{KvsARN}", false);
  const query = (0, import_smithy_client.map)({
    [_NT]: [, input[_NT]],
    [_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()]
  });
  let body;
  b.m("GET").h(headers).q(query).b(body);
  return b.build();
}, "se_ListKeysCommand");
var se_PutKeyCommand = /* @__PURE__ */ __name(async (input, context) => {
  const b = (0, import_core.requestBuilder)(input, context);
  const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
    "content-type": "application/json",
    [_im]: input[_IM]
  });
  b.bp("/key-value-stores/{KvsARN}/keys/{Key}");
  b.p("Key", () => input.Key, "{Key}", false);
  b.p("KvsARN", () => input.KvsARN, "{KvsARN}", false);
  let body;
  body = JSON.stringify(
    (0, import_smithy_client.take)(input, {
      Value: []
    })
  );
  b.m("PUT").h(headers).b(body);
  return b.build();
}, "se_PutKeyCommand");
var se_UpdateKeysCommand = /* @__PURE__ */ __name(async (input, context) => {
  const b = (0, import_core.requestBuilder)(input, context);
  const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
    "content-type": "application/json",
    [_im]: input[_IM]
  });
  b.bp("/key-value-stores/{KvsARN}/keys");
  b.p("KvsARN", () => input.KvsARN, "{KvsARN}", false);
  let body;
  body = JSON.stringify(
    (0, import_smithy_client.take)(input, {
      Deletes: (_) => (0, import_smithy_client._json)(_),
      Puts: (_) => (0, import_smithy_client._json)(_)
    })
  );
  b.m("POST").h(headers).b(body);
  return b.build();
}, "se_UpdateKeysCommand");
var de_DeleteKeyCommand = /* @__PURE__ */ __name(async (output, context) => {
  if (output.statusCode !== 200 && output.statusCode >= 300) {
    return de_CommandError(output, context);
  }
  const contents = (0, import_smithy_client.map)({
    $metadata: deserializeMetadata(output),
    [_ET]: [, output.headers[_e]]
  });
  const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
  const doc = (0, import_smithy_client.take)(data, {
    ItemCount: import_smithy_client.expectInt32,
    TotalSizeInBytes: import_smithy_client.expectLong
  });
  Object.assign(contents, doc);
  return contents;
}, "de_DeleteKeyCommand");
var de_DescribeKeyValueStoreCommand = /* @__PURE__ */ __name(async (output, context) => {
  if (output.statusCode !== 200 && output.statusCode >= 300) {
    return de_CommandError(output, context);
  }
  const contents = (0, import_smithy_client.map)({
    $metadata: deserializeMetadata(output),
    [_ET]: [, output.headers[_e]]
  });
  const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
  const doc = (0, import_smithy_client.take)(data, {
    Created: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
    FailureReason: import_smithy_client.expectString,
    ItemCount: import_smithy_client.expectInt32,
    KvsARN: import_smithy_client.expectString,
    LastModified: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
    Status: import_smithy_client.expectString,
    TotalSizeInBytes: import_smithy_client.expectLong
  });
  Object.assign(contents, doc);
  return contents;
}, "de_DescribeKeyValueStoreCommand");
var de_GetKeyCommand = /* @__PURE__ */ __name(async (output, context) => {
  if (output.statusCode !== 200 && output.statusCode >= 300) {
    return de_CommandError(output, context);
  }
  const contents = (0, import_smithy_client.map)({
    $metadata: deserializeMetadata(output)
  });
  const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
  const doc = (0, import_smithy_client.take)(data, {
    ItemCount: import_smithy_client.expectInt32,
    Key: import_smithy_client.expectString,
    TotalSizeInBytes: import_smithy_client.expectLong,
    Value: import_smithy_client.expectString
  });
  Object.assign(contents, doc);
  return contents;
}, "de_GetKeyCommand");
var de_ListKeysCommand = /* @__PURE__ */ __name(async (output, context) => {
  if (output.statusCode !== 200 && output.statusCode >= 300) {
    return de_CommandError(output, context);
  }
  const contents = (0, import_smithy_client.map)({
    $metadata: deserializeMetadata(output)
  });
  const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
  const doc = (0, import_smithy_client.take)(data, {
    Items: import_smithy_client._json,
    NextToken: import_smithy_client.expectString
  });
  Object.assign(contents, doc);
  return contents;
}, "de_ListKeysCommand");
var de_PutKeyCommand = /* @__PURE__ */ __name(async (output, context) => {
  if (output.statusCode !== 200 && output.statusCode >= 300) {
    return de_CommandError(output, context);
  }
  const contents = (0, import_smithy_client.map)({
    $metadata: deserializeMetadata(output),
    [_ET]: [, output.headers[_e]]
  });
  const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
  const doc = (0, import_smithy_client.take)(data, {
    ItemCount: import_smithy_client.expectInt32,
    TotalSizeInBytes: import_smithy_client.expectLong
  });
  Object.assign(contents, doc);
  return contents;
}, "de_PutKeyCommand");
var de_UpdateKeysCommand = /* @__PURE__ */ __name(async (output, context) => {
  if (output.statusCode !== 200 && output.statusCode >= 300) {
    return de_CommandError(output, context);
  }
  const contents = (0, import_smithy_client.map)({
    $metadata: deserializeMetadata(output),
    [_ET]: [, output.headers[_e]]
  });
  const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
  const doc = (0, import_smithy_client.take)(data, {
    ItemCount: import_smithy_client.expectInt32,
    TotalSizeInBytes: import_smithy_client.expectLong
  });
  Object.assign(contents, doc);
  return contents;
}, "de_UpdateKeysCommand");
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
  const parsedOutput = {
    ...output,
    body: await parseErrorBody(output.body, context)
  };
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
  switch (errorCode) {
    case "AccessDeniedException":
    case "com.amazonaws.cloudfrontkeyvaluestore#AccessDeniedException":
      throw await de_AccessDeniedExceptionRes(parsedOutput, context);
    case "ConflictException":
    case "com.amazonaws.cloudfrontkeyvaluestore#ConflictException":
      throw await de_ConflictExceptionRes(parsedOutput, context);
    case "InternalServerException":
    case "com.amazonaws.cloudfrontkeyvaluestore#InternalServerException":
      throw await de_InternalServerExceptionRes(parsedOutput, context);
    case "ResourceNotFoundException":
    case "com.amazonaws.cloudfrontkeyvaluestore#ResourceNotFoundException":
      throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
    case "ServiceQuotaExceededException":
    case "com.amazonaws.cloudfrontkeyvaluestore#ServiceQuotaExceededException":
      throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
    case "ValidationException":
    case "com.amazonaws.cloudfrontkeyvaluestore#ValidationException":
      throw await de_ValidationExceptionRes(parsedOutput, context);
    default:
      const parsedBody = parsedOutput.body;
      return throwDefaultError({
        output,
        parsedBody,
        errorCode
      });
  }
}, "de_CommandError");
var throwDefaultError = (0, import_smithy_client.withBaseException)(CloudFrontKeyValueStoreServiceException);
var de_AccessDeniedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
  const contents = (0, import_smithy_client.map)({});
  const data = parsedOutput.body;
  const doc = (0, import_smithy_client.take)(data, {
    Message: import_smithy_client.expectString
  });
  Object.assign(contents, doc);
  const exception = new AccessDeniedException({
    $metadata: deserializeMetadata(parsedOutput),
    ...contents
  });
  return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_AccessDeniedExceptionRes");
var de_ConflictExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
  const contents = (0, import_smithy_client.map)({});
  const data = parsedOutput.body;
  const doc = (0, import_smithy_client.take)(data, {
    Message: import_smithy_client.expectString
  });
  Object.assign(contents, doc);
  const exception = new ConflictException({
    $metadata: deserializeMetadata(parsedOutput),
    ...contents
  });
  return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_ConflictExceptionRes");
var de_InternalServerExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
  const contents = (0, import_smithy_client.map)({});
  const data = parsedOutput.body;
  const doc = (0, import_smithy_client.take)(data, {
    Message: import_smithy_client.expectString
  });
  Object.assign(contents, doc);
  const exception = new InternalServerException({
    $metadata: deserializeMetadata(parsedOutput),
    ...contents
  });
  return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_InternalServerExceptionRes");
var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
  const contents = (0, import_smithy_client.map)({});
  const data = parsedOutput.body;
  const doc = (0, import_smithy_client.take)(data, {
    Message: import_smithy_client.expectString
  });
  Object.assign(contents, doc);
  const exception = new ResourceNotFoundException({
    $metadata: deserializeMetadata(parsedOutput),
    ...contents
  });
  return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_ResourceNotFoundExceptionRes");
var de_ServiceQuotaExceededExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
  const contents = (0, import_smithy_client.map)({});
  const data = parsedOutput.body;
  const doc = (0, import_smithy_client.take)(data, {
    Message: import_smithy_client.expectString
  });
  Object.assign(contents, doc);
  const exception = new ServiceQuotaExceededException({
    $metadata: deserializeMetadata(parsedOutput),
    ...contents
  });
  return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_ServiceQuotaExceededExceptionRes");
var de_ValidationExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
  const contents = (0, import_smithy_client.map)({});
  const data = parsedOutput.body;
  const doc = (0, import_smithy_client.take)(data, {
    Message: import_smithy_client.expectString
  });
  Object.assign(contents, doc);
  const exception = new ValidationException({
    $metadata: deserializeMetadata(parsedOutput),
    ...contents
  });
  return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_ValidationExceptionRes");
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 collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
var isSerializableHeaderValue = /* @__PURE__ */ __name((value) => value !== void 0 && value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0), "isSerializableHeaderValue");
var _ET = "ETag";
var _IM = "IfMatch";
var _MR = "MaxResults";
var _NT = "NextToken";
var _e = "etag";
var _im = "if-match";
var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
  if (encoded.length) {
    return JSON.parse(encoded);
  }
  return {};
}), "parseBody");
var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
  const value = await parseBody(errorBody, context);
  value.message = value.message ?? value.Message;
  return value;
}, "parseErrorBody");
var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
  const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
  const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
    let cleanValue = rawValue;
    if (typeof cleanValue === "number") {
      cleanValue = cleanValue.toString();
    }
    if (cleanValue.indexOf(",") >= 0) {
      cleanValue = cleanValue.split(",")[0];
    }
    if (cleanValue.indexOf(":") >= 0) {
      cleanValue = cleanValue.split(":")[0];
    }
    if (cleanValue.indexOf("#") >= 0) {
      cleanValue = cleanValue.split("#")[1];
    }
    return cleanValue;
  }, "sanitizeErrorCode");
  const headerKey = findKey(output.headers, "x-amzn-errortype");
  if (headerKey !== void 0) {
    return sanitizeErrorCode(output.headers[headerKey]);
  }
  if (data.code !== void 0) {
    return sanitizeErrorCode(data.code);
  }
  if (data["__type"] !== void 0) {
    return sanitizeErrorCode(data["__type"]);
  }
}, "loadRestJsonErrorCode");

// src/commands/DeleteKeyCommand.ts
var _DeleteKeyCommand = class _DeleteKeyCommand extends import_smithy_client.Command.classBuilder().ep({
  ...commonParams,
  KvsARN: { type: "contextParams", name: "KvsARN" }
}).m(function(Command, cs, config, o) {
  return [
    (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
    (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
  ];
}).s("CloudFrontKeyValueStore", "DeleteKey", {}).n("CloudFrontKeyValueStoreClient", "DeleteKeyCommand").f(void 0, void 0).ser(se_DeleteKeyCommand).de(de_DeleteKeyCommand).build() {
};
__name(_DeleteKeyCommand, "DeleteKeyCommand");
var DeleteKeyCommand = _DeleteKeyCommand;

// src/commands/DescribeKeyValueStoreCommand.ts




var _DescribeKeyValueStoreCommand = class _DescribeKeyValueStoreCommand extends import_smithy_client.Command.classBuilder().ep({
  ...commonParams,
  KvsARN: { type: "contextParams", name: "KvsARN" }
}).m(function(Command, cs, config, o) {
  return [
    (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
    (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
  ];
}).s("CloudFrontKeyValueStore", "DescribeKeyValueStore", {}).n("CloudFrontKeyValueStoreClient", "DescribeKeyValueStoreCommand").f(void 0, void 0).ser(se_DescribeKeyValueStoreCommand).de(de_DescribeKeyValueStoreCommand).build() {
};
__name(_DescribeKeyValueStoreCommand, "DescribeKeyValueStoreCommand");
var DescribeKeyValueStoreCommand = _DescribeKeyValueStoreCommand;

// src/commands/GetKeyCommand.ts




var _GetKeyCommand = class _GetKeyCommand extends import_smithy_client.Command.classBuilder().ep({
  ...commonParams,
  KvsARN: { type: "contextParams", name: "KvsARN" }
}).m(function(Command, cs, config, o) {
  return [
    (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
    (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
  ];
}).s("CloudFrontKeyValueStore", "GetKey", {}).n("CloudFrontKeyValueStoreClient", "GetKeyCommand").f(void 0, GetKeyResponseFilterSensitiveLog).ser(se_GetKeyCommand).de(de_GetKeyCommand).build() {
};
__name(_GetKeyCommand, "GetKeyCommand");
var GetKeyCommand = _GetKeyCommand;

// src/commands/ListKeysCommand.ts




var _ListKeysCommand = class _ListKeysCommand extends import_smithy_client.Command.classBuilder().ep({
  ...commonParams,
  KvsARN: { type: "contextParams", name: "KvsARN" }
}).m(function(Command, cs, config, o) {
  return [
    (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
    (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
  ];
}).s("CloudFrontKeyValueStore", "ListKeys", {}).n("CloudFrontKeyValueStoreClient", "ListKeysCommand").f(void 0, ListKeysResponseFilterSensitiveLog).ser(se_ListKeysCommand).de(de_ListKeysCommand).build() {
};
__name(_ListKeysCommand, "ListKeysCommand");
var ListKeysCommand = _ListKeysCommand;

// src/commands/PutKeyCommand.ts




var _PutKeyCommand = class _PutKeyCommand extends import_smithy_client.Command.classBuilder().ep({
  ...commonParams,
  KvsARN: { type: "contextParams", name: "KvsARN" }
}).m(function(Command, cs, config, o) {
  return [
    (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
    (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
  ];
}).s("CloudFrontKeyValueStore", "PutKey", {}).n("CloudFrontKeyValueStoreClient", "PutKeyCommand").f(PutKeyRequestFilterSensitiveLog, void 0).ser(se_PutKeyCommand).de(de_PutKeyCommand).build() {
};
__name(_PutKeyCommand, "PutKeyCommand");
var PutKeyCommand = _PutKeyCommand;

// src/commands/UpdateKeysCommand.ts




var _UpdateKeysCommand = class _UpdateKeysCommand extends import_smithy_client.Command.classBuilder().ep({
  ...commonParams,
  KvsARN: { type: "contextParams", name: "KvsARN" }
}).m(function(Command, cs, config, o) {
  return [
    (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
    (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
  ];
}).s("CloudFrontKeyValueStore", "UpdateKeys", {}).n("CloudFrontKeyValueStoreClient", "UpdateKeysCommand").f(UpdateKeysRequestFilterSensitiveLog, void 0).ser(se_UpdateKeysCommand).de(de_UpdateKeysCommand).build() {
};
__name(_UpdateKeysCommand, "UpdateKeysCommand");
var UpdateKeysCommand = _UpdateKeysCommand;

// src/CloudFrontKeyValueStore.ts
var commands = {
  DeleteKeyCommand,
  DescribeKeyValueStoreCommand,
  GetKeyCommand,
  ListKeysCommand,
  PutKeyCommand,
  UpdateKeysCommand
};
var _CloudFrontKeyValueStore = class _CloudFrontKeyValueStore extends CloudFrontKeyValueStoreClient {
};
__name(_CloudFrontKeyValueStore, "CloudFrontKeyValueStore");
var CloudFrontKeyValueStore = _CloudFrontKeyValueStore;
(0, import_smithy_client.createAggregatedClient)(commands, CloudFrontKeyValueStore);

// src/pagination/ListKeysPaginator.ts

var paginateListKeys = (0, import_core.createPaginator)(CloudFrontKeyValueStoreClient, ListKeysCommand, "NextToken", "NextToken", "MaxResults");

// src/index.ts
var import_util_endpoints = require("@aws-sdk/util-endpoints");
// Annotate the CommonJS export names for ESM import in node:

0 && (module.exports = {
  CloudFrontKeyValueStoreServiceException,
  __Client,
  CloudFrontKeyValueStoreClient,
  CloudFrontKeyValueStore,
  $Command,
  DeleteKeyCommand,
  DescribeKeyValueStoreCommand,
  GetKeyCommand,
  ListKeysCommand,
  PutKeyCommand,
  UpdateKeysCommand,
  paginateListKeys,
  AccessDeniedException,
  ConflictException,
  InternalServerException,
  ResourceNotFoundException,
  ServiceQuotaExceededException,
  ValidationException,
  GetKeyResponseFilterSensitiveLog,
  ListKeysResponseListItemFilterSensitiveLog,
  ListKeysResponseFilterSensitiveLog,
  PutKeyRequestFilterSensitiveLog,
  PutKeyRequestListItemFilterSensitiveLog,
  UpdateKeysRequestFilterSensitiveLog
});

