com.mx.path.model.mdx.web.controller.AchScheduledTransfersController Maven / Gradle / Ivy
The newest version!
package com.mx.path.model.mdx.web.controller;
import com.mx.path.gateway.accessor.AccessorResponse;
import com.mx.path.model.mdx.model.MdxList;
import com.mx.path.model.mdx.model.ach_transfer.AchScheduledTransfer;
import com.mx.path.model.mdx.model.ach_transfer.options.AchScheduledTransferListOptions;
import com.mx.path.model.mdx.web.model.ach_transfer.AchScheduledTransferListQueryParameters;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(value = "{clientId}", produces = BaseController.MDX_MEDIA)
public class AchScheduledTransfersController extends BaseController {
public AchScheduledTransfersController() {
}
@RequestMapping(value = "/users/{userId}/ach_scheduled_transfers", method = RequestMethod.GET)
public final ResponseEntity> list(AchScheduledTransferListQueryParameters queryParameters) {
AchScheduledTransferListOptions options = new AchScheduledTransferListOptions();
options.setTransferType(queryParameters.getTransfer_type());
AccessorResponse> response = gateway().achTransfers().scheduled().list(options);
return new ResponseEntity<>(response.getResult().wrapped(), createMultiMapForResponse(response.getHeaders()), HttpStatus.OK);
}
@RequestMapping(value = "/users/{userId}/ach_scheduled_transfers/{id}", method = RequestMethod.GET)
public final ResponseEntity get(@PathVariable("id") String id) {
AccessorResponse response = gateway().achTransfers().scheduled().get(id);
return new ResponseEntity<>(response.getResult().wrapped(), createMultiMapForResponse(response.getHeaders()), HttpStatus.OK);
}
@RequestMapping(value = "/users/{userId}/ach_scheduled_transfers", method = RequestMethod.POST)
public final ResponseEntity create(@RequestBody AchScheduledTransfer achTransfer) {
AccessorResponse response = gateway().achTransfers().scheduled().create(achTransfer);
return new ResponseEntity<>(response.getResult().wrapped(), createMultiMapForResponse(response.getHeaders()), HttpStatus.OK);
}
@RequestMapping(value = "/users/{userId}/ach_scheduled_transfers/{id}", method = RequestMethod.PUT)
public final ResponseEntity update(@PathVariable("id") String id, @RequestBody AchScheduledTransfer achTransfer) {
achTransfer.setId(id);
AccessorResponse response = gateway().achTransfers().scheduled().update(id, achTransfer);
return new ResponseEntity<>(response.getResult().wrapped(), createMultiMapForResponse(response.getHeaders()), HttpStatus.OK);
}
@RequestMapping(value = "/users/{userId}/ach_scheduled_transfers/{id}/cancel", method = RequestMethod.PUT)
public final ResponseEntity cancel(@PathVariable("id") String id) {
AccessorResponse response = gateway().achTransfers().scheduled().cancel(id);
return new ResponseEntity<>(createMultiMapForResponse(response.getHeaders()), HttpStatus.NO_CONTENT);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy