Interface for the internal command processor response object, hides the fields that are required to fully build the response from the handlers.

export
interface

  ICommandProcessorResponseApi

### Hierarchy

- ICommandResponseApi

### Implemented by

- CommandResponse
- CommandResponse

## Index

### Properties

- responseFormat
- silent

### Methods

- buildJsonResponse
- endProgressBar
- failed
- setError
- succeeded
- writeJsonResponse

## Properties

### responseFormat

responseFormat: COMMAND_RESPONSE_FORMAT

- Defined in @zowe/imperative/src/cmd/src/doc/response/api/processor/ICommandResponseApi.ts:33

Returns the response format that the object was constructed with - indicates how the output should be handled if response format is JSON, then data is buffered until the end and output at that time.

returns
  - The response format for this command.
memberof

  ICommandProcessorResponseApi

### silent

silent: boolean

- Defined in @zowe/imperative/src/cmd/src/doc/response/api/processor/ICommandResponseApi.ts:39

If true, indicates that silent mode is enabled (no output whatsoever is produced by the response object)

returns
memberof

  ICommandProcessorResponseApi

## Methods

### buildJsonResponse

- buildJsonResponse(): ICommandResponse

- - Defined in @zowe/imperative/src/cmd/src/doc/response/api/processor/ICommandResponseApi.ts:64

  Returns the formed JSON response from the command.

  memberof

    ICommandProcessorResponseApi

  #### Returns ICommandResponse

  - The fully formed JSON response object from the command.

### endProgressBar

- endProgressBar(): void

- - Defined in @zowe/imperative/src/cmd/src/doc/response/api/processor/ICommandResponseApi.ts:74

  End any outstanding progress bars.

  memberof

    ICommandResponseApi

  #### Returns void

### failed

- failed(): void

- - Defined in @zowe/imperative/src/cmd/src/doc/response/api/processor/ICommandResponseApi.ts:45

  Sets the command success property to false, indicating that the command has failed. Command failure is indicated by the handler rejecting its promise.

  memberof

    ICommandResponseApi

  #### Returns void

### setError

- setError(details: IImperativeError): void

- - Defined in @zowe/imperative/src/cmd/src/doc/response/api/processor/ICommandResponseApi.ts:58

  If the command is rejected, this will automatically be populated with all the error details from the Imperative Error object.

  memberof

    ICommandProcessorResponseApi

  #### Parameters

  - ##### details: IImperativeError

  #### Returns void

### succeeded

- succeeded(): void

- - Defined in @zowe/imperative/src/cmd/src/doc/response/api/processor/ICommandResponseApi.ts:51

  Sets the command success property to true, indicating that the command has succeeded. Command success is indicated by the handler fulfilling its promise.

  memberof

    ICommandResponseApi

  #### Returns void

### writeJsonResponse

- writeJsonResponse(): ICommandResponse

- - Defined in @zowe/imperative/src/cmd/src/doc/response/api/processor/ICommandResponseApi.ts:69

  Writes the command response object to the console. Always written to stdout.

  memberof

    ICommandProcessorResponseApi

  #### Returns ICommandResponse

Generated using TypeDoc