(hris().departments())
- list - List Departments
- create - Create Department
- get - Get Department
- update - Update Department
- delete - Delete Department
List Departments
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.HrisDepartmentsAllRequest;
import com.apideck.unify.models.operations.HrisDepartmentsAllResponse;
import java.lang.Exception;
import java.util.Map;
public class Application {
public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {
Apideck sdk = Apideck.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();
HrisDepartmentsAllRequest req = HrisDepartmentsAllRequest.builder()
.serviceId("salesforce")
.passThrough(Map.ofEntries(
Map.entry("search", "San Francisco")))
.fields("id,updated_at")
.build();
HrisDepartmentsAllResponse res = sdk.hris().departments().list()
.request(req)
.call();
if (res.getDepartmentsResponse().isPresent()) {
// handle response
}
}
}
HrisDepartmentsAllResponse
Error Type |
Status Code |
Content Type |
models/errors/BadRequestResponse |
400 |
application/json |
models/errors/UnauthorizedResponse |
401 |
application/json |
models/errors/PaymentRequiredResponse |
402 |
application/json |
models/errors/NotFoundResponse |
404 |
application/json |
models/errors/UnprocessableResponse |
422 |
application/json |
models/errors/APIException |
4XX, 5XX |
*/* |
Create Department
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.DepartmentInput;
import com.apideck.unify.models.components.ExtendPaths;
import com.apideck.unify.models.components.PassThroughBody;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.HrisDepartmentsAddRequest;
import com.apideck.unify.models.operations.HrisDepartmentsAddResponse;
import java.lang.Exception;
import java.util.List;
import java.util.Map;
public class Application {
public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {
Apideck sdk = Apideck.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();
HrisDepartmentsAddRequest req = HrisDepartmentsAddRequest.builder()
.department(DepartmentInput.builder()
.name("R&D")
.code("2")
.description("R&D")
.passThrough(List.of(
PassThroughBody.builder()
.serviceId("<id>")
.extendPaths(List.of(
ExtendPaths.builder()
.path("$.nested.property")
.value(Map.ofEntries(\n Map.entry("TaxClassificationRef", Map.ofEntries(\n Map.entry("value", "EUC-99990201-V1-00020000")))))
.build()))
.build()))
.build())
.serviceId("salesforce")
.build();
HrisDepartmentsAddResponse res = sdk.hris().departments().create()
.request(req)
.call();
if (res.createDepartmentResponse().isPresent()) {
// handle response
}
}
}
HrisDepartmentsAddResponse
Error Type |
Status Code |
Content Type |
models/errors/BadRequestResponse |
400 |
application/json |
models/errors/UnauthorizedResponse |
401 |
application/json |
models/errors/PaymentRequiredResponse |
402 |
application/json |
models/errors/NotFoundResponse |
404 |
application/json |
models/errors/UnprocessableResponse |
422 |
application/json |
models/errors/APIException |
4XX, 5XX |
*/* |
Get Department
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.HrisDepartmentsOneRequest;
import com.apideck.unify.models.operations.HrisDepartmentsOneResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {
Apideck sdk = Apideck.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();
HrisDepartmentsOneRequest req = HrisDepartmentsOneRequest.builder()
.id("<id>")
.serviceId("salesforce")
.fields("id,updated_at")
.build();
HrisDepartmentsOneResponse res = sdk.hris().departments().get()
.request(req)
.call();
if (res.getDepartmentResponse().isPresent()) {
// handle response
}
}
}
HrisDepartmentsOneResponse
Error Type |
Status Code |
Content Type |
models/errors/BadRequestResponse |
400 |
application/json |
models/errors/UnauthorizedResponse |
401 |
application/json |
models/errors/PaymentRequiredResponse |
402 |
application/json |
models/errors/NotFoundResponse |
404 |
application/json |
models/errors/UnprocessableResponse |
422 |
application/json |
models/errors/APIException |
4XX, 5XX |
*/* |
Update Department
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.DepartmentInput;
import com.apideck.unify.models.components.ExtendPaths;
import com.apideck.unify.models.components.PassThroughBody;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.HrisDepartmentsUpdateRequest;
import com.apideck.unify.models.operations.HrisDepartmentsUpdateResponse;
import java.lang.Exception;
import java.util.List;
import java.util.Map;
public class Application {
public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {
Apideck sdk = Apideck.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();
HrisDepartmentsUpdateRequest req = HrisDepartmentsUpdateRequest.builder()
.id("<id>")
.department(DepartmentInput.builder()
.name("R&D")
.code("2")
.description("R&D")
.passThrough(List.of(
PassThroughBody.builder()
.serviceId("<id>")
.extendPaths(List.of(
ExtendPaths.builder()
.path("$.nested.property")
.value(Map.ofEntries(\n Map.entry("TaxClassificationRef", Map.ofEntries(\n Map.entry("value", "EUC-99990201-V1-00020000")))))
.build()))
.build()))
.build())
.serviceId("salesforce")
.build();
HrisDepartmentsUpdateResponse res = sdk.hris().departments().update()
.request(req)
.call();
if (res.updateDepartmentResponse().isPresent()) {
// handle response
}
}
}
HrisDepartmentsUpdateResponse
Error Type |
Status Code |
Content Type |
models/errors/BadRequestResponse |
400 |
application/json |
models/errors/UnauthorizedResponse |
401 |
application/json |
models/errors/PaymentRequiredResponse |
402 |
application/json |
models/errors/NotFoundResponse |
404 |
application/json |
models/errors/UnprocessableResponse |
422 |
application/json |
models/errors/APIException |
4XX, 5XX |
*/* |
Delete Department
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.HrisDepartmentsDeleteRequest;
import com.apideck.unify.models.operations.HrisDepartmentsDeleteResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {
Apideck sdk = Apideck.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();
HrisDepartmentsDeleteRequest req = HrisDepartmentsDeleteRequest.builder()
.id("<id>")
.serviceId("salesforce")
.build();
HrisDepartmentsDeleteResponse res = sdk.hris().departments().delete()
.request(req)
.call();
if (res.deleteDepartmentResponse().isPresent()) {
// handle response
}
}
}
HrisDepartmentsDeleteResponse
Error Type |
Status Code |
Content Type |
models/errors/BadRequestResponse |
400 |
application/json |
models/errors/UnauthorizedResponse |
401 |
application/json |
models/errors/PaymentRequiredResponse |
402 |
application/json |
models/errors/NotFoundResponse |
404 |
application/json |
models/errors/UnprocessableResponse |
422 |
application/json |
models/errors/APIException |
4XX, 5XX |
*/* |