code: public void setAgentNotReady(
              String workMode,
              String reasonCode,
              KeyValueCollection reasons,
              KeyValueCollection extensions
      ) throws WorkspaceApiException {
          try {
              NotReadyData data = new NotReadyData();
  
              VoicenotreadyData notReadyData = new VoicenotreadyData();
              notReadyData.setReasonCode(reasonCode);
              notReadyData.setReasons(Util.toKVList(reasons));
              notReadyData.setExtensions(Util.toKVList(extensions));
  
              if (workMode != null) {
                  notReadyData.setAgentWorkMode(VoicenotreadyData.AgentWorkModeEnum.fromValue(workMode));
              }
  
              data.data(notReadyData);
  
              ApiSuccessResponse response = this.voiceApi.setAgentStateNotReady(data);
              throwIfNotOk("setAgentNotReady", response);
          } catch (ApiException e) {
              throw new WorkspaceApiException("setAgentReady failed.", e);
          }
      }
docs: Set the current agent's state to NotReady on the voice channel.
  @param workMode The agent workmode. Possible values are `AfterCallWork`, `AuxWork`, `LegalGuard`, `NoCallDisconnect`, `WalkAway`. (optional)
  @param reasonCode The reason code representing why the agent is not ready. These codes are a business-defined set of categories, such as "Lunch" or "Training". (optional)
  @param reasons Information on causes for, and results of, actions taken by the user of the current DN. For details about reasons, refer to the [*Genesys Events and Models Reference Manual*](https://docs.genesys.com/Documentation/System/Current/GenEM/Reasons). (optional)
  @param extensions Media device/hardware reason codes and similar information. For details about extensions, refer to the [*Genesys Events and Models Reference Manual*](https://docs.genesys.com/Documentation/System/Current/GenEM/Extensions). (optional)