remove(item: CompletedQuery) {
    if (this.current === item) this.current = undefined;
    const index = this.history.findIndex((i) => i === item);
    if (index >= 0) {
      this.history.splice(index, 1);
      if (this.current === undefined && this.history.length > 0) {
        // Try to keep a current item, near the deleted item if there
        // are any available.
        this.current = this.history[Math.min(index, this.history.length - 1)];
      }
      this.refresh();
    }
  }


refresh(completedQuery?: CompletedQuery) {
    this._onDidChangeTreeData.fire(completedQuery);
  }


find(queryId: number): CompletedQuery | undefined {
    return this.allHistory.find((query) => query.query.queryID === queryId);
  }


provideTextDocumentContent(
        uri: vscode.Uri
      ): vscode.ProviderResult<string> {
        const params = new URLSearchParams(uri.query);

        return (
          (JSON.parse(params.get('isQuickEval') || '')
            ? SHOW_QUERY_TEXT_QUICK_EVAL_MSG
            : SHOW_QUERY_TEXT_MSG) + params.get('queryText')
        );
      }


async invokeCallbackOn(queryHistoryItem: CompletedQuery) {
    if (this.selectedCallback !== undefined) {
      const sc = this.selectedCallback;
      await sc(queryHistoryItem);
    }
  }


async handleOpenQuery(
    singleItem: CompletedQuery,
    multiSelect: CompletedQuery[]
  ): Promise<void> {
    const { finalSingleItem, finalMultiSelect } = this.determineSelection(singleItem, multiSelect);
    if (!this.assertSingleQuery(finalMultiSelect)) {
      return;
    }

    if (!finalSingleItem) {
      throw new Error(NO_QUERY_SELECTED);
    }

    const textDocument = await vscode.workspace.openTextDocument(
      vscode.Uri.file(finalSingleItem.query.program.queryPath)
    );
    const editor = await vscode.window.showTextDocument(
      textDocument,
      vscode.ViewColumn.One
    );
    const queryText = finalSingleItem.options.queryText;
    if (queryText !== undefined && finalSingleItem.options.isQuickQuery) {
      await editor.edit((edit) =>
        edit.replace(
          textDocument.validateRange(
            new vscode.Range(0, 0, textDocument.lineCount, 0)
          ),
          queryText
        )
      );
    }
  }


async handleRemoveHistoryItem(
    singleItem: CompletedQuery,
    multiSelect: CompletedQuery[]
  ) {
    const { finalSingleItem, finalMultiSelect } = this.determineSelection(singleItem, multiSelect);

    (finalMultiSelect || [finalSingleItem]).forEach((item) => {
      this.treeDataProvider.remove(item);
      item.dispose();
    });
    const current = this.treeDataProvider.getCurrent();
    if (current !== undefined) {
      this.treeView.reveal(current);
      await this.invokeCallbackOn(current);
    }
  }


async handleSetLabel(
    singleItem: CompletedQuery,
    multiSelect: CompletedQuery[]
  ): Promise<void> {
    if (!this.assertSingleQuery(multiSelect)) {
      return;
    }

    const response = await vscode.window.showInputBox({
      prompt: 'Label:',
      placeHolder: '(use default)',
      value: singleItem.getLabel(),
    });
    // undefined response means the user cancelled the dialog; don't change anything
    if (response !== undefined) {
      // Interpret empty string response as 'go back to using default'
      singleItem.options.label = response === '' ? undefined : response;
      this.treeDataProvider.refresh(singleItem);
    }
  }


async handleCompareWith(
    singleItem: CompletedQuery,
    multiSelect: CompletedQuery[]
  ) {
    try {
      if (!singleItem.didRunSuccessfully) {
        throw new Error('Please select a successful query.');
      }

      const from = this.compareWithItem || singleItem;
      const to = await this.findOtherQueryToCompare(from, multiSelect);

      if (from && to) {
        this.doCompareCallback(from, to);
      }
    } catch (e) {
      showAndLogErrorMessage(e.message);
    }
  }


async handleItemClicked(
    singleItem: CompletedQuery,
    multiSelect: CompletedQuery[]
  ) {
    const { finalSingleItem, finalMultiSelect } = this.determineSelection(singleItem, multiSelect);
    if (!this.assertSingleQuery(finalMultiSelect)) {
      return;
    }

    if (!finalSingleItem) {
      throw new Error(NO_QUERY_SELECTED);
    }

    this.treeDataProvider.setCurrentItem(finalSingleItem);

    const now = new Date();
    const prevItemClick = this.lastItemClick;
    this.lastItemClick = { time: now, item: finalSingleItem };

    if (
      prevItemClick !== undefined &&
      now.valueOf() - prevItemClick.time.valueOf() < DOUBLE_CLICK_TIME &&
      singleItem == prevItemClick.item
    ) {
      // show original query file on double click
      await this.handleOpenQuery(singleItem, [singleItem]);
    } else {
      // show results on single click
      await this.invokeCallbackOn(singleItem);
    }
  }


async handleShowQueryLog(
    singleItem: CompletedQuery,
    multiSelect: CompletedQuery[]
  ) {
    if (!this.assertSingleQuery(multiSelect)) {
      return;
    }

    if (singleItem.logFileLocation) {
      await this.tryOpenExternalFile(singleItem.logFileLocation);
    } else {
      showAndLogWarningMessage('No log file available');
    }
  }


async handleShowQueryText(
    singleItem: CompletedQuery,
    multiSelect: CompletedQuery[]
  ) {
    if (!this.assertSingleQuery(multiSelect)) {
      return;
    }

    if (!singleItem) {
      throw new Error(NO_QUERY_SELECTED);
    }

    const queryName = singleItem.queryName.endsWith('.ql')
      ? singleItem.queryName
      : singleItem.queryName + '.ql';
    const params = new URLSearchParams({
      isQuickEval: String(!!singleItem.query.quickEvalPosition),
      queryText: encodeURIComponent(await this.getQueryText(singleItem)),
    });
    const uri = vscode.Uri.parse(
      `codeql:${singleItem.query.queryID}-${queryName}?${params.toString()}`, true
    );
    const doc = await vscode.workspace.openTextDocument(uri);
    await vscode.window.showTextDocument(doc, { preview: false });
  }


async handleViewSarif(
    singleItem: CompletedQuery,
    multiSelect: CompletedQuery[]
  ) {
    if (!this.assertSingleQuery(multiSelect)) {
      return;
    }

    const hasInterpretedResults = await singleItem.query.canHaveInterpretedResults();
    if (hasInterpretedResults) {
      await this.tryOpenExternalFile(
        singleItem.query.resultsPaths.interpretedResultsPath
      );
    } else {
      const label = singleItem.getLabel();
      showAndLogInformationMessage(
        `Query ${label} has no interpreted results.`
      );
    }
  }


async handleViewDil(
    singleItem: CompletedQuery,
    multiSelect: CompletedQuery[],
  ) {
    if (!this.assertSingleQuery(multiSelect)) {
      return;
    }

    await this.tryOpenExternalFile(
      await singleItem.query.ensureDilPath(this.qs)
    );
  }


async getQueryText(queryHistoryItem: CompletedQuery): Promise<string> {
    if (queryHistoryItem.options.queryText) {
      return queryHistoryItem.options.queryText;
    } else if (queryHistoryItem.query.quickEvalPosition) {
      // capture all selected lines
      const startLine = queryHistoryItem.query.quickEvalPosition.line;
      const endLine = queryHistoryItem.query.quickEvalPosition.endLine;
      const textDocument = await vscode.workspace.openTextDocument(
        queryHistoryItem.query.quickEvalPosition.fileName
      );
      return textDocument.getText(
        new vscode.Range(startLine - 1, 0, endLine, 0)
      );
    } else {
      return '';
    }
  }


addQuery(info: QueryWithResults): CompletedQuery {
    const item = new CompletedQuery(info, this.queryHistoryConfigListener);
    this.treeDataProvider.pushQuery(item);
    this.updateTreeViewSelectionIfVisible();
    return item;
  }


find(queryId: number): CompletedQuery | undefined {
    return this.treeDataProvider.find(queryId);
  }


/**
   * Update the tree view selection if the tree view is visible.
   *
   * If the tree view is not visible, we must wait until it becomes visible before updating the
   * selection. This is because the only mechanism for updating the selection of the tree view
   * has the side-effect of revealing the tree view. This changes the active sidebar to CodeQL,
   * interrupting user workflows such as writing a commit message on the source control sidebar.
   */
private updateTreeViewSelectionIfVisible() {
    if (this.treeView.visible) {
      const current = this.treeDataProvider.getCurrent();
      if (current != undefined) {
        // We must fire the onDidChangeTreeData event to ensure the current element can be selected
        // using `reveal` if the tree view was not visible when the current element was added.
        this.treeDataProvider.refresh();
        this.treeView.reveal(current);
      }
    }
  }


private async tryOpenExternalFile(fileLocation: string) {
    const uri = vscode.Uri.file(fileLocation);
    try {
      await vscode.window.showTextDocument(uri, { preview: false });
    } catch (e) {
      if (
        e.message.includes(
          'Files above 50MB cannot be synchronized with extensions'
        ) ||
        e.message.includes('too large to open')
      ) {
        const res = await showBinaryChoiceDialog(
          `VS Code does not allow extensions to open files >50MB. This file
exceeds that limit. Do you want to open it outside of VS Code?

You can also try manually opening it inside VS Code by selecting
the file in the file explorer and dragging it into the workspace.`
        );
        if (res) {
          try {
            await vscode.commands.executeCommand('revealFileInOS', uri);
          } catch (e) {
            showAndLogErrorMessage(e.message);
          }
        }
      } else {
        showAndLogErrorMessage(`Could not open file ${fileLocation}`);
        logger.log(e.message);
        logger.log(e.stack);
      }
    }
  }


private async findOtherQueryToCompare(
    singleItem: CompletedQuery,
    multiSelect: CompletedQuery[]
  ): Promise<CompletedQuery | undefined> {
    const dbName = singleItem.database.name;

    // if exactly 2 queries are selected, use those
    if (multiSelect?.length === 2) {
      // return the query that is not the first selected one
      const otherQuery =
        singleItem === multiSelect[0] ? multiSelect[1] : multiSelect[0];
      if (!otherQuery.didRunSuccessfully) {
        throw new Error('Please select a successful query.');
      }
      if (otherQuery.database.name !== dbName) {
        throw new Error('Query databases must be the same.');
      }
      return otherQuery;
    }

    if (multiSelect?.length > 1) {
      throw new Error('Please select no more than 2 queries.');
    }

    // otherwise, let the user choose
    const comparableQueryLabels = this.treeDataProvider.allHistory
      .filter(
        (otherQuery) =>
          otherQuery !== singleItem &&
          otherQuery.didRunSuccessfully &&
          otherQuery.database.name === dbName
      )
      .map((otherQuery) => ({
        label: otherQuery.toString(),
        description: otherQuery.databaseName,
        detail: otherQuery.statusString,
        query: otherQuery,
      }));
    if (comparableQueryLabels.length < 1) {
      throw new Error('No other queries available to compare with.');
    }
    const choice = await vscode.window.showQuickPick(comparableQueryLabels);
    return choice?.query;
  }


private assertSingleQuery(multiSelect: CompletedQuery[] = [], message = 'Please select a single query.') {
    if (multiSelect.length > 1) {
      showAndLogErrorMessage(
        message
      );
      return false;
    }
    return true;
  }


/**
   * Updates the compare with source query. This ensures that all compare command invocations
   * when exactly 2 queries are selected always have the proper _from_ query. Always use
   * compareWithItem as the _from_ query.
   *
   * The heuristic is this:
   *
   * 1. If selection is empty or has length > 2 delete compareWithItem.
   * 2. If selection is length 1, then set that item to compareWithItem.
   * 3. If selection is length 2, then make sure compareWithItem is one of the selected items
   *    if not, then delete compareWithItem. If it is then, do nothing.
   *
   * This ensures that compareWithItem is always the first item selected if there are only
   * two selected items.
   *
   * @param newSelection the new selection after the most recent selection change
   */
private updateCompareWith(newSelection: CompletedQuery[]) {
    if (newSelection.length === 1) {
      this.compareWithItem = newSelection[0];
    } else if (
      newSelection.length !== 2 ||
      !this.compareWithItem ||
      !newSelection.includes(this.compareWithItem)
    ) {
      this.compareWithItem = undefined;
    }
  }


/**
   * If no items are selected, attempt to grab the selection from the treeview.
   * We need to use this method because when clicking on commands from the view title
   * bar, the selections are not passed in.
   *
   * @param singleItem the single item selected, or undefined if no item is selected
   * @param multiSelect a multi-select or undefined if no items are selected
   */
private determineSelection(
    singleItem: CompletedQuery,
    multiSelect: CompletedQuery[]
  ): { finalSingleItem: CompletedQuery; finalMultiSelect: CompletedQuery[] } {
    if (singleItem === undefined && (multiSelect === undefined || multiSelect.length === 0 || multiSelect[0] === undefined)) {
      const selection = this.treeView.selection;
      if (selection) {
        return {
          finalSingleItem: selection[0],
          finalMultiSelect: selection
        };
      }
    }
    return {
      finalSingleItem: singleItem,
      finalMultiSelect: multiSelect
    };
  }


async refreshTreeView(completedQuery: CompletedQuery): Promise<void> {
    this.treeDataProvider.refresh(completedQuery);
  }


export default class extends Event {
  public constructor (client: Client) {
    super(client, {
      eventName: 'debug',
      name: 'clientDebug'
    })
  }

  public run (info: string): void {
    this.client.logger.debug(info)
  }
}


public run (info: string): void {
    this.client.logger.debug(info)
  }


/**
 *
Creates an Amazon Lightsail container service.

 *
 *
A Lightsail container service is a compute resource to which you can deploy containers.
 *       For more information, see Container services in Amazon Lightsail in the Lightsail Dev
 *         Guide.

 */
export class CreateContainerServiceCommand extends $Command<
  CreateContainerServiceCommandInput,
  CreateContainerServiceCommandOutput,
  LightsailClientResolvedConfig
> {
  // Start section: command_properties
  // End section: command_properties

  constructor(readonly input: CreateContainerServiceCommandInput) {
    // Start section: command_constructor
    super();
    // End section: command_constructor
  }

  /**
   * @internal
   */
  resolveMiddleware(
    clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
    configuration: LightsailClientResolvedConfig,
    options?: __HttpHandlerOptions
  ): Handler<CreateContainerServiceCommandInput, CreateContainerServiceCommandOutput> {
    this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

    const stack = clientStack.concat(this.middlewareStack);

    const { logger } = configuration;
    const clientName = "LightsailClient";
    const commandName = "CreateContainerServiceCommand";
    const handlerExecutionContext: HandlerExecutionContext = {
      logger,
      clientName,
      commandName,
      inputFilterSensitiveLog: CreateContainerServiceRequest.filterSensitiveLog,
      outputFilterSensitiveLog: CreateContainerServiceResult.filterSensitiveLog,
    };
    const { requestHandler } = configuration;
    return stack.resolve(
      (request: FinalizeHandlerArguments<any>) =>
        requestHandler.handle(request.request as __HttpRequest, options || {}),
      handlerExecutionContext
    );
  }

  private serialize(input: CreateContainerServiceCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
    return serializeAws_json1_1CreateContainerServiceCommand(input, context);
  }

  private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<CreateContainerServiceCommandOutput> {
    return deserializeAws_json1_1CreateContainerServiceCommand(output, context);
  }

  // Start section: command_body_extra
  // End section: command_body_extra
}


export interface CreateContainerServiceCommandInput extends CreateContainerServiceRequest {}


export interface CreateContainerServiceCommandOutput extends CreateContainerServiceResult, __MetadataBearer {}


/**
   * @internal
   */
resolveMiddleware(
    clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
    configuration: LightsailClientResolvedConfig,
    options?: __HttpHandlerOptions
  ): Handler<CreateContainerServiceCommandInput, CreateContainerServiceCommandOutput> {
    this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

    const stack = clientStack.concat(this.middlewareStack);

    const { logger } = configuration;
    const clientName = "LightsailClient";
    const commandName = "CreateContainerServiceCommand";
    const handlerExecutionContext: HandlerExecutionContext = {
      logger,
      clientName,
      commandName,
      inputFilterSensitiveLog: CreateContainerServiceRequest.filterSensitiveLog,
      outputFilterSensitiveLog: CreateContainerServiceResult.filterSensitiveLog,
    };
    const { requestHandler } = configuration;
    return stack.resolve(
      (request: FinalizeHandlerArguments<any>) =>
        requestHandler.handle(request.request as __HttpRequest, options || {}),
      handlerExecutionContext
    );
  }


private serialize(input: CreateContainerServiceCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
    return serializeAws_json1_1CreateContainerServiceCommand(input, context);
  }


private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<CreateContainerServiceCommandOutput> {
    return deserializeAws_json1_1CreateContainerServiceCommand(output, context);
  }


() => {
  return (

          <Link to="/">

          </Link>


export default function getWindowClose(): string {
  return window.close.toString()
}


export enum UploadInputEvent {
  UPLOAD_ALL = 'uploadAll',
  UPLOAD_FILE = 'uploadFile',
  CANCEL = 'cancel',
  CANCEL_ALL = 'cancelAll',
  REMOVE = 'remove',
  REMOVE_ALL = 'removeAll'
}


async (
  input: CreateConfigurationSetCommandInput,
  context: __SerdeContext
): Promise<__HttpRequest> => {
  const headers: any = {};
  headers["Content-Type"] = "application/json";
  let resolvedPath = "/v1/sms-voice/configuration-sets";
  let body: any;
  const bodyParams: any = {};
  if (input.ConfigurationSetName !== undefined) {
    bodyParams["ConfigurationSetName"] = input.ConfigurationSetName;
  }
  body = JSON.stringify(bodyParams);
  const { hostname, protocol = "https", port } = await context.endpoint();
  return new __HttpRequest({
    protocol,
    hostname,
    port,
    method: "POST",
    headers,
    path: resolvedPath,
    body
  });
}


async (
  input: CreateConfigurationSetEventDestinationCommandInput,
  context: __SerdeContext
): Promise<__HttpRequest> => {
  const headers: any = {};
  headers["Content-Type"] = "application/json";
  let resolvedPath =
    "/v1/sms-voice/configuration-sets/{ConfigurationSetName}/event-destinations";
  if (input.ConfigurationSetName !== undefined) {
    const labelValue: string = input.ConfigurationSetName;
    if (labelValue.length <= 0) {
      throw new Error(
        "Empty value provided for input HTTP label: ConfigurationSetName."
      );
    }
    resolvedPath = resolvedPath.replace(
      "{ConfigurationSetName}",
      __extendedEncodeURIComponent(labelValue)
    );
  } else {
    throw new Error(
      "No value provided for input HTTP label: ConfigurationSetName."
    );
  }
  let body: any;
  const bodyParams: any = {};
  if (input.EventDestination !== undefined) {
    bodyParams[
      "EventDestination"
    ] = serializeAws_restJson1_1EventDestinationDefinition(
      input.EventDestination,
      context
    );
  }
  if (input.EventDestinationName !== undefined) {
    bodyParams["EventDestinationName"] = input.EventDestinationName;
  }
  body = JSON.stringify(bodyParams);
  const { hostname, protocol = "https", port } = await context.endpoint();
  return new __HttpRequest({
    protocol,
    hostname,
    port,
    method: "POST",
    headers,
    path: resolvedPath,
    body
  });
}


async (
  input: DeleteConfigurationSetCommandInput,
  context: __SerdeContext
): Promise<__HttpRequest> => {
  const headers: any = {};
  headers["Content-Type"] = "";
  let resolvedPath = "/v1/sms-voice/configuration-sets/{ConfigurationSetName}";
  if (input.ConfigurationSetName !== undefined) {
    const labelValue: string = input.ConfigurationSetName;
    if (labelValue.length <= 0) {
      throw new Error(
        "Empty value provided for input HTTP label: ConfigurationSetName."
      );
    }
    resolvedPath = resolvedPath.replace(
      "{ConfigurationSetName}",
      __extendedEncodeURIComponent(labelValue)
    );
  } else {
    throw new Error(
      "No value provided for input HTTP label: ConfigurationSetName."
    );
  }
  let body: any;
  const { hostname, protocol = "https", port } = await context.endpoint();
  return new __HttpRequest({
    protocol,
    hostname,
    port,
    method: "DELETE",
    headers,
    path: resolvedPath,
    body
  });
}


async (
  input: DeleteConfigurationSetEventDestinationCommandInput,
  context: __SerdeContext
): Promise<__HttpRequest> => {
  const headers: any = {};
  headers["Content-Type"] = "";
  let resolvedPath =
    "/v1/sms-voice/configuration-sets/{ConfigurationSetName}/event-destinations/{EventDestinationName}";
  if (input.ConfigurationSetName !== undefined) {
    const labelValue: string = input.ConfigurationSetName;
    if (labelValue.length <= 0) {
      throw new Error(
        "Empty value provided for input HTTP label: ConfigurationSetName."
      );
    }
    resolvedPath = resolvedPath.replace(
      "{ConfigurationSetName}",
      __extendedEncodeURIComponent(labelValue)
    );
  } else {
    throw new Error(
      "No value provided for input HTTP label: ConfigurationSetName."
    );
  }
  if (input.EventDestinationName !== undefined) {
    const labelValue: string = input.EventDestinationName;
    if (labelValue.length <= 0) {
      throw new Error(
        "Empty value provided for input HTTP label: EventDestinationName."
      );
    }
    resolvedPath = resolvedPath.replace(
      "{EventDestinationName}",
      __extendedEncodeURIComponent(labelValue)
    );
  } else {
    throw new Error(
      "No value provided for input HTTP label: EventDestinationName."
    );
  }
  let body: any;
  const { hostname, protocol = "https", port } = await context.endpoint();
  return new __HttpRequest({
    protocol,
    hostname,
    port,
    method: "DELETE",
    headers,
    path: resolvedPath,
    body
  });
}


async (
  input: GetConfigurationSetEventDestinationsCommandInput,
  context: __SerdeContext
): Promise<__HttpRequest> => {
  const headers: any = {};
  headers["Content-Type"] = "";
  let resolvedPath =
    "/v1/sms-voice/configuration-sets/{ConfigurationSetName}/event-destinations";
  if (input.ConfigurationSetName !== undefined) {
    const labelValue: string = input.ConfigurationSetName;
    if (labelValue.length <= 0) {
      throw new Error(
        "Empty value provided for input HTTP label: ConfigurationSetName."
      );
    }
    resolvedPath = resolvedPath.replace(
      "{ConfigurationSetName}",
      __extendedEncodeURIComponent(labelValue)
    );
  } else {
    throw new Error(
      "No value provided for input HTTP label: ConfigurationSetName."
    );
  }
  let body: any;
  const { hostname, protocol = "https", port } = await context.endpoint();
  return new __HttpRequest({
    protocol,
    hostname,
    port,
    method: "GET",
    headers,
    path: resolvedPath,
    body
  });
}


async (
  input: ListConfigurationSetsCommandInput,
  context: __SerdeContext
): Promise<__HttpRequest> => {
  const headers: any = {};
  headers["Content-Type"] = "";
  let resolvedPath = "/v1/sms-voice/configuration-sets";
  const query: any = {};
  if (input.NextToken !== undefined) {
    query["NextToken"] = input.NextToken;
  }
  if (input.PageSize !== undefined) {
    query["PageSize"] = input.PageSize;
  }
  let body: any;
  const { hostname, protocol = "https", port } = await context.endpoint();
  return new __HttpRequest({
    protocol,
    hostname,
    port,
    method: "GET",
    headers,
    path: resolvedPath,
    query,
    body
  });
}


async (
  input: SendVoiceMessageCommandInput,
  context: __SerdeContext
): Promise<__HttpRequest> => {
  const headers: any = {};
  headers["Content-Type"] = "application/json";
  let resolvedPath = "/v1/sms-voice/voice/message";
  let body: any;
  const bodyParams: any = {};
  if (input.CallerId !== undefined) {
    bodyParams["CallerId"] = input.CallerId;
  }
  if (input.ConfigurationSetName !== undefined) {
    bodyParams["ConfigurationSetName"] = input.ConfigurationSetName;
  }
  if (input.Content !== undefined) {
    bodyParams["Content"] = serializeAws_restJson1_1VoiceMessageContent(
      input.Content,
      context
    );
  }
  if (input.DestinationPhoneNumber !== undefined) {
    bodyParams["DestinationPhoneNumber"] = input.DestinationPhoneNumber;
  }
  if (input.OriginationPhoneNumber !== undefined) {
    bodyParams["OriginationPhoneNumber"] = input.OriginationPhoneNumber;
  }
  body = JSON.stringify(bodyParams);
  const { hostname, protocol = "https", port } = await context.endpoint();
  return new __HttpRequest({
    protocol,
    hostname,
    port,
    method: "POST",
    headers,
    path: resolvedPath,
    body
  });
}


async (
  input: UpdateConfigurationSetEventDestinationCommandInput,
  context: __SerdeContext
): Promise<__HttpRequest> => {
  const headers: any = {};
  headers["Content-Type"] = "application/json";
  let resolvedPath =
    "/v1/sms-voice/configuration-sets/{ConfigurationSetName}/event-destinations/{EventDestinationName}";
  if (input.ConfigurationSetName !== undefined) {
    const labelValue: string = input.ConfigurationSetName;
    if (labelValue.length <= 0) {
      throw new Error(
        "Empty value provided for input HTTP label: ConfigurationSetName."
      );
    }
    resolvedPath = resolvedPath.replace(
      "{ConfigurationSetName}",
      __extendedEncodeURIComponent(labelValue)
    );
  } else {
    throw new Error(
      "No value provided for input HTTP label: ConfigurationSetName."
    );
  }
  if (input.EventDestinationName !== undefined) {
    const labelValue: string = input.EventDestinationName;
    if (labelValue.length <= 0) {
      throw new Error(
        "Empty value provided for input HTTP label: EventDestinationName."
      );
    }
    resolvedPath = resolvedPath.replace(
      "{EventDestinationName}",
      __extendedEncodeURIComponent(labelValue)
    );
  } else {
    throw new Error(
      "No value provided for input HTTP label: EventDestinationName."
    );
  }
  let body: any;
  const bodyParams: any = {};
  if (input.EventDestination !== undefined) {
    bodyParams[
      "EventDestination"
    ] = serializeAws_restJson1_1EventDestinationDefinition(
      input.EventDestination,
      context
    );
  }
  body = JSON.stringify(bodyParams);
  const { hostname, protocol = "https", port } = await context.endpoint();
  return new __HttpRequest({
    protocol,
    hostname,
    port,
    method: "PUT",
    headers,
    path: resolvedPath,
    body
  });
}


async (
  output: __HttpResponse,
  context: __SerdeContext
): Promise<CreateConfigurationSetCommandOutput> => {
  if (output.statusCode !== 200 && output.statusCode >= 400) {
    return deserializeAws_restJson1_1CreateConfigurationSetCommandError(
      output,
      context
    );
  }
  const contents: CreateConfigurationSetCommandOutput = {
    $metadata: deserializeMetadata(output),
    __type: "CreateConfigurationSetResponse"
  };
  await collectBody(output.body, context);
  return Promise.resolve(contents);
}


async (
  output: __HttpResponse,
  context: __SerdeContext
): Promise<CreateConfigurationSetCommandOutput> => {
  const parsedOutput: any = {
    ...output,
    body: await parseBody(output.body, context)
  };
  let response: __SmithyException & __MetadataBearer & { [key: string]: any };
  let errorCode: string = "UnknownError";
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
  switch (errorCode) {
    case "AlreadyExistsException":
    case "com.amazonaws.pinpoint_sms_voice#AlreadyExistsException":
      response = {
        ...(await deserializeAws_restJson1_1AlreadyExistsExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "BadRequestException":
    case "com.amazonaws.pinpoint_sms_voice#BadRequestException":
      response = {
        ...(await deserializeAws_restJson1_1BadRequestExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "InternalServiceErrorException":
    case "com.amazonaws.pinpoint_sms_voice#InternalServiceErrorException":
      response = {
        ...(await deserializeAws_restJson1_1InternalServiceErrorExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "LimitExceededException":
    case "com.amazonaws.pinpoint_sms_voice#LimitExceededException":
      response = {
        ...(await deserializeAws_restJson1_1LimitExceededExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "TooManyRequestsException":
    case "com.amazonaws.pinpoint_sms_voice#TooManyRequestsException":
      response = {
        ...(await deserializeAws_restJson1_1TooManyRequestsExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    default:
      const parsedBody = parsedOutput.body;
      errorCode = parsedBody.code || parsedBody.Code || errorCode;
      response = {
        ...parsedBody,
        name: `${errorCode}`,
        message: parsedBody.message || parsedBody.Message || errorCode,
        $fault: "client",
        $metadata: deserializeMetadata(output)
      } as any;
  }
  const message = response.message || response.Message || errorCode;
  response.message = message;
  delete response.Message;
  return Promise.reject(Object.assign(new Error(message), response));
}


async (
  output: __HttpResponse,
  context: __SerdeContext
): Promise<CreateConfigurationSetEventDestinationCommandOutput> => {
  if (output.statusCode !== 200 && output.statusCode >= 400) {
    return deserializeAws_restJson1_1CreateConfigurationSetEventDestinationCommandError(
      output,
      context
    );
  }
  const contents: CreateConfigurationSetEventDestinationCommandOutput = {
    $metadata: deserializeMetadata(output),
    __type: "CreateConfigurationSetEventDestinationResponse"
  };
  await collectBody(output.body, context);
  return Promise.resolve(contents);
}


async (
  output: __HttpResponse,
  context: __SerdeContext
): Promise<CreateConfigurationSetEventDestinationCommandOutput> => {
  const parsedOutput: any = {
    ...output,
    body: await parseBody(output.body, context)
  };
  let response: __SmithyException & __MetadataBearer & { [key: string]: any };
  let errorCode: string = "UnknownError";
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
  switch (errorCode) {
    case "AlreadyExistsException":
    case "com.amazonaws.pinpoint_sms_voice#AlreadyExistsException":
      response = {
        ...(await deserializeAws_restJson1_1AlreadyExistsExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "BadRequestException":
    case "com.amazonaws.pinpoint_sms_voice#BadRequestException":
      response = {
        ...(await deserializeAws_restJson1_1BadRequestExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "InternalServiceErrorException":
    case "com.amazonaws.pinpoint_sms_voice#InternalServiceErrorException":
      response = {
        ...(await deserializeAws_restJson1_1InternalServiceErrorExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "LimitExceededException":
    case "com.amazonaws.pinpoint_sms_voice#LimitExceededException":
      response = {
        ...(await deserializeAws_restJson1_1LimitExceededExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "NotFoundException":
    case "com.amazonaws.pinpoint_sms_voice#NotFoundException":
      response = {
        ...(await deserializeAws_restJson1_1NotFoundExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "TooManyRequestsException":
    case "com.amazonaws.pinpoint_sms_voice#TooManyRequestsException":
      response = {
        ...(await deserializeAws_restJson1_1TooManyRequestsExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    default:
      const parsedBody = parsedOutput.body;
      errorCode = parsedBody.code || parsedBody.Code || errorCode;
      response = {
        ...parsedBody,
        name: `${errorCode}`,
        message: parsedBody.message || parsedBody.Message || errorCode,
        $fault: "client",
        $metadata: deserializeMetadata(output)
      } as any;
  }
  const message = response.message || response.Message || errorCode;
  response.message = message;
  delete response.Message;
  return Promise.reject(Object.assign(new Error(message), response));
}


async (
  output: __HttpResponse,
  context: __SerdeContext
): Promise<DeleteConfigurationSetCommandOutput> => {
  if (output.statusCode !== 200 && output.statusCode >= 400) {
    return deserializeAws_restJson1_1DeleteConfigurationSetCommandError(
      output,
      context
    );
  }
  const contents: DeleteConfigurationSetCommandOutput = {
    $metadata: deserializeMetadata(output),
    __type: "DeleteConfigurationSetResponse"
  };
  await collectBody(output.body, context);
  return Promise.resolve(contents);
}


async (
  output: __HttpResponse,
  context: __SerdeContext
): Promise<DeleteConfigurationSetCommandOutput> => {
  const parsedOutput: any = {
    ...output,
    body: await parseBody(output.body, context)
  };
  let response: __SmithyException & __MetadataBearer & { [key: string]: any };
  let errorCode: string = "UnknownError";
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
  switch (errorCode) {
    case "BadRequestException":
    case "com.amazonaws.pinpoint_sms_voice#BadRequestException":
      response = {
        ...(await deserializeAws_restJson1_1BadRequestExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "InternalServiceErrorException":
    case "com.amazonaws.pinpoint_sms_voice#InternalServiceErrorException":
      response = {
        ...(await deserializeAws_restJson1_1InternalServiceErrorExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "NotFoundException":
    case "com.amazonaws.pinpoint_sms_voice#NotFoundException":
      response = {
        ...(await deserializeAws_restJson1_1NotFoundExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "TooManyRequestsException":
    case "com.amazonaws.pinpoint_sms_voice#TooManyRequestsException":
      response = {
        ...(await deserializeAws_restJson1_1TooManyRequestsExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    default:
      const parsedBody = parsedOutput.body;
      errorCode = parsedBody.code || parsedBody.Code || errorCode;
      response = {
        ...parsedBody,
        name: `${errorCode}`,
        message: parsedBody.message || parsedBody.Message || errorCode,
        $fault: "client",
        $metadata: deserializeMetadata(output)
      } as any;
  }
  const message = response.message || response.Message || errorCode;
  response.message = message;
  delete response.Message;
  return Promise.reject(Object.assign(new Error(message), response));
}


async (
  output: __HttpResponse,
  context: __SerdeContext
): Promise<DeleteConfigurationSetEventDestinationCommandOutput> => {
  if (output.statusCode !== 200 && output.statusCode >= 400) {
    return deserializeAws_restJson1_1DeleteConfigurationSetEventDestinationCommandError(
      output,
      context
    );
  }
  const contents: DeleteConfigurationSetEventDestinationCommandOutput = {
    $metadata: deserializeMetadata(output),
    __type: "DeleteConfigurationSetEventDestinationResponse"
  };
  await collectBody(output.body, context);
  return Promise.resolve(contents);
}


async (
  output: __HttpResponse,
  context: __SerdeContext
): Promise<DeleteConfigurationSetEventDestinationCommandOutput> => {
  const parsedOutput: any = {
    ...output,
    body: await parseBody(output.body, context)
  };
  let response: __SmithyException & __MetadataBearer & { [key: string]: any };
  let errorCode: string = "UnknownError";
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
  switch (errorCode) {
    case "BadRequestException":
    case "com.amazonaws.pinpoint_sms_voice#BadRequestException":
      response = {
        ...(await deserializeAws_restJson1_1BadRequestExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "InternalServiceErrorException":
    case "com.amazonaws.pinpoint_sms_voice#InternalServiceErrorException":
      response = {
        ...(await deserializeAws_restJson1_1InternalServiceErrorExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "NotFoundException":
    case "com.amazonaws.pinpoint_sms_voice#NotFoundException":
      response = {
        ...(await deserializeAws_restJson1_1NotFoundExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "TooManyRequestsException":
    case "com.amazonaws.pinpoint_sms_voice#TooManyRequestsException":
      response = {
        ...(await deserializeAws_restJson1_1TooManyRequestsExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    default:
      const parsedBody = parsedOutput.body;
      errorCode = parsedBody.code || parsedBody.Code || errorCode;
      response = {
        ...parsedBody,
        name: `${errorCode}`,
        message: parsedBody.message || parsedBody.Message || errorCode,
        $fault: "client",
        $metadata: deserializeMetadata(output)
      } as any;
  }
  const message = response.message || response.Message || errorCode;
  response.message = message;
  delete response.Message;
  return Promise.reject(Object.assign(new Error(message), response));
}


async (
  output: __HttpResponse,
  context: __SerdeContext
): Promise<GetConfigurationSetEventDestinationsCommandOutput> => {
  if (output.statusCode !== 200 && output.statusCode >= 400) {
    return deserializeAws_restJson1_1GetConfigurationSetEventDestinationsCommandError(
      output,
      context
    );
  }
  const contents: GetConfigurationSetEventDestinationsCommandOutput = {
    $metadata: deserializeMetadata(output),
    __type: "GetConfigurationSetEventDestinationsResponse",
    EventDestinations: undefined
  };
  const data: any = await parseBody(output.body, context);
  if (data.EventDestinations !== undefined && data.EventDestinations !== null) {
    contents.EventDestinations = deserializeAws_restJson1_1EventDestinations(
      data.EventDestinations,
      context
    );
  }
  return Promise.resolve(contents);
}


async (
  output: __HttpResponse,
  context: __SerdeContext
): Promise<GetConfigurationSetEventDestinationsCommandOutput> => {
  const parsedOutput: any = {
    ...output,
    body: await parseBody(output.body, context)
  };
  let response: __SmithyException & __MetadataBearer & { [key: string]: any };
  let errorCode: string = "UnknownError";
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
  switch (errorCode) {
    case "BadRequestException":
    case "com.amazonaws.pinpoint_sms_voice#BadRequestException":
      response = {
        ...(await deserializeAws_restJson1_1BadRequestExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "InternalServiceErrorException":
    case "com.amazonaws.pinpoint_sms_voice#InternalServiceErrorException":
      response = {
        ...(await deserializeAws_restJson1_1InternalServiceErrorExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "NotFoundException":
    case "com.amazonaws.pinpoint_sms_voice#NotFoundException":
      response = {
        ...(await deserializeAws_restJson1_1NotFoundExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "TooManyRequestsException":
    case "com.amazonaws.pinpoint_sms_voice#TooManyRequestsException":
      response = {
        ...(await deserializeAws_restJson1_1TooManyRequestsExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    default:
      const parsedBody = parsedOutput.body;
      errorCode = parsedBody.code || parsedBody.Code || errorCode;
      response = {
        ...parsedBody,
        name: `${errorCode}`,
        message: parsedBody.message || parsedBody.Message || errorCode,
        $fault: "client",
        $metadata: deserializeMetadata(output)
      } as any;
  }
  const message = response.message || response.Message || errorCode;
  response.message = message;
  delete response.Message;
  return Promise.reject(Object.assign(new Error(message), response));
}


async (
  output: __HttpResponse,
  context: __SerdeContext
): Promise<ListConfigurationSetsCommandOutput> => {
  if (output.statusCode !== 200 && output.statusCode >= 400) {
    return deserializeAws_restJson1_1ListConfigurationSetsCommandError(
      output,
      context
    );
  }
  const contents: ListConfigurationSetsCommandOutput = {
    $metadata: deserializeMetadata(output),
    __type: "ListConfigurationSetsResponse",
    ConfigurationSets: undefined,
    NextToken: undefined
  };
  const data: any = await parseBody(output.body, context);
  if (data.ConfigurationSets !== undefined && data.ConfigurationSets !== null) {
    contents.ConfigurationSets = deserializeAws_restJson1_1ConfigurationSets(
      data.ConfigurationSets,
      context
    );
  }
  if (data.NextToken !== undefined && data.NextToken !== null) {
    contents.NextToken = data.NextToken;
  }
  return Promise.resolve(contents);
}


async (
  output: __HttpResponse,
  context: __SerdeContext
): Promise<ListConfigurationSetsCommandOutput> => {
  const parsedOutput: any = {
    ...output,
    body: await parseBody(output.body, context)
  };
  let response: __SmithyException & __MetadataBearer & { [key: string]: any };
  let errorCode: string = "UnknownError";
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
  switch (errorCode) {
    case "BadRequestException":
    case "com.amazonaws.pinpoint_sms_voice#BadRequestException":
      response = {
        ...(await deserializeAws_restJson1_1BadRequestExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "InternalServiceErrorException":
    case "com.amazonaws.pinpoint_sms_voice#InternalServiceErrorException":
      response = {
        ...(await deserializeAws_restJson1_1InternalServiceErrorExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "TooManyRequestsException":
    case "com.amazonaws.pinpoint_sms_voice#TooManyRequestsException":
      response = {
        ...(await deserializeAws_restJson1_1TooManyRequestsExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    default:
      const parsedBody = parsedOutput.body;
      errorCode = parsedBody.code || parsedBody.Code || errorCode;
      response = {
        ...parsedBody,
        name: `${errorCode}`,
        message: parsedBody.message || parsedBody.Message || errorCode,
        $fault: "client",
        $metadata: deserializeMetadata(output)
      } as any;
  }
  const message = response.message || response.Message || errorCode;
  response.message = message;
  delete response.Message;
  return Promise.reject(Object.assign(new Error(message), response));
}


async (
  output: __HttpResponse,
  context: __SerdeContext
): Promise<SendVoiceMessageCommandOutput> => {
  if (output.statusCode !== 200 && output.statusCode >= 400) {
    return deserializeAws_restJson1_1SendVoiceMessageCommandError(
      output,
      context
    );
  }
  const contents: SendVoiceMessageCommandOutput = {
    $metadata: deserializeMetadata(output),
    __type: "SendVoiceMessageResponse",
    MessageId: undefined
  };
  const data: any = await parseBody(output.body, context);
  if (data.MessageId !== undefined && data.MessageId !== null) {
    contents.MessageId = data.MessageId;
  }
  return Promise.resolve(contents);
}


async (
  output: __HttpResponse,
  context: __SerdeContext
): Promise<SendVoiceMessageCommandOutput> => {
  const parsedOutput: any = {
    ...output,
    body: await parseBody(output.body, context)
  };
  let response: __SmithyException & __MetadataBearer & { [key: string]: any };
  let errorCode: string = "UnknownError";
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
  switch (errorCode) {
    case "BadRequestException":
    case "com.amazonaws.pinpoint_sms_voice#BadRequestException":
      response = {
        ...(await deserializeAws_restJson1_1BadRequestExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "InternalServiceErrorException":
    case "com.amazonaws.pinpoint_sms_voice#InternalServiceErrorException":
      response = {
        ...(await deserializeAws_restJson1_1InternalServiceErrorExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "TooManyRequestsException":
    case "com.amazonaws.pinpoint_sms_voice#TooManyRequestsException":
      response = {
        ...(await deserializeAws_restJson1_1TooManyRequestsExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    default:
      const parsedBody = parsedOutput.body;
      errorCode = parsedBody.code || parsedBody.Code || errorCode;
      response = {
        ...parsedBody,
        name: `${errorCode}`,
        message: parsedBody.message || parsedBody.Message || errorCode,
        $fault: "client",
        $metadata: deserializeMetadata(output)
      } as any;
  }
  const message = response.message || response.Message || errorCode;
  response.message = message;
  delete response.Message;
  return Promise.reject(Object.assign(new Error(message), response));
}


async (
  output: __HttpResponse,
  context: __SerdeContext
): Promise<UpdateConfigurationSetEventDestinationCommandOutput> => {
  if (output.statusCode !== 200 && output.statusCode >= 400) {
    return deserializeAws_restJson1_1UpdateConfigurationSetEventDestinationCommandError(
      output,
      context
    );
  }
  const contents: UpdateConfigurationSetEventDestinationCommandOutput = {
    $metadata: deserializeMetadata(output),
    __type: "UpdateConfigurationSetEventDestinationResponse"
  };
  await collectBody(output.body, context);
  return Promise.resolve(contents);
}


async (
  output: __HttpResponse,
  context: __SerdeContext
): Promise<UpdateConfigurationSetEventDestinationCommandOutput> => {
  const parsedOutput: any = {
    ...output,
    body: await parseBody(output.body, context)
  };
  let response: __SmithyException & __MetadataBearer & { [key: string]: any };
  let errorCode: string = "UnknownError";
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
  switch (errorCode) {
    case "BadRequestException":
    case "com.amazonaws.pinpoint_sms_voice#BadRequestException":
      response = {
        ...(await deserializeAws_restJson1_1BadRequestExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "InternalServiceErrorException":
    case "com.amazonaws.pinpoint_sms_voice#InternalServiceErrorException":
      response = {
        ...(await deserializeAws_restJson1_1InternalServiceErrorExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "NotFoundException":
    case "com.amazonaws.pinpoint_sms_voice#NotFoundException":
      response = {
        ...(await deserializeAws_restJson1_1NotFoundExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    case "TooManyRequestsException":
    case "com.amazonaws.pinpoint_sms_voice#TooManyRequestsException":
      response = {
        ...(await deserializeAws_restJson1_1TooManyRequestsExceptionResponse(
          parsedOutput,
          context
        )),
        name: errorCode,
        $metadata: deserializeMetadata(output)
      };
      break;
    default:
      const parsedBody = parsedOutput.body;
      errorCode = parsedBody.code || parsedBody.Code || errorCode;
      response = {
        ...parsedBody,
        name: `${errorCode}`,
        message: parsedBody.message || parsedBody.Message || errorCode,
        $fault: "client",
        $metadata: deserializeMetadata(output)
      } as any;
  }
  const message = response.message || response.Message || errorCode;
  response.message = message;
  delete response.Message;
  return Promise.reject(Object.assign(new Error(message), response));
}


async (
  parsedOutput: any,
  context: __SerdeContext
): Promise<AlreadyExistsException> => {
  const contents: AlreadyExistsException = {
    name: "AlreadyExistsException",
    $fault: "client",
    $metadata: deserializeMetadata(parsedOutput),
    Message: undefined
  };
  const data: any = parsedOutput.body;
  if (data.Message !== undefined && data.Message !== null) {
    contents.Message = data.Message;
  }
  return contents;
}


async (
  parsedOutput: any,
  context: __SerdeContext
): Promise<BadRequestException> => {
  const contents: BadRequestException = {
    name: "BadRequestException",
    $fault: "client",
    $metadata: deserializeMetadata(parsedOutput),
    Message: undefined
  };
  const data: any = parsedOutput.body;
  if (data.Message !== undefined && data.Message !== null) {
    contents.Message = data.Message;
  }
  return contents;
}


async (
  parsedOutput: any,
  context: __SerdeContext
): Promise<InternalServiceErrorException> => {
  const contents: InternalServiceErrorException = {
    name: "InternalServiceErrorException",
    $fault: "server",
    $metadata: deserializeMetadata(parsedOutput),
    Message: undefined
  };
  const data: any = parsedOutput.body;
  if (data.Message !== undefined && data.Message !== null) {
    contents.Message = data.Message;
  }
  return contents;
}


async (
  parsedOutput: any,
  context: __SerdeContext
): Promise<LimitExceededException> => {
  const contents: LimitExceededException = {
    name: "LimitExceededException",
    $fault: "client",
    $metadata: deserializeMetadata(parsedOutput),
    Message: undefined
  };
  const data: any = parsedOutput.body;
  if (data.Message !== undefined && data.Message !== null) {
    contents.Message = data.Message;
  }
  return contents;
}


async (
  parsedOutput: any,
  context: __SerdeContext
): Promise<NotFoundException> => {
  const contents: NotFoundException = {
    name: "NotFoundException",
    $fault: "client",
    $metadata: deserializeMetadata(parsedOutput),
    Message: undefined
  };
  const data: any = parsedOutput.body;
  if (data.Message !== undefined && data.Message !== null) {
    contents.Message = data.Message;
  }
  return contents;
}


async (
  parsedOutput: any,
  context: __SerdeContext
): Promise<TooManyRequestsException> => {
  const contents: TooManyRequestsException = {
    name: "TooManyRequestsException",
    $fault: "client",
    $metadata: deserializeMetadata(parsedOutput),
    Message: undefined
  };
  const data: any = parsedOutput.body;
  if (data.Message !== undefined && data.Message !== null) {
    contents.Message = data.Message;
  }
  return contents;
}


(
  input: CallInstructionsMessageType,
  context: __SerdeContext
): any => {
  const bodyParams: any = {};
  if (input.Text !== undefined) {
    bodyParams["Text"] = input.Text;
  }
  return bodyParams;
}


(
  input: CloudWatchLogsDestination,
  context: __SerdeContext
): any => {
  const bodyParams: any = {};
  if (input.IamRoleArn !== undefined) {
    bodyParams["IamRoleArn"] = input.IamRoleArn;
  }
  if (input.LogGroupArn !== undefined) {
    bodyParams["LogGroupArn"] = input.LogGroupArn;
  }
  return bodyParams;
}


(
  input: EventDestinationDefinition,
  context: __SerdeContext
): any => {
  const bodyParams: any = {};
  if (input.CloudWatchLogsDestination !== undefined) {
    bodyParams[
      "CloudWatchLogsDestination"
    ] = serializeAws_restJson1_1CloudWatchLogsDestination(
      input.CloudWatchLogsDestination,
      context
    );
  }
  if (input.Enabled !== undefined) {
    bodyParams["Enabled"] = input.Enabled;
  }
  if (input.KinesisFirehoseDestination !== undefined) {
    bodyParams[
      "KinesisFirehoseDestination"
    ] = serializeAws_restJson1_1KinesisFirehoseDestination(
      input.KinesisFirehoseDestination,
      context
    );
  }
  if (input.MatchingEventTypes !== undefined) {
    bodyParams["MatchingEventTypes"] = serializeAws_restJson1_1EventTypes(
      input.MatchingEventTypes,
      context
    );
  }
  if (input.SnsDestination !== undefined) {
    bodyParams["SnsDestination"] = serializeAws_restJson1_1SnsDestination(
      input.SnsDestination,
      context
    );
  }
  return bodyParams;
}


(
  input: (EventType | string)[],
  context: __SerdeContext
): any => {
  const contents = [];
  for (let entry of input) {
    contents.push(entry);
  }
  return contents;
}


(
  input: KinesisFirehoseDestination,
  context: __SerdeContext
): any => {
  const bodyParams: any = {};
  if (input.DeliveryStreamArn !== undefined) {
    bodyParams["DeliveryStreamArn"] = input.DeliveryStreamArn;
  }
  if (input.IamRoleArn !== undefined) {
    bodyParams["IamRoleArn"] = input.IamRoleArn;
  }
  return bodyParams;
}


(
  input: PlainTextMessageType,
  context: __SerdeContext
): any => {
  const bodyParams: any = {};
  if (input.LanguageCode !== undefined) {
    bodyParams["LanguageCode"] = input.LanguageCode;
  }
  if (input.Text !== undefined) {
    bodyParams["Text"] = input.Text;
  }
  if (input.VoiceId !== undefined) {
    bodyParams["VoiceId"] = input.VoiceId;
  }
  return bodyParams;
}


(
  input: SSMLMessageType,
  context: __SerdeContext
): any => {
  const bodyParams: any = {};
  if (input.LanguageCode !== undefined) {
    bodyParams["LanguageCode"] = input.LanguageCode;
  }
  if (input.Text !== undefined) {
    bodyParams["Text"] = input.Text;
  }
  if (input.VoiceId !== undefined) {
    bodyParams["VoiceId"] = input.VoiceId;
  }
  return bodyParams;
}


(
  input: SnsDestination,
  context: __SerdeContext
): any => {
  const bodyParams: any = {};
  if (input.TopicArn !== undefined) {
    bodyParams["TopicArn"] = input.TopicArn;
  }
  return bodyParams;
}


(
  input: VoiceMessageContent,
  context: __SerdeContext
): any => {
  const bodyParams: any = {};
  if (input.CallInstructionsMessage !== undefined) {
    bodyParams[
      "CallInstructionsMessage"
    ] = serializeAws_restJson1_1CallInstructionsMessageType(
      input.CallInstructionsMessage,
      context
    );
  }
  if (input.PlainTextMessage !== undefined) {
    bodyParams[
      "PlainTextMessage"
    ] = serializeAws_restJson1_1PlainTextMessageType(
      input.PlainTextMessage,
      context
    );
  }
  if (input.SSMLMessage !== undefined) {
    bodyParams["SSMLMessage"] = serializeAws_restJson1_1SSMLMessageType(
      input.SSMLMessage,
      context
    );
  }
  return bodyParams;
}


(
  output: any,
  context: __SerdeContext
): CloudWatchLogsDestination => {
  let contents: any = {
    __type: "CloudWatchLogsDestination",
    IamRoleArn: undefined,
    LogGroupArn: undefined
  };
  if (output.IamRoleArn !== undefined && output.IamRoleArn !== null) {
    contents.IamRoleArn = output.IamRoleArn;
  }
  if (output.LogGroupArn !== undefined && output.LogGroupArn !== null) {
    contents.LogGroupArn = output.LogGroupArn;
  }
  return contents;
}


(
  output: any,
  context: __SerdeContext
): string[] => {
  return (output || []).map((entry: any) => entry);
}


(entry: any) => entry


(
  output: any,
  context: __SerdeContext
): EventDestination => {
  let contents: any = {
    __type: "EventDestination",
    CloudWatchLogsDestination: undefined,
    Enabled: undefined,
    KinesisFirehoseDestination: undefined,
    MatchingEventTypes: undefined,
    Name: undefined,
    SnsDestination: undefined
  };
  if (
    output.CloudWatchLogsDestination !== undefined &&
    output.CloudWatchLogsDestination !== null
  ) {
    contents.CloudWatchLogsDestination = deserializeAws_restJson1_1CloudWatchLogsDestination(
      output.CloudWatchLogsDestination,
      context
    );
  }
  if (output.Enabled !== undefined && output.Enabled !== null) {
    contents.Enabled = output.Enabled;
  }
  if (
    output.KinesisFirehoseDestination !== undefined &&
    output.KinesisFirehoseDestination !== null
  ) {
    contents.KinesisFirehoseDestination = deserializeAws_restJson1_1KinesisFirehoseDestination(
      output.KinesisFirehoseDestination,
      context
    );
  }
  if (
    output.MatchingEventTypes !== undefined &&
    output.MatchingEventTypes !== null
  ) {
    contents.MatchingEventTypes = deserializeAws_restJson1_1EventTypes(
      output.MatchingEventTypes,
      context
    );
  }
  if (output.Name !== undefined && output.Name !== null) {
    contents.Name = output.Name;
  }
  if (output.SnsDestination !== undefined && output.SnsDestination !== null) {
    contents.SnsDestination = deserializeAws_restJson1_1SnsDestination(
      output.SnsDestination,
      context
    );
  }
  return contents;
}


(
  output: any,
  context: __SerdeContext
): EventDestination[] => {
  return (output || []).map((entry: any) =>
    deserializeAws_restJson1_1EventDestination(entry, context)
  );
}


(entry: any) =>
    deserializeAws_restJson1_1EventDestination(entry, context)


(
  output: any,
  context: __SerdeContext
): (EventType | string)[] => {
  return (output || []).map((entry: any) => entry);
}


(
  output: any,
  context: __SerdeContext
): KinesisFirehoseDestination => {
  let contents: any = {
    __type: "KinesisFirehoseDestination",
    DeliveryStreamArn: undefined,
    IamRoleArn: undefined
  };
  if (
    output.DeliveryStreamArn !== undefined &&
    output.DeliveryStreamArn !== null
  ) {
    contents.DeliveryStreamArn = output.DeliveryStreamArn;
  }
  if (output.IamRoleArn !== undefined && output.IamRoleArn !== null) {
    contents.IamRoleArn = output.IamRoleArn;
  }
  return contents;
}


(
  output: any,
  context: __SerdeContext
): SnsDestination => {
  let contents: any = {
    __type: "SnsDestination",
    TopicArn: undefined
  };
  if (output.TopicArn !== undefined && output.TopicArn !== null) {
    contents.TopicArn = output.TopicArn;
  }
  return contents;
}


(output: __HttpResponse): __ResponseMetadata => ({
  httpStatusCode: output.statusCode,
  httpHeaders: output.headers,
  requestId: output.headers["x-amzn-requestid"]
})


(
  streamBody: any = new Uint8Array(),
  context: __SerdeContext
): Promise<Uint8Array> => {
  if (streamBody instanceof Uint8Array) {
    return Promise.resolve(streamBody);
  }
  return (
    context.streamCollector(streamBody) || Promise.resolve(new Uint8Array())
  );
}


(
  streamBody: any,
  context: __SerdeContext
): Promise<string> =>
  collectBody(streamBody, context).then(body => context.utf8Encoder(body))


body => context.utf8Encoder(body)


(value: any): boolean =>
  value !== undefined &&
  value !== "" &&
  (!Object.getOwnPropertyNames(value).includes("length") ||
    value.length != 0) &&
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0)


(streamBody: any, context: __SerdeContext): any =>
  collectBodyString(streamBody, context).then(encoded => {
    if (encoded.length) {
      return JSON.parse(encoded);
    }
    return {};
  })


encoded => {
    if (encoded.length) {
      return JSON.parse(encoded);
    }
    return {};
  }


(output: __HttpResponse, data: any): string => {
  const findKey = (object: any, key: string) =>
    Object.keys(object).find(k => k.toLowerCase() === key.toLowerCase());

  const sanitizeErrorCode = (rawValue: string): string => {
    let cleanValue = rawValue;
    if (cleanValue.indexOf(":") >= 0) {
      cleanValue = cleanValue.split(":")[0];
    }
    if (cleanValue.indexOf("#") >= 0) {
      cleanValue = cleanValue.split("#")[1];
    }
    return cleanValue;
  };

  const headerKey = findKey(output.headers, "x-amzn-errortype");
  if (headerKey !== undefined) {
    return sanitizeErrorCode(output.headers[headerKey]);
  }

  if (data.code !== undefined) {
    return sanitizeErrorCode(data.code);
  }

  if (data["__type"] !== undefined) {
    return sanitizeErrorCode(data["__type"]);
  }

  return "";
}


(object: any, key: string) =>
    Object.keys(object).find(k => k.toLowerCase() === key.toLowerCase())


k => k.toLowerCase() === key.toLowerCase()


(rawValue: string): string => {
    let cleanValue = rawValue;
    if (cleanValue.indexOf(":") >= 0) {
      cleanValue = cleanValue.split(":")[0];
    }
    if (cleanValue.indexOf("#") >= 0) {
      cleanValue = cleanValue.split("#")[1];
    }
    return cleanValue;
  }


@NgModule({
    imports: [
        ArtemisSharedModule,
        RouterModule.forChild(courseManagementState),
        FormDateTimePickerModule,
        ReactiveFormsModule,
        ImageCropperModule,
        OrionModule,
        MomentModule,
        ArtemisExerciseModule,
        ArtemisLectureModule,
        ArtemisCourseScoresModule,
        ArtemisExerciseScoresModule,
        ArtemisProgrammingExerciseManagementModule,
        ArtemisFileUploadExerciseManagementModule,
        ArtemisQuizManagementModule,
        ArtemisTextExerciseManagementModule,
        ArtemisModelingExerciseManagementModule,
        ArtemisProgrammingExerciseModule,
        ArtemisTextExerciseModule,
        ArtemisModelingExerciseModule,
        ArtemisColorSelectorModule,
        ArtemisDashboardsModule,
        ArtemisExerciseHintManagementModule,
        ArtemisParticipationModule,
        ArtemisComplaintsForTutorModule,
        ArtemisListOfComplaintsModule,
        ArtemisTextExerciseAssessmentModule,
        ArtemisFileUploadAssessmentModule,
        ArtemisModelingAssessmentEditorModule,
        NgxDatatableModule,
        ArtemisDataTableModule,
        ArtemisAssessmentSharedModule,
    ],
    declarations: [CourseManagementComponent, CourseDetailComponent, CourseUpdateComponent, CourseExerciseCardComponent, CourseManagementExercisesComponent, CourseGroupComponent],
})
export class ArtemisCourseManagementModule {}


(obj: AccountLimit): any => ({
    ...obj,
  })


(o: any): o is AccountLimit => __isa(o, "AccountLimit")


(obj: AccountUsage): any => ({
    ...obj,
  })


(o: any): o is AccountUsage => __isa(o, "AccountUsage")


(obj: AddLayerVersionPermissionRequest): any => ({
    ...obj,
  })


(o: any): o is AddLayerVersionPermissionRequest => __isa(o, "AddLayerVersionPermissionRequest")


(obj: AddLayerVersionPermissionResponse): any => ({
    ...obj,
  })


(o: any): o is AddLayerVersionPermissionResponse => __isa(o, "AddLayerVersionPermissionResponse")


(obj: AddPermissionRequest): any => ({
    ...obj,
  })


(o: any): o is AddPermissionRequest => __isa(o, "AddPermissionRequest")


(obj: AddPermissionResponse): any => ({
    ...obj,
  })


(o: any): o is AddPermissionResponse => __isa(o, "AddPermissionResponse")


(obj: AliasConfiguration): any => ({
    ...obj,
  })


(o: any): o is AliasConfiguration => __isa(o, "AliasConfiguration")


(obj: AliasRoutingConfiguration): any => ({
    ...obj,
  })


(o: any): o is AliasRoutingConfiguration => __isa(o, "AliasRoutingConfiguration")


(obj: CodeStorageExceededException): any => ({
    ...obj,
  })


(o: any): o is CodeStorageExceededException => __isa(o, "CodeStorageExceededException")


(obj: Concurrency): any => ({
    ...obj,
  })


(o: any): o is Concurrency => __isa(o, "Concurrency")


(obj: CreateAliasRequest): any => ({
    ...obj,
  })


(o: any): o is CreateAliasRequest => __isa(o, "CreateAliasRequest")


(obj: CreateEventSourceMappingRequest): any => ({
    ...obj,
  })


(o: any): o is CreateEventSourceMappingRequest => __isa(o, "CreateEventSourceMappingRequest")


(obj: CreateFunctionRequest): any => ({
    ...obj,
    ...(obj.Code && { Code: FunctionCode.filterSensitiveLog(obj.Code) }),
    ...(obj.Environment && { Environment: Environment.filterSensitiveLog(obj.Environment) }),
  })


(o: any): o is CreateFunctionRequest => __isa(o, "CreateFunctionRequest")


(obj: DeadLetterConfig): any => ({
    ...obj,
  })


(o: any): o is DeadLetterConfig => __isa(o, "DeadLetterConfig")


(obj: DeleteAliasRequest): any => ({
    ...obj,
  })


(o: any): o is DeleteAliasRequest => __isa(o, "DeleteAliasRequest")


(obj: DeleteEventSourceMappingRequest): any => ({
    ...obj,
  })


(o: any): o is DeleteEventSourceMappingRequest => __isa(o, "DeleteEventSourceMappingRequest")


(obj: DeleteFunctionConcurrencyRequest): any => ({
    ...obj,
  })


(o: any): o is DeleteFunctionConcurrencyRequest => __isa(o, "DeleteFunctionConcurrencyRequest")


(obj: DeleteFunctionEventInvokeConfigRequest): any => ({
    ...obj,
  })


(o: any): o is DeleteFunctionEventInvokeConfigRequest =>
    __isa(o, "DeleteFunctionEventInvokeConfigRequest")


(obj: DeleteFunctionRequest): any => ({
    ...obj,
  })


(o: any): o is DeleteFunctionRequest => __isa(o, "DeleteFunctionRequest")


(obj: DeleteLayerVersionRequest): any => ({
    ...obj,
  })


(o: any): o is DeleteLayerVersionRequest => __isa(o, "DeleteLayerVersionRequest")


(obj: DeleteProvisionedConcurrencyConfigRequest): any => ({
    ...obj,
  })


(o: any): o is DeleteProvisionedConcurrencyConfigRequest =>
    __isa(o, "DeleteProvisionedConcurrencyConfigRequest")


(obj: DestinationConfig): any => ({
    ...obj,
  })


(o: any): o is DestinationConfig => __isa(o, "DestinationConfig")


(obj: EC2AccessDeniedException): any => ({
    ...obj,
  })


(o: any): o is EC2AccessDeniedException => __isa(o, "EC2AccessDeniedException")


(obj: EC2ThrottledException): any => ({
    ...obj,
  })


(o: any): o is EC2ThrottledException => __isa(o, "EC2ThrottledException")


(obj: EC2UnexpectedException): any => ({
    ...obj,
  })


(o: any): o is EC2UnexpectedException => __isa(o, "EC2UnexpectedException")


(obj: EFSIOException): any => ({
    ...obj,
  })


(o: any): o is EFSIOException => __isa(o, "EFSIOException")


(obj: EFSMountConnectivityException): any => ({
    ...obj,
  })


(o: any): o is EFSMountConnectivityException => __isa(o, "EFSMountConnectivityException")


(obj: EFSMountFailureException): any => ({
    ...obj,
  })


(o: any): o is EFSMountFailureException => __isa(o, "EFSMountFailureException")


(obj: EFSMountTimeoutException): any => ({
    ...obj,
  })


(o: any): o is EFSMountTimeoutException => __isa(o, "EFSMountTimeoutException")


(obj: ENILimitReachedException): any => ({
    ...obj,
  })


(o: any): o is ENILimitReachedException => __isa(o, "ENILimitReachedException")


(obj: Environment): any => ({
    ...obj,
    ...(obj.Variables && { Variables: SENSITIVE_STRING }),
  })


(o: any): o is Environment => __isa(o, "Environment")


(obj: EnvironmentError): any => ({
    ...obj,
    ...(obj.Message && { Message: SENSITIVE_STRING }),
  })


(o: any): o is EnvironmentError => __isa(o, "EnvironmentError")


(obj: EnvironmentResponse): any => ({
    ...obj,
    ...(obj.Variables && { Variables: SENSITIVE_STRING }),
    ...(obj.Error && { Error: EnvironmentError.filterSensitiveLog(obj.Error) }),
  })


(o: any): o is EnvironmentResponse => __isa(o, "EnvironmentResponse")


(obj: EventSourceMappingConfiguration): any => ({
    ...obj,
  })


(o: any): o is EventSourceMappingConfiguration => __isa(o, "EventSourceMappingConfiguration")


(obj: FileSystemConfig): any => ({
    ...obj,
  })


(o: any): o is FileSystemConfig => __isa(o, "FileSystemConfig")


(obj: FunctionCode): any => ({
    ...obj,
    ...(obj.ZipFile && { ZipFile: SENSITIVE_STRING }),
  })


(o: any): o is FunctionCode => __isa(o, "FunctionCode")


(obj: FunctionCodeLocation): any => ({
    ...obj,
  })


(o: any): o is FunctionCodeLocation => __isa(o, "FunctionCodeLocation")


(obj: FunctionConfiguration): any => ({
    ...obj,
    ...(obj.Environment && { Environment: EnvironmentResponse.filterSensitiveLog(obj.Environment) }),
  })


(o: any): o is FunctionConfiguration => __isa(o, "FunctionConfiguration")


(obj: FunctionEventInvokeConfig): any => ({
    ...obj,
  })


(o: any): o is FunctionEventInvokeConfig => __isa(o, "FunctionEventInvokeConfig")


(obj: GetAccountSettingsRequest): any => ({
    ...obj,
  })


(o: any): o is GetAccountSettingsRequest => __isa(o, "GetAccountSettingsRequest")


(obj: GetAccountSettingsResponse): any => ({
    ...obj,
  })


(o: any): o is GetAccountSettingsResponse => __isa(o, "GetAccountSettingsResponse")


(obj: GetAliasRequest): any => ({
    ...obj,
  })


(o: any): o is GetAliasRequest => __isa(o, "GetAliasRequest")


(obj: GetEventSourceMappingRequest): any => ({
    ...obj,
  })


(o: any): o is GetEventSourceMappingRequest => __isa(o, "GetEventSourceMappingRequest")


(obj: GetFunctionConcurrencyRequest): any => ({
    ...obj,
  })


(o: any): o is GetFunctionConcurrencyRequest => __isa(o, "GetFunctionConcurrencyRequest")


(obj: GetFunctionConcurrencyResponse): any => ({
    ...obj,
  })


(o: any): o is GetFunctionConcurrencyResponse => __isa(o, "GetFunctionConcurrencyResponse")


(obj: GetFunctionConfigurationRequest): any => ({
    ...obj,
  })


(o: any): o is GetFunctionConfigurationRequest => __isa(o, "GetFunctionConfigurationRequest")


(obj: GetFunctionEventInvokeConfigRequest): any => ({
    ...obj,
  })


(o: any): o is GetFunctionEventInvokeConfigRequest =>
    __isa(o, "GetFunctionEventInvokeConfigRequest")


(obj: GetFunctionRequest): any => ({
    ...obj,
  })


(o: any): o is GetFunctionRequest => __isa(o, "GetFunctionRequest")


(obj: GetFunctionResponse): any => ({
    ...obj,
    ...(obj.Configuration && { Configuration: FunctionConfiguration.filterSensitiveLog(obj.Configuration) }),
  })


(o: any): o is GetFunctionResponse => __isa(o, "GetFunctionResponse")


(obj: GetLayerVersionByArnRequest): any => ({
    ...obj,
  })


(o: any): o is GetLayerVersionByArnRequest => __isa(o, "GetLayerVersionByArnRequest")


(obj: GetLayerVersionPolicyRequest): any => ({
    ...obj,
  })


(o: any): o is GetLayerVersionPolicyRequest => __isa(o, "GetLayerVersionPolicyRequest")


(obj: GetLayerVersionPolicyResponse): any => ({
    ...obj,
  })


(o: any): o is GetLayerVersionPolicyResponse => __isa(o, "GetLayerVersionPolicyResponse")


(obj: GetLayerVersionRequest): any => ({
    ...obj,
  })


(o: any): o is GetLayerVersionRequest => __isa(o, "GetLayerVersionRequest")


(obj: GetLayerVersionResponse): any => ({
    ...obj,
  })


(o: any): o is GetLayerVersionResponse => __isa(o, "GetLayerVersionResponse")


(obj: GetPolicyRequest): any => ({
    ...obj,
  })


(o: any): o is GetPolicyRequest => __isa(o, "GetPolicyRequest")


(obj: GetPolicyResponse): any => ({
    ...obj,
  })


(o: any): o is GetPolicyResponse => __isa(o, "GetPolicyResponse")


(obj: GetProvisionedConcurrencyConfigRequest): any => ({
    ...obj,
  })


(o: any): o is GetProvisionedConcurrencyConfigRequest =>
    __isa(o, "GetProvisionedConcurrencyConfigRequest")


(obj: GetProvisionedConcurrencyConfigResponse): any => ({
    ...obj,
  })


(o: any): o is GetProvisionedConcurrencyConfigResponse =>
    __isa(o, "GetProvisionedConcurrencyConfigResponse")


(obj: InvalidParameterValueException): any => ({
    ...obj,
  })


(o: any): o is InvalidParameterValueException => __isa(o, "InvalidParameterValueException")


(obj: InvalidRequestContentException): any => ({
    ...obj,
  })


(o: any): o is InvalidRequestContentException => __isa(o, "InvalidRequestContentException")


(obj: InvalidRuntimeException): any => ({
    ...obj,
  })


(o: any): o is InvalidRuntimeException => __isa(o, "InvalidRuntimeException")


(obj: InvalidSecurityGroupIDException): any => ({
    ...obj,
  })


(o: any): o is InvalidSecurityGroupIDException => __isa(o, "InvalidSecurityGroupIDException")


(obj: InvalidSubnetIDException): any => ({
    ...obj,
  })


(o: any): o is InvalidSubnetIDException => __isa(o, "InvalidSubnetIDException")


(obj: InvalidZipFileException): any => ({
    ...obj,
  })


(o: any): o is InvalidZipFileException => __isa(o, "InvalidZipFileException")


(obj: InvocationRequest): any => ({
    ...obj,
    ...(obj.Payload && { Payload: SENSITIVE_STRING }),
  })


(o: any): o is InvocationRequest => __isa(o, "InvocationRequest")


(obj: InvocationResponse): any => ({
    ...obj,
    ...(obj.Payload && { Payload: SENSITIVE_STRING }),
  })


(o: any): o is InvocationResponse => __isa(o, "InvocationResponse")


(obj: InvokeAsyncRequest): any => ({
    ...obj,
  })


(o: any): o is InvokeAsyncRequest => __isa(o, "InvokeAsyncRequest")


(obj: InvokeAsyncResponse): any => ({
    ...obj,
  })


(o: any): o is InvokeAsyncResponse => __isa(o, "InvokeAsyncResponse")


(obj: KMSAccessDeniedException): any => ({
    ...obj,
  })


(o: any): o is KMSAccessDeniedException => __isa(o, "KMSAccessDeniedException")


(obj: KMSDisabledException): any => ({
    ...obj,
  })


(o: any): o is KMSDisabledException => __isa(o, "KMSDisabledException")


(obj: KMSInvalidStateException): any => ({
    ...obj,
  })


(o: any): o is KMSInvalidStateException => __isa(o, "KMSInvalidStateException")


(obj: KMSNotFoundException): any => ({
    ...obj,
  })


(o: any): o is KMSNotFoundException => __isa(o, "KMSNotFoundException")


(obj: Layer): any => ({
    ...obj,
  })


(o: any): o is Layer => __isa(o, "Layer")


(obj: LayersListItem): any => ({
    ...obj,
  })


(o: any): o is LayersListItem => __isa(o, "LayersListItem")


(obj: LayerVersionContentInput): any => ({
    ...obj,
    ...(obj.ZipFile && { ZipFile: SENSITIVE_STRING }),
  })


(o: any): o is LayerVersionContentInput => __isa(o, "LayerVersionContentInput")


(obj: LayerVersionContentOutput): any => ({
    ...obj,
  })


(o: any): o is LayerVersionContentOutput => __isa(o, "LayerVersionContentOutput")


(obj: LayerVersionsListItem): any => ({
    ...obj,
  })


(o: any): o is LayerVersionsListItem => __isa(o, "LayerVersionsListItem")


(obj: ListAliasesRequest): any => ({
    ...obj,
  })


(o: any): o is ListAliasesRequest => __isa(o, "ListAliasesRequest")


(obj: ListAliasesResponse): any => ({
    ...obj,
  })


(o: any): o is ListAliasesResponse => __isa(o, "ListAliasesResponse")


(obj: ListEventSourceMappingsRequest): any => ({
    ...obj,
  })


(o: any): o is ListEventSourceMappingsRequest => __isa(o, "ListEventSourceMappingsRequest")


(obj: ListEventSourceMappingsResponse): any => ({
    ...obj,
  })


(o: any): o is ListEventSourceMappingsResponse => __isa(o, "ListEventSourceMappingsResponse")


(obj: ListFunctionEventInvokeConfigsRequest): any => ({
    ...obj,
  })


(o: any): o is ListFunctionEventInvokeConfigsRequest =>
    __isa(o, "ListFunctionEventInvokeConfigsRequest")


(obj: ListFunctionEventInvokeConfigsResponse): any => ({
    ...obj,
  })


(o: any): o is ListFunctionEventInvokeConfigsResponse =>
    __isa(o, "ListFunctionEventInvokeConfigsResponse")


(obj: ListFunctionsRequest): any => ({
    ...obj,
  })


(o: any): o is ListFunctionsRequest => __isa(o, "ListFunctionsRequest")


(obj: ListFunctionsResponse): any => ({
    ...obj,
    ...(obj.Functions && { Functions: obj.Functions.map((item) => FunctionConfiguration.filterSensitiveLog(item)) }),
  })


(item) => FunctionConfiguration.filterSensitiveLog(item)


(o: any): o is ListFunctionsResponse => __isa(o, "ListFunctionsResponse")


(obj: ListLayersRequest): any => ({
    ...obj,
  })


(o: any): o is ListLayersRequest => __isa(o, "ListLayersRequest")


(obj: ListLayersResponse): any => ({
    ...obj,
  })


(o: any): o is ListLayersResponse => __isa(o, "ListLayersResponse")


(obj: ListLayerVersionsRequest): any => ({
    ...obj,
  })


(o: any): o is ListLayerVersionsRequest => __isa(o, "ListLayerVersionsRequest")


(obj: ListLayerVersionsResponse): any => ({
    ...obj,
  })


(o: any): o is ListLayerVersionsResponse => __isa(o, "ListLayerVersionsResponse")


(obj: ListProvisionedConcurrencyConfigsRequest): any => ({
    ...obj,
  })


(o: any): o is ListProvisionedConcurrencyConfigsRequest =>
    __isa(o, "ListProvisionedConcurrencyConfigsRequest")


(obj: ListProvisionedConcurrencyConfigsResponse): any => ({
    ...obj,
  })


(o: any): o is ListProvisionedConcurrencyConfigsResponse =>
    __isa(o, "ListProvisionedConcurrencyConfigsResponse")


(obj: ListTagsRequest): any => ({
    ...obj,
  })


(o: any): o is ListTagsRequest => __isa(o, "ListTagsRequest")


(obj: ListTagsResponse): any => ({
    ...obj,
  })


(o: any): o is ListTagsResponse => __isa(o, "ListTagsResponse")


(obj: ListVersionsByFunctionRequest): any => ({
    ...obj,
  })


(o: any): o is ListVersionsByFunctionRequest => __isa(o, "ListVersionsByFunctionRequest")


(obj: ListVersionsByFunctionResponse): any => ({
    ...obj,
    ...(obj.Versions && { Versions: obj.Versions.map((item) => FunctionConfiguration.filterSensitiveLog(item)) }),
  })


(o: any): o is ListVersionsByFunctionResponse => __isa(o, "ListVersionsByFunctionResponse")


(obj: OnFailure): any => ({
    ...obj,
  })


(o: any): o is OnFailure => __isa(o, "OnFailure")


(obj: OnSuccess): any => ({
    ...obj,
  })


(o: any): o is OnSuccess => __isa(o, "OnSuccess")


(obj: PolicyLengthExceededException): any => ({
    ...obj,
  })


(o: any): o is PolicyLengthExceededException => __isa(o, "PolicyLengthExceededException")


(obj: PreconditionFailedException): any => ({
    ...obj,
  })


(o: any): o is PreconditionFailedException => __isa(o, "PreconditionFailedException")


(obj: ProvisionedConcurrencyConfigListItem): any => ({
    ...obj,
  })


(o: any): o is ProvisionedConcurrencyConfigListItem =>
    __isa(o, "ProvisionedConcurrencyConfigListItem")


(obj: ProvisionedConcurrencyConfigNotFoundException): any => ({
    ...obj,
  })


(o: any): o is ProvisionedConcurrencyConfigNotFoundException =>
    __isa(o, "ProvisionedConcurrencyConfigNotFoundException")


(obj: PublishLayerVersionRequest): any => ({
    ...obj,
    ...(obj.Content && { Content: LayerVersionContentInput.filterSensitiveLog(obj.Content) }),
  })


(o: any): o is PublishLayerVersionRequest => __isa(o, "PublishLayerVersionRequest")


(obj: PublishLayerVersionResponse): any => ({
    ...obj,
  })


(o: any): o is PublishLayerVersionResponse => __isa(o, "PublishLayerVersionResponse")


(obj: PublishVersionRequest): any => ({
    ...obj,
  })


(o: any): o is PublishVersionRequest => __isa(o, "PublishVersionRequest")


(obj: PutFunctionConcurrencyRequest): any => ({
    ...obj,
  })


(o: any): o is PutFunctionConcurrencyRequest => __isa(o, "PutFunctionConcurrencyRequest")


(obj: PutFunctionEventInvokeConfigRequest): any => ({
    ...obj,
  })


(o: any): o is PutFunctionEventInvokeConfigRequest =>
    __isa(o, "PutFunctionEventInvokeConfigRequest")


(obj: PutProvisionedConcurrencyConfigRequest): any => ({
    ...obj,
  })


(o: any): o is PutProvisionedConcurrencyConfigRequest =>
    __isa(o, "PutProvisionedConcurrencyConfigRequest")


(obj: PutProvisionedConcurrencyConfigResponse): any => ({
    ...obj,
  })


(o: any): o is PutProvisionedConcurrencyConfigResponse =>
    __isa(o, "PutProvisionedConcurrencyConfigResponse")


(obj: RemoveLayerVersionPermissionRequest): any => ({
    ...obj,
  })


(o: any): o is RemoveLayerVersionPermissionRequest =>
    __isa(o, "RemoveLayerVersionPermissionRequest")


(obj: RemovePermissionRequest): any => ({
    ...obj,
  })


(o: any): o is RemovePermissionRequest => __isa(o, "RemovePermissionRequest")


(obj: RequestTooLargeException): any => ({
    ...obj,
  })


(o: any): o is RequestTooLargeException => __isa(o, "RequestTooLargeException")


(obj: ResourceConflictException): any => ({
    ...obj,
  })


(o: any): o is ResourceConflictException => __isa(o, "ResourceConflictException")


(obj: ResourceInUseException): any => ({
    ...obj,
  })


(o: any): o is ResourceInUseException => __isa(o, "ResourceInUseException")


(obj: ResourceNotFoundException): any => ({
    ...obj,
  })


(o: any): o is ResourceNotFoundException => __isa(o, "ResourceNotFoundException")


(obj: ResourceNotReadyException): any => ({
    ...obj,
  })


(o: any): o is ResourceNotReadyException => __isa(o, "ResourceNotReadyException")


(obj: ServiceException): any => ({
    ...obj,
  })


(o: any): o is ServiceException => __isa(o, "ServiceException")


(obj: SubnetIPAddressLimitReachedException): any => ({
    ...obj,
  })


(o: any): o is SubnetIPAddressLimitReachedException =>
    __isa(o, "SubnetIPAddressLimitReachedException")


(obj: TagResourceRequest): any => ({
    ...obj,
  })


(o: any): o is TagResourceRequest => __isa(o, "TagResourceRequest")


(obj: TooManyRequestsException): any => ({
    ...obj,
  })


(o: any): o is TooManyRequestsException => __isa(o, "TooManyRequestsException")


(obj: TracingConfig): any => ({
    ...obj,
  })


(o: any): o is TracingConfig => __isa(o, "TracingConfig")


(obj: TracingConfigResponse): any => ({
    ...obj,
  })


(o: any): o is TracingConfigResponse => __isa(o, "TracingConfigResponse")


(obj: UnsupportedMediaTypeException): any => ({
    ...obj,
  })


(o: any): o is UnsupportedMediaTypeException => __isa(o, "UnsupportedMediaTypeException")


(obj: UntagResourceRequest): any => ({
    ...obj,
  })


(o: any): o is UntagResourceRequest => __isa(o, "UntagResourceRequest")


(obj: UpdateAliasRequest): any => ({
    ...obj,
  })


(o: any): o is UpdateAliasRequest => __isa(o, "UpdateAliasRequest")


(obj: UpdateEventSourceMappingRequest): any => ({
    ...obj,
  })


(o: any): o is UpdateEventSourceMappingRequest => __isa(o, "UpdateEventSourceMappingRequest")


(obj: UpdateFunctionCodeRequest): any => ({
    ...obj,
    ...(obj.ZipFile && { ZipFile: SENSITIVE_STRING }),
  })


(o: any): o is UpdateFunctionCodeRequest => __isa(o, "UpdateFunctionCodeRequest")


(obj: UpdateFunctionConfigurationRequest): any => ({
    ...obj,
    ...(obj.Environment && { Environment: Environment.filterSensitiveLog(obj.Environment) }),
  })


(o: any): o is UpdateFunctionConfigurationRequest =>
    __isa(o, "UpdateFunctionConfigurationRequest")


(obj: UpdateFunctionEventInvokeConfigRequest): any => ({
    ...obj,
  })


(o: any): o is UpdateFunctionEventInvokeConfigRequest =>
    __isa(o, "UpdateFunctionEventInvokeConfigRequest")


(obj: VpcConfig): any => ({
    ...obj,
  })


(o: any): o is VpcConfig => __isa(o, "VpcConfig")


(obj: VpcConfigResponse): any => ({
    ...obj,
  })


(o: any): o is VpcConfigResponse => __isa(o, "VpcConfigResponse")


/**
 *
Limits that are related to concurrency and storage. All file and storage sizes are in bytes.

 */
export interface AccountLimit {
  __type?: "AccountLimit";
  /**
   *
The maximum number of simultaneous function executions.

   */
  ConcurrentExecutions?: number;

  /**
   *
The amount of storage space that you can use for all deployment packages and layer archives.

   */
  TotalCodeSize?: number;

  /**
   *
The maximum size of a deployment package when it's uploaded directly to AWS Lambda. Use Amazon S3 for larger
   *       files.

   */
  CodeSizeZipped?: number;

  /**
   *
The maximum number of simultaneous function executions, minus the capacity that's reserved for individual
   *       functions with PutFunctionConcurrency.

   */
  UnreservedConcurrentExecutions?: number;

  /**
   *
The maximum size of a function's deployment package and layers when they're extracted.

   */
  CodeSizeUnzipped?: number;
}


/**
 *
The number of functions and amount of storage in use.

 */
export interface AccountUsage {
  __type?: "AccountUsage";
  /**
   *
The number of Lambda functions.

   */
  FunctionCount?: number;

  /**
   *
The amount of storage space, in bytes, that's being used by deployment packages and layer archives.

   */
  TotalCodeSize?: number;
}


export interface AddLayerVersionPermissionRequest {
  __type?: "AddLayerVersionPermissionRequest";
  /**
   *
The API action that grants access to the layer. For example, lambda:GetLayerVersion.

   */
  Action: string | undefined;

  /**
   *
An identifier that distinguishes the policy from others on the same layer version.

   */
  StatementId: string | undefined;

  /**
   *
An account ID, or * to grant permission to all AWS accounts.

   */
  Principal: string | undefined;

  /**
   *
Only update the policy if the revision ID matches the ID specified. Use this option to avoid modifying a
   *       policy that has changed since you last read it.

   */
  RevisionId?: string;

  /**
   *
The version number.

   */
  VersionNumber: number | undefined;

  /**
   *
The name or Amazon Resource Name (ARN) of the layer.

   */
  LayerName: string | undefined;

  /**
   *
With the principal set to *, grant permission to all accounts in the specified
   *       organization.

   */
  OrganizationId?: string;
}


export interface AddLayerVersionPermissionResponse {
  __type?: "AddLayerVersionPermissionResponse";
  /**
   *
A unique identifier for the current revision of the policy.

   */
  RevisionId?: string;

  /**
   *
The permission statement.

   */
  Statement?: string;
}


export interface AddPermissionRequest {
  __type?: "AddPermissionRequest";
  /**
   *
The action that the principal can use on the function. For example, lambda:InvokeFunction or
   *         lambda:GetFunction.

   */
  Action: string | undefined;

  /**
   *
For AWS services, the ARN of the AWS resource that invokes the function. For example, an Amazon S3 bucket or
   *       Amazon SNS topic.

   */
  SourceArn?: string;

  /**
   *
For Amazon S3, the ID of the account that owns the resource. Use this together with SourceArn to
   *       ensure that the resource is owned by the specified account. It is possible for an Amazon S3 bucket to be deleted
   *       by its owner and recreated by another account.

   */
  SourceAccount?: string;

  /**
   *
A statement identifier that differentiates the statement from others in the same policy.

   */
  StatementId: string | undefined;

  /**
   *
The name of the Lambda function, version, or alias.

   *

   *             Name formats
   *

   *

   *

   *

   *                   Function name - my-function (name-only), my-function:v1 (with alias).

   *

   *

   *

   *                   Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.

   *

   *

   *

   *                   Partial ARN - 123456789012:function:my-function.

   *

   *

   *
You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN.
   *       If you specify only the function name, it is limited to 64 characters in length.

   */
  FunctionName: string | undefined;

  /**
   *
For Alexa Smart Home functions, a token that must be supplied by the invoker.

   */
  EventSourceToken?: string;

  /**
   *
Specify a version or alias to add permissions to a published version of the function.

   */
  Qualifier?: string;

  /**
   *
The AWS service or account that invokes the function. If you specify a service, use SourceArn or
   *         SourceAccount to limit who can invoke the function through that service.

   */
  Principal: string | undefined;

  /**
   *
Only update the policy if the revision ID matches the ID that's specified. Use this option to avoid modifying a
   *       policy that has changed since you last read it.

   */
  RevisionId?: string;
}


export interface AddPermissionResponse {
  __type?: "AddPermissionResponse";
  /**
   *
The permission statement that's added to the function policy.

   */
  Statement?: string;
}


/**
 *
Provides configuration information about a Lambda function alias.

 */
export interface AliasConfiguration {
  __type?: "AliasConfiguration";
  /**
   *
The routing
   *         configuration of the alias.

   */
  RoutingConfig?: AliasRoutingConfiguration;

  /**
   *
The name of the alias.

   */
  Name?: string;

  /**
   *
The Amazon Resource Name (ARN) of the alias.

   */
  AliasArn?: string;

  /**
   *
A unique identifier that changes when you update the alias.

   */
  RevisionId?: string;

  /**
   *
The function version that the alias invokes.

   */
  FunctionVersion?: string;

  /**
   *
A description of the alias.

   */
  Description?: string;
}


/**
 *
The traffic-shifting configuration of a Lambda function alias.

 */
export interface AliasRoutingConfiguration {
  __type?: "AliasRoutingConfiguration";
  /**
   *
The second version, and the percentage of traffic that's routed to it.

   */
  AdditionalVersionWeights?: { [key: string]: number };
}


/**
 *
You have exceeded your maximum total code size per account. Learn more
 *

 */
export interface CodeStorageExceededException extends __SmithyException, $MetadataBearer {
  name: "CodeStorageExceededException";
  $fault: "client";
  message?: string;
  /**
   *
The exception type.

   */
  Type?: string;
}


export interface Concurrency {
  __type?: "Concurrency";
  /**
   *
The number of concurrent executions that are reserved for this function. For more information, see Managing Concurrency.

   */
  ReservedConcurrentExecutions?: number;
}


export interface CreateAliasRequest {
  __type?: "CreateAliasRequest";
  /**
   *
The routing
   *         configuration of the alias.

   */
  RoutingConfig?: AliasRoutingConfiguration;

  /**
   *
The name of the Lambda function.

   *

   *             Name formats
   *

   *

   *

   *

   *                   Function name - MyFunction.

   *

   *

   *

   *                   Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.

   *

   *

   *

   *                   Partial ARN - 123456789012:function:MyFunction.

   *

   *

   *
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64
   *       characters in length.

   */
  FunctionName: string | undefined;

  /**
   *
A description of the alias.

   */
  Description?: string;

  /**
   *
The function version that the alias invokes.

   */
  FunctionVersion: string | undefined;

  /**
   *
The name of the alias.

   */
  Name: string | undefined;
}


export interface CreateEventSourceMappingRequest {
  __type?: "CreateEventSourceMappingRequest";
  /**
   *
Disables the event source mapping to pause polling and invocation.

   */
  Enabled?: boolean;

  /**
   *
(Streams) An Amazon SQS queue or Amazon SNS topic destination for discarded records.

   */
  DestinationConfig?: DestinationConfig;

  /**
   *
(Streams) If the function returns an error, split the batch in two and retry.

   */
  BisectBatchOnFunctionError?: boolean;

  /**
   *
With StartingPosition set to AT_TIMESTAMP, the time from which to start
   *       reading.

   */
  StartingPositionTimestamp?: Date;

  /**
   *
(Streams) The number of batches to process from each shard concurrently.

   */
  ParallelizationFactor?: number;

  /**
   *
The maximum number of items to retrieve in a single batch.

   *

   *

   *

   *                   Amazon Kinesis - Default 100. Max 10,000.

   *

   *

   *

   *                   Amazon DynamoDB Streams - Default 100. Max 1,000.

   *

   *

   *

   *                   Amazon Simple Queue Service - Default 10. Max 10.

   *

   *

   */
  BatchSize?: number;

  /**
   *
(Streams) The maximum number of times to retry when the function returns an error.

   */
  MaximumRetryAttempts?: number;

  /**
   *
The name of the Lambda function.

   *

   *             Name formats
   *

   *

   *

   *

   *                   Function name - MyFunction.

   *

   *

   *

   *                   Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.

   *

   *

   *

   *                   Version or Alias ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD.

   *

   *

   *

   *                   Partial ARN - 123456789012:function:MyFunction.

   *

   *

   *
The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64
   *       characters in length.

   */
  FunctionName: string | undefined;

  /**
   *
(Streams) The maximum age of a record that Lambda sends to a function for processing.

   */
  MaximumRecordAgeInSeconds?: number;

  /**
   *
The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB Streams
   *       sources. AT_TIMESTAMP is only supported for Amazon Kinesis streams.

   */
  StartingPosition?: EventSourcePosition | string;

  /**
   *
(Streams) The maximum amount of time to gather records before invoking the function, in seconds.

   */
  MaximumBatchingWindowInSeconds?: number;

  /**
   *
The Amazon Resource Name (ARN) of the event source.

   *

   *

   *

   *                   Amazon Kinesis - The ARN of the data stream or a stream consumer.

   *

   *

   *

   *                   Amazon DynamoDB Streams - The ARN of the stream.

   *

   *

   *

   *                   Amazon Simple Queue Service - The ARN of the queue.

   *

   *

   */
  EventSourceArn: string | undefined;
}