|
@@ -114,6 +114,30 @@ public class GAController extends BaseController {
|
|
|
.build();
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/properties/delete")
|
|
|
+ @ResponseBody
|
|
|
+ public OpenAPIResponse<String> deleteProperty(@RequestBody OpenAPIRequest<String> apiRequest)
|
|
|
+ throws BadRequestException, DataException {
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
+ log.info("****** deleteProperty() ****** apiRequest = {}", JsonUtils.toJson(apiRequest));
|
|
|
+ String propertyResourceName = apiRequest.getData();
|
|
|
+
|
|
|
+ // 1. Validates the request parameters.
|
|
|
+ if (StringUtils.isEmpty(propertyResourceName)) {
|
|
|
+ throw new BadRequestException(apiRequest);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 2. Executes the API request.
|
|
|
+ gaAdminService.deleteProperty(
|
|
|
+ // Converts to resource name if the account ID is provided by mistake.
|
|
|
+ GAPropertyDTO.toResourceName(propertyResourceName));
|
|
|
+ log.info("****** deleteProperty() ****** duration = {} seconds", getElapsedSeconds(start));
|
|
|
+ return OpenAPIResponse.<String>builder()
|
|
|
+ .status(APIStatus.SUCCESS)
|
|
|
+ .data(propertyResourceName)
|
|
|
+ .build();
|
|
|
+ }
|
|
|
+
|
|
|
@PostMapping("/report")
|
|
|
@ResponseBody
|
|
|
public OpenAPIResponse<List<? extends GAReportDataDTO>> runReport(
|