@Test public void getSetVMPowerStateRequestBody() { final String requestBody = setVMPowerStateBody(nutanixSetVMPowerStateInputs); assertEquals(EXPECTED_SET_POWER_STATE_OF_VM_REQUEST_BODY, requestBody); }
@NotNull public static String setVMPowerStateBody(NutanixSetVMPowerStateInputs nutanixSetVMPowerStateInputs) { String requestBody = EMPTY; ObjectMapper setPowerStateMapper = new ObjectMapper(); SetVMPowerStateRequestBody setPowerStateBody = new SetVMPowerStateRequestBody(); SetVMPowerStateRequestBody.SetPowerStateData setPowerStateData = setPowerStateBody.new SetPowerStateData(); setPowerStateData.setHost_uuid(nutanixSetVMPowerStateInputs.getHostUUID()); setPowerStateData.setUuid(nutanixSetVMPowerStateInputs.getVMUUID()); setPowerStateData.setTransition(nutanixSetVMPowerStateInputs.getTransition()); if (!nutanixSetVMPowerStateInputs.getVmLogicalTimestamp().isEmpty()) setPowerStateData.setVm_logical_timestamp(Integer.parseInt(nutanixSetVMPowerStateInputs.getVmLogicalTimestamp())); try { requestBody = setPowerStateMapper.writeValueAsString(setPowerStateData); } catch (JsonProcessingException e) { e.printStackTrace(); } return requestBody; }
VMImpl { @NotNull public static String setVMPowerStateBody(NutanixSetVMPowerStateInputs nutanixSetVMPowerStateInputs) { String requestBody = EMPTY; ObjectMapper setPowerStateMapper = new ObjectMapper(); SetVMPowerStateRequestBody setPowerStateBody = new SetVMPowerStateRequestBody(); SetVMPowerStateRequestBody.SetPowerStateData setPowerStateData = setPowerStateBody.new SetPowerStateData(); setPowerStateData.setHost_uuid(nutanixSetVMPowerStateInputs.getHostUUID()); setPowerStateData.setUuid(nutanixSetVMPowerStateInputs.getVMUUID()); setPowerStateData.setTransition(nutanixSetVMPowerStateInputs.getTransition()); if (!nutanixSetVMPowerStateInputs.getVmLogicalTimestamp().isEmpty()) setPowerStateData.setVm_logical_timestamp(Integer.parseInt(nutanixSetVMPowerStateInputs.getVmLogicalTimestamp())); try { requestBody = setPowerStateMapper.writeValueAsString(setPowerStateData); } catch (JsonProcessingException e) { e.printStackTrace(); } return requestBody; } }
VMImpl { @NotNull public static String setVMPowerStateBody(NutanixSetVMPowerStateInputs nutanixSetVMPowerStateInputs) { String requestBody = EMPTY; ObjectMapper setPowerStateMapper = new ObjectMapper(); SetVMPowerStateRequestBody setPowerStateBody = new SetVMPowerStateRequestBody(); SetVMPowerStateRequestBody.SetPowerStateData setPowerStateData = setPowerStateBody.new SetPowerStateData(); setPowerStateData.setHost_uuid(nutanixSetVMPowerStateInputs.getHostUUID()); setPowerStateData.setUuid(nutanixSetVMPowerStateInputs.getVMUUID()); setPowerStateData.setTransition(nutanixSetVMPowerStateInputs.getTransition()); if (!nutanixSetVMPowerStateInputs.getVmLogicalTimestamp().isEmpty()) setPowerStateData.setVm_logical_timestamp(Integer.parseInt(nutanixSetVMPowerStateInputs.getVmLogicalTimestamp())); try { requestBody = setPowerStateMapper.writeValueAsString(setPowerStateData); } catch (JsonProcessingException e) { e.printStackTrace(); } return requestBody; }  }
VMImpl { @NotNull public static String setVMPowerStateBody(NutanixSetVMPowerStateInputs nutanixSetVMPowerStateInputs) { String requestBody = EMPTY; ObjectMapper setPowerStateMapper = new ObjectMapper(); SetVMPowerStateRequestBody setPowerStateBody = new SetVMPowerStateRequestBody(); SetVMPowerStateRequestBody.SetPowerStateData setPowerStateData = setPowerStateBody.new SetPowerStateData(); setPowerStateData.setHost_uuid(nutanixSetVMPowerStateInputs.getHostUUID()); setPowerStateData.setUuid(nutanixSetVMPowerStateInputs.getVMUUID()); setPowerStateData.setTransition(nutanixSetVMPowerStateInputs.getTransition()); if (!nutanixSetVMPowerStateInputs.getVmLogicalTimestamp().isEmpty()) setPowerStateData.setVm_logical_timestamp(Integer.parseInt(nutanixSetVMPowerStateInputs.getVmLogicalTimestamp())); try { requestBody = setPowerStateMapper.writeValueAsString(setPowerStateData); } catch (JsonProcessingException e) { e.printStackTrace(); } return requestBody; }  @NotNull static Map<String, String> listVMs(@NotNull final NutanixListVMsInputs nutanixListVMsInputs); @NotNull static Map<String, String> createVM(@NotNull final NutanixCreateVMInputs nutanixCreateVMInputs); @NotNull static Map<String, String> updateVM(@NotNull final NutanixUpdateVMInputs nutanixUpdateVMInputs); @NotNull static Map<String, String> deleteVM(@NotNull final NutanixDeleteVMInputs nutanixDeleteVMInputs); @NotNull static Map<String, String> setVMPowerState(@NotNull final NutanixSetVMPowerStateInputs nutanixSetVMPowerStateInputs); @NotNull static Map<String, String> getVMDetails(@NotNull final NutanixGetVMDetailsInputs nutanixGetVMDetailsInputs); @NotNull static String listVMsURL(NutanixListVMsInputs nutanixListVMsInputs); @NotNull static String getVMDetailsURL(NutanixGetVMDetailsInputs nutanixGetVMDetailsInputs); @NotNull static String createVMURL(NutanixCreateVMInputs nutanixCreateVMInputs); @NotNull static String updateVMURL(NutanixUpdateVMInputs nutanixUpdateVMInputs); static String deleteVMURL(NutanixDeleteVMInputs nutanixDeleteVMInputs); @NotNull static String setVMPowerStateURL(NutanixSetVMPowerStateInputs nutanixSetVMPowerStateInputs); @NotNull static String createVMBody(NutanixCreateVMInputs nutanixCreateVMInputs, String delimiter); @NotNull static String setVMPowerStateBody(NutanixSetVMPowerStateInputs nutanixSetVMPowerStateInputs); @NotNull static String updateVMBody(NutanixUpdateVMInputs nutanixUpdateVMInputs, String delimiter); }
VMImpl { @NotNull public static String setVMPowerStateBody(NutanixSetVMPowerStateInputs nutanixSetVMPowerStateInputs) { String requestBody = EMPTY; ObjectMapper setPowerStateMapper = new ObjectMapper(); SetVMPowerStateRequestBody setPowerStateBody = new SetVMPowerStateRequestBody(); SetVMPowerStateRequestBody.SetPowerStateData setPowerStateData = setPowerStateBody.new SetPowerStateData(); setPowerStateData.setHost_uuid(nutanixSetVMPowerStateInputs.getHostUUID()); setPowerStateData.setUuid(nutanixSetVMPowerStateInputs.getVMUUID()); setPowerStateData.setTransition(nutanixSetVMPowerStateInputs.getTransition()); if (!nutanixSetVMPowerStateInputs.getVmLogicalTimestamp().isEmpty()) setPowerStateData.setVm_logical_timestamp(Integer.parseInt(nutanixSetVMPowerStateInputs.getVmLogicalTimestamp())); try { requestBody = setPowerStateMapper.writeValueAsString(setPowerStateData); } catch (JsonProcessingException e) { e.printStackTrace(); } return requestBody; }  @NotNull static Map<String, String> listVMs(@NotNull final NutanixListVMsInputs nutanixListVMsInputs); @NotNull static Map<String, String> createVM(@NotNull final NutanixCreateVMInputs nutanixCreateVMInputs); @NotNull static Map<String, String> updateVM(@NotNull final NutanixUpdateVMInputs nutanixUpdateVMInputs); @NotNull static Map<String, String> deleteVM(@NotNull final NutanixDeleteVMInputs nutanixDeleteVMInputs); @NotNull static Map<String, String> setVMPowerState(@NotNull final NutanixSetVMPowerStateInputs nutanixSetVMPowerStateInputs); @NotNull static Map<String, String> getVMDetails(@NotNull final NutanixGetVMDetailsInputs nutanixGetVMDetailsInputs); @NotNull static String listVMsURL(NutanixListVMsInputs nutanixListVMsInputs); @NotNull static String getVMDetailsURL(NutanixGetVMDetailsInputs nutanixGetVMDetailsInputs); @NotNull static String createVMURL(NutanixCreateVMInputs nutanixCreateVMInputs); @NotNull static String updateVMURL(NutanixUpdateVMInputs nutanixUpdateVMInputs); static String deleteVMURL(NutanixDeleteVMInputs nutanixDeleteVMInputs); @NotNull static String setVMPowerStateURL(NutanixSetVMPowerStateInputs nutanixSetVMPowerStateInputs); @NotNull static String createVMBody(NutanixCreateVMInputs nutanixCreateVMInputs, String delimiter); @NotNull static String setVMPowerStateBody(NutanixSetVMPowerStateInputs nutanixSetVMPowerStateInputs); @NotNull static String updateVMBody(NutanixUpdateVMInputs nutanixUpdateVMInputs, String delimiter);  }