class WorkspaceVariableImpl {

    @NotNull
    public static String createWorkspaceVariableRequestBody(TerraformWorkspaceVariableInputs terraformWorkspaceVariableInputs) {
        String requestBody = EMPTY;
        ObjectMapper createWorkspaceVariableMapper = new ObjectMapper();
        CreateWorkspaceVariableRequestBody createWorkspaceVariableRequestBody = new CreateWorkspaceVariableRequestBody();
        CreateWorkspaceVariableRequestBody.CreateWorkspaceVariableData createWorkspaceVariableData = createWorkspaceVariableRequestBody.new CreateWorkspaceVariableData();
        createWorkspaceVariableData.setType(WORKSPACE_VARIABLE_TYPE);

        CreateWorkspaceVariableRequestBody.Attributes attributes = createWorkspaceVariableRequestBody.new Attributes();
        attributes.setKey(terraformWorkspaceVariableInputs.getWorkspaceVariableName());
        if (terraformWorkspaceVariableInputs.getWorkspaceVariableValue().isEmpty()) {
            attributes.setValue(terraformWorkspaceVariableInputs.getSensitiveWorkspaceVariableValue());
        } else {
            attributes.setValue(terraformWorkspaceVariableInputs.getWorkspaceVariableValue());
        }
        attributes.setCategory(terraformWorkspaceVariableInputs.getWorkspaceVariableCategory());
        attributes.setHcl(terraformWorkspaceVariableInputs.getHcl());
        attributes.setSensitive(terraformWorkspaceVariableInputs.getSensitive());
        createWorkspaceVariableData.setAttributes(attributes);
        createWorkspaceVariableRequestBody.setData(createWorkspaceVariableData);

        try {
            requestBody = createWorkspaceVariableMapper.writeValueAsString(createWorkspaceVariableRequestBody);
        } catch (JsonProcessingException e) {
            e.printStackTrace();
        }

        return requestBody;

    }

}