From 080097e9e5c924934673a6e256af5ca7120729b6 Mon Sep 17 00:00:00 2001 From: Roman Puzanov Date: Wed, 17 Jun 2026 14:42:48 +0500 Subject: [PATCH] Remove obsolete power of attorney methods --- pom.xml | 2 +- .../EmployeePowerOfAttorneyClient.java | 123 ------------------ .../PowerOfAttorneyClient.java | 40 ------ 3 files changed, 1 insertion(+), 164 deletions(-) diff --git a/pom.xml b/pom.xml index 69027f44..807b71f4 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 ru.kontur.diadoc diadocsdk - 5.21.0 + 5.22.0 jar diff --git a/src/main/java/Diadoc/Api/employeePowersOfAttorney/EmployeePowerOfAttorneyClient.java b/src/main/java/Diadoc/Api/employeePowersOfAttorney/EmployeePowerOfAttorneyClient.java index ff8b8e6e..df3dfa50 100644 --- a/src/main/java/Diadoc/Api/employeePowersOfAttorney/EmployeePowerOfAttorneyClient.java +++ b/src/main/java/Diadoc/Api/employeePowersOfAttorney/EmployeePowerOfAttorneyClient.java @@ -46,51 +46,6 @@ public EmployeePowerOfAttorneyList getEmployeePowersOfAttorney( } } - /** - * @deprecated - * Use {@link #updateEmployeePowerOfAttorneyV2(String, String, EmployeePowerOfAttorneyToUpdateV2)} - */ - @Deprecated - public EmployeePowerOfAttorney updateEmployeePowerOfAttorney( - String boxId, - @Nullable String userId, - String registrationNumber, - String issuerInn, - EmployeePowerOfAttorneyToUpdate powerOfAttorneyToUpdate) throws DiadocSdkException { - if (boxId == null) { - throw new IllegalArgumentException("boxId"); - } - if (registrationNumber == null) { - throw new IllegalArgumentException("registrationNumber"); - } - if (issuerInn == null) { - throw new IllegalArgumentException("issuerInn"); - } - if (powerOfAttorneyToUpdate == null) { - throw new IllegalArgumentException("powerOfAttorneyToUpdate"); - } - - try { - var urlBuilder = new URIBuilder(diadocHttpClient.getBaseUrl()) - .setPath("/UpdateEmployeePowerOfAttorney") - .addParameter("boxId", boxId) - .addParameter("registrationNumber", registrationNumber) - .addParameter("issuerInn", issuerInn); - - if (!Tools.isNullOrEmpty(userId)){ - urlBuilder.addParameter("userId", userId); - } - - var request = RequestBuilder - .post(urlBuilder.build()) - .setEntity(new ByteArrayEntity(powerOfAttorneyToUpdate.toByteArray())); - - return EmployeePowerOfAttorney.parseFrom(diadocHttpClient.performRequest(request)); - } catch (URISyntaxException | IOException e) { - throw new DiadocSdkException(e); - } - } - public EmployeePowerOfAttorney updateEmployeePowerOfAttorneyV2( String boxId, @Nullable String userId, @@ -124,45 +79,6 @@ public EmployeePowerOfAttorney updateEmployeePowerOfAttorneyV2( } } - /** - * @deprecated - * Use {@link #addEmployeePowerOfAttorneyV2(String, String, Diadoc.Api.Proto.PowersOfAttorney.PowerOfAttorneyProtos.PowerOfAttorneyFullId)} - */ - @Deprecated - public EmployeePowerOfAttorney addEmployeePowerOfAttorney( - String boxId, - @Nullable String userId, - String registrationNumber, - String issuerInn) throws DiadocSdkException { - if (boxId == null) { - throw new IllegalArgumentException("boxId"); - } - if (registrationNumber == null) { - throw new IllegalArgumentException("registrationNumber"); - } - if (issuerInn == null) { - throw new IllegalArgumentException("issuerInn"); - } - - try { - var urlBuilder = new URIBuilder(diadocHttpClient.getBaseUrl()) - .setPath("/AddEmployeePowerOfAttorney") - .addParameter("boxId", boxId) - .addParameter("registrationNumber", registrationNumber) - .addParameter("issuerInn", issuerInn); - - if (!Tools.isNullOrEmpty(userId)){ - urlBuilder.addParameter("userId", userId); - } - - var request = RequestBuilder.post(urlBuilder.build()); - - return EmployeePowerOfAttorney.parseFrom(diadocHttpClient.performRequest(request)); - } catch (URISyntaxException | IOException e) { - throw new DiadocSdkException(e); - } - } - public EmployeePowerOfAttorney addEmployeePowerOfAttorneyV2( String boxId, @Nullable String userId, @@ -192,45 +108,6 @@ public EmployeePowerOfAttorney addEmployeePowerOfAttorneyV2( } } - /** - * @deprecated - * Use {@link #deleteEmployeePowerOfAttorneyV2(String, String, Diadoc.Api.Proto.PowersOfAttorney.PowerOfAttorneyProtos.PowerOfAttorneyFullId)} - */ - @Deprecated - public void deleteEmployeePowerOfAttorney( - String boxId, - @Nullable String userId, - String registrationNumber, - String issuerInn) throws DiadocSdkException { - if (boxId == null) { - throw new IllegalArgumentException("boxId"); - } - if (registrationNumber == null) { - throw new IllegalArgumentException("registrationNumber"); - } - if (issuerInn == null) { - throw new IllegalArgumentException("issuerInn"); - } - - try { - var urlBuilder = new URIBuilder(diadocHttpClient.getBaseUrl()) - .setPath("/DeleteEmployeePowerOfAttorney") - .addParameter("boxId", boxId) - .addParameter("registrationNumber", registrationNumber) - .addParameter("issuerInn", issuerInn); - - if (!Tools.isNullOrEmpty(userId)){ - urlBuilder.addParameter("userId", userId); - } - - var request = RequestBuilder.post(urlBuilder.build()); - - diadocHttpClient.performRequest(request); - } catch (URISyntaxException | IOException e) { - throw new DiadocSdkException(e); - } - } - public void deleteEmployeePowerOfAttorneyV2( String boxId, @Nullable String userId, diff --git a/src/main/java/Diadoc/Api/powersOfAttorney/PowerOfAttorneyClient.java b/src/main/java/Diadoc/Api/powersOfAttorney/PowerOfAttorneyClient.java index aba24a2b..1b880181 100644 --- a/src/main/java/Diadoc/Api/powersOfAttorney/PowerOfAttorneyClient.java +++ b/src/main/java/Diadoc/Api/powersOfAttorney/PowerOfAttorneyClient.java @@ -4,7 +4,6 @@ import java.net.URISyntaxException; import Diadoc.Api.Proto.AsyncMethodResultProtos.*; -import Diadoc.Api.Proto.Events.PowerOfAttorneyInfoProtos.*; import Diadoc.Api.Proto.PowersOfAttorney.PowerOfAttorneyProtos.*; import Diadoc.Api.Proto.PowersOfAttorney.PowerOfAttorneyValidationProtos.*; import org.apache.http.client.methods.RequestBuilder; @@ -66,45 +65,6 @@ public PowerOfAttorneyRegisterResult registerPowerOfAttorneyResult(String boxId, } } - /** - * @deprecated - * Use {@link #prevalidatePowerOfAttorneyV2(String, PowerOfAttorneyPrevalidateRequestV2)} - */ - @Deprecated - public PowerOfAttorneyPrevalidateResult prevalidatePowerOfAttorney( - String boxId, - String registrationNumber, - String issuerInn, - PowerOfAttorneyPrevalidateRequest powerOfAttorneyPrevalidateRequest) throws DiadocSdkException { - if (boxId == null) { - throw new IllegalArgumentException("boxId"); - } - if (registrationNumber == null) { - throw new IllegalArgumentException("registrationNumber"); - } - if (issuerInn == null) { - throw new IllegalArgumentException("issuerInn"); - } - if (powerOfAttorneyPrevalidateRequest == null) { - throw new IllegalArgumentException("powerOfAttorneyPrevalidateRequest"); - } - - try { - var request = RequestBuilder.post( - new URIBuilder(diadocHttpClient.getBaseUrl()) - .setPath("/PrevalidatePowerOfAttorney") - .addParameter("boxId", boxId) - .addParameter("registrationNumber", registrationNumber) - .addParameter("issuerInn", issuerInn) - .build()) - .setEntity(new ByteArrayEntity(powerOfAttorneyPrevalidateRequest.toByteArray())); - - return PowerOfAttorneyPrevalidateResult.parseFrom(diadocHttpClient.performRequest(request)); - } catch (URISyntaxException | IOException e) { - throw new DiadocSdkException(e); - } - } - public PowerOfAttorneyPrevalidateResult prevalidatePowerOfAttorneyV2( String boxId, PowerOfAttorneyPrevalidateRequestV2 powerOfAttorneyPrevalidateRequest) throws DiadocSdkException {