class WorkspaceVariableImpl {

    @NotNull
    public static Map<String, String> createWorkspaceVariable(@NotNull TerraformWorkspaceVariableInputs terraformWorkspaceVariableInputs) throws Exception {
        final HttpClientInputs httpClientInputs = new HttpClientInputs();
        final TerraformCommonInputs commonInputs = terraformWorkspaceVariableInputs.getCommonInputs();
        httpClientInputs.setUrl(createWorkspaceVariableUrl(terraformWorkspaceVariableInputs));
        setCommonHttpInputs(httpClientInputs, commonInputs);
        httpClientInputs.setAuthType(ANONYMOUS);
        httpClientInputs.setMethod(POST);
        httpClientInputs.setContentType(APPLICATION_VND_API_JSON);
        httpClientInputs.setHeaders(getAuthHeaders(commonInputs.getAuthToken()));

        if (commonInputs.getRequestBody().isEmpty() & terraformWorkspaceVariableInputs.getSensitiveWorkspaceVariableRequestBody().isEmpty()) {
            httpClientInputs.setBody(createWorkspaceVariableRequestBody(terraformWorkspaceVariableInputs));
        } else if (!terraformWorkspaceVariableInputs.getSensitiveWorkspaceVariableRequestBody().isEmpty()) {
            httpClientInputs.setBody(terraformWorkspaceVariableInputs.getSensitiveWorkspaceVariableRequestBody());
            httpClientInputs.setUrl(createWorkspaceVariableUrl(terraformWorkspaceVariableInputs));
        } else {
            httpClientInputs.setBody(commonInputs.getRequestBody());
        }
        httpClientInputs.setResponseCharacterSet(commonInputs.getResponseCharacterSet());

        return new HttpClientService().execute(httpClientInputs);
    }

}