Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ru.kontur.diadoc</groupId>
<artifactId>diadocsdk</artifactId>
<version>5.21.0</version>
<version>5.22.0</version>

<packaging>jar</packaging>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
Loading