/*
 * Copyright 2018-2024 adorsys GmbH & Co KG
 *
 * This program is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Affero General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or (at
 * your option) any later version. This program is distributed in the hope that
 * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see https://www.gnu.org/licenses/.
 *
 * This project is also available under a separate commercial license. You can
 * contact us at sales@adorsys.com.
 */

/**
 * NOTE: This class is auto generated by the swagger code generator program (unset).
 * https://github.com/swagger-api/swagger-codegen
 * Do not edit the class manually.
 */
package de.adorsys.psd2.api;

import com.fasterxml.jackson.databind.ObjectMapper;
import de.adorsys.psd2.model.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDate;
import java.util.Optional;
import java.util.UUID;

@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2022-05-06T13:00:42.214155+03:00[Europe/Kiev]")
@Validated
public interface AccountApi {

    Logger log = LoggerFactory.getLogger(AccountApi.class);

    default Optional<ObjectMapper> getObjectMapper() {
        return Optional.empty();
    }

    default Optional<HttpServletRequest> getRequest() {
        return Optional.empty();
    }

    default Optional<String> getAcceptHeader() {
        return getRequest().map(r -> r.getHeader("Accept"));
    }

    @Operation(summary = "Read account list", description = "Read the identifiers of the available payment account together with  booking balance information, depending on the consent granted.  It is assumed that a consent of the PSU to this access is already given and stored on the ASPSP system.  The addressed list of accounts depends then on the PSU ID and the stored consent addressed by consentId,  respectively the OAuth2 access token.   Returns all identifiers of the accounts, to which an account access has been granted to through  the /consents endpoint by the PSU.  In addition, relevant information about the accounts and hyperlinks to corresponding account  information resources are provided if a related consent has been already granted.  Remark: Note that the /consents endpoint optionally offers to grant an access on all available  payment accounts of a PSU.  In this case, this endpoint will deliver the information about all available payment accounts  of the PSU at this ASPSP. ", security = {
        @SecurityRequirement(name = "BearerAuthOAuth")}, tags = {"Account Information Service (AIS)"})
    @ApiResponses(value = {
        @ApiResponse(responseCode = "200", description = "OK. In case, no account is accessible, the ASPSP shall return an empty array. As this is also considered a positive response, the Response code must still be 200.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = AccountList.class))),

        @ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error400NGAIS.class))),

        @ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error401NGAIS.class))),

        @ApiResponse(responseCode = "403", description = "Forbidden", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error403NGAIS.class))),

        @ApiResponse(responseCode = "404", description = "Not found", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error404NGAIS.class))),

        @ApiResponse(responseCode = "405", description = "Method Not Allowed", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error405NGAIS.class))),

        @ApiResponse(responseCode = "406", description = "Not Acceptable", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error406NGAIS.class))),

        @ApiResponse(responseCode = "408", description = "Request Timeout"),

        @ApiResponse(responseCode = "409", description = "Conflict", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error409NGAIS.class))),

        @ApiResponse(responseCode = "415", description = "Unsupported Media Type"),

        @ApiResponse(responseCode = "429", description = "Too Many Requests", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error429NGAIS.class))),

        @ApiResponse(responseCode = "500", description = "Internal Server Error"),

        @ApiResponse(responseCode = "503", description = "Service Unavailable")})
    @RequestMapping(value = "/v1/accounts",
        produces = {"application/json", "application/problem+json"},
        method = RequestMethod.GET)
    default ResponseEntity<AccountList> _getAccountList(@Parameter(in = ParameterIn.HEADER, description = "ID of the request, unique to the call, as determined by the initiating party.", required = true, schema = @Schema()) @RequestHeader(value = "X-Request-ID", required = true) UUID xRequestID, @Parameter(in = ParameterIn.HEADER, description = "This then contains the consentId of the related AIS consent, which was performed prior to this payment initiation. ", required = true, schema = @Schema()) @RequestHeader(value = "Consent-ID", required = true) String consentID, @Parameter(in = ParameterIn.QUERY, description = "If contained, this function reads the list of accessible payment accounts including the booking balance,  if granted by the PSU in the related consent and available by the ASPSP.  This parameter might be ignored by the ASPSP.  ", schema = @Schema()) @Valid @RequestParam(value = "withBalance", required = false) Boolean withBalance, @Parameter(in = ParameterIn.HEADER, description = "Is contained if and only if the \"Signature\" element is contained in the header of the request.", schema = @Schema()) @RequestHeader(value = "Digest", required = false) String digest, @Parameter(in = ParameterIn.HEADER, description = "A signature of the request by the TPP on application level. This might be mandated by ASPSP. ", schema = @Schema()) @RequestHeader(value = "Signature", required = false) String signature, @Parameter(in = ParameterIn.HEADER, description = "The certificate used for signing the request, in base64 encoding.  Must be contained if a signature is contained. ", schema = @Schema()) @RequestHeader(value = "TPP-Signature-Certificate", required = false) byte[] tpPSignatureCertificate, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Address header field consists of the corresponding HTTP request  IP Address field between PSU and TPP.  It shall be contained if and only if this request was actively initiated by the PSU. ", schema = @Schema()) @RequestHeader(value = "PSU-IP-Address", required = false) String psUIPAddress, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Port header field consists of the corresponding HTTP request IP Port field between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-IP-Port", required = false) String psUIPPort, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Accept header fields consist of the corresponding HTTP request Accept header fields between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Accept", required = false) String psUAccept, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Accept header fields consist of the corresponding HTTP request Accept header fields between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Accept-Charset", required = false) String psUAcceptCharset, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Accept header fields consist of the corresponding HTTP request Accept header fields between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Accept-Encoding", required = false) String psUAcceptEncoding, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Accept header fields consist of the corresponding HTTP request Accept header fields between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Accept-Language", required = false) String psUAcceptLanguage, @Parameter(in = ParameterIn.HEADER, description = "The forwarded Agent header field of the HTTP request between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-User-Agent", required = false) String psUUserAgent, @Parameter(in = ParameterIn.HEADER, description = "HTTP method used at the PSU ? TPP interface, if available. Valid values are: * GET * POST * PUT * PATCH * DELETE ", schema = @Schema(allowableValues = {"GET", "POST", "PUT", "PATCH", "DELETE"}
    )) @RequestHeader(value = "PSU-Http-Method", required = false) String psUHttpMethod, @Parameter(in = ParameterIn.HEADER, description = "UUID (Universally Unique Identifier) for a device, which is used by the PSU, if available. UUID identifies either a device or a device dependant application installation. In case of an installation identification this ID needs to be unaltered until removal from device. ", schema = @Schema()) @RequestHeader(value = "PSU-Device-ID", required = false) UUID psUDeviceID, @Parameter(in = ParameterIn.HEADER, description = "The forwarded Geo Location of the corresponding http request between PSU and TPP if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Geo-Location", required = false) String psUGeoLocation) {
        return getAccountList(xRequestID, consentID, withBalance, digest, signature, tpPSignatureCertificate, psUIPAddress, psUIPPort, psUAccept, psUAcceptCharset, psUAcceptEncoding, psUAcceptLanguage, psUUserAgent, psUHttpMethod, psUDeviceID, psUGeoLocation);
    }

    // Override this method
    default ResponseEntity<AccountList> getAccountList(UUID xRequestID, String consentID, Boolean withBalance, String digest, String signature, byte[] tpPSignatureCertificate, String psUIPAddress, String psUIPPort, String psUAccept, String psUAcceptCharset, String psUAcceptEncoding, String psUAcceptLanguage, String psUUserAgent, String psUHttpMethod, UUID psUDeviceID, String psUGeoLocation) {
        if (getObjectMapper().isPresent() && getAcceptHeader().isPresent()) {
        } else {
            log.warn("ObjectMapper or HttpServletRequest not configured in default AccountInformationServiceAisApi interface so no example is generated");
        }
        return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
    }

    @Operation(summary = "Read balance", description = "Reads account data from a given account addressed by \"account-id\".   **Remark:** This account-id can be a tokenised identification due to data protection reason since the path  information might be logged on intermediary servers within the ASPSP sphere.  This account-id then can be retrieved by the \"Get account list\" call.  The account-id is constant at least throughout the lifecycle of a given consent. ", security = {
        @SecurityRequirement(name = "BearerAuthOAuth")}, tags = {"Account Information Service (AIS)"})
    @ApiResponses(value = {
        @ApiResponse(responseCode = "200", description = "OK", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ReadAccountBalanceResponse200.class))),

        @ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error400NGAIS.class))),

        @ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error401NGAIS.class))),

        @ApiResponse(responseCode = "403", description = "Forbidden", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error403NGAIS.class))),

        @ApiResponse(responseCode = "404", description = "Not found", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error404NGAIS.class))),

        @ApiResponse(responseCode = "405", description = "Method Not Allowed", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error405NGAIS.class))),

        @ApiResponse(responseCode = "406", description = "Not Acceptable", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error406NGAIS.class))),

        @ApiResponse(responseCode = "408", description = "Request Timeout"),

        @ApiResponse(responseCode = "409", description = "Conflict", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error409NGAIS.class))),

        @ApiResponse(responseCode = "415", description = "Unsupported Media Type"),

        @ApiResponse(responseCode = "429", description = "Too Many Requests", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error429NGAIS.class))),

        @ApiResponse(responseCode = "500", description = "Internal Server Error"),

        @ApiResponse(responseCode = "503", description = "Service Unavailable")})
    @RequestMapping(value = "/v1/accounts/{account-id}/balances",
        produces = {"application/json", "application/problem+json"},
        method = RequestMethod.GET)
    default ResponseEntity<ReadAccountBalanceResponse200> _getBalances(@Parameter(in = ParameterIn.PATH, description = "This identification is denoting the addressed (card) account.  The account-id is retrieved by using a \"Read Account List\" or \"Read Card Account list\" call.  The account-id is the \"resourceId\" attribute of the account structure.  Its value is constant at least throughout the lifecycle of a given consent. ", required = true, schema = @Schema()) @PathVariable("account-id") String accountId, @Parameter(in = ParameterIn.HEADER, description = "ID of the request, unique to the call, as determined by the initiating party.", required = true, schema = @Schema()) @RequestHeader(value = "X-Request-ID", required = true) UUID xRequestID, @Parameter(in = ParameterIn.HEADER, description = "This then contains the consentId of the related AIS consent, which was performed prior to this payment initiation. ", required = true, schema = @Schema()) @RequestHeader(value = "Consent-ID", required = true) String consentID, @Parameter(in = ParameterIn.HEADER, description = "Is contained if and only if the \"Signature\" element is contained in the header of the request.", schema = @Schema()) @RequestHeader(value = "Digest", required = false) String digest, @Parameter(in = ParameterIn.HEADER, description = "A signature of the request by the TPP on application level. This might be mandated by ASPSP. ", schema = @Schema()) @RequestHeader(value = "Signature", required = false) String signature, @Parameter(in = ParameterIn.HEADER, description = "The certificate used for signing the request, in base64 encoding.  Must be contained if a signature is contained. ", schema = @Schema()) @RequestHeader(value = "TPP-Signature-Certificate", required = false) byte[] tpPSignatureCertificate, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Address header field consists of the corresponding HTTP request  IP Address field between PSU and TPP.  It shall be contained if and only if this request was actively initiated by the PSU. ", schema = @Schema()) @RequestHeader(value = "PSU-IP-Address", required = false) String psUIPAddress, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Port header field consists of the corresponding HTTP request IP Port field between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-IP-Port", required = false) String psUIPPort, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Accept header fields consist of the corresponding HTTP request Accept header fields between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Accept", required = false) String psUAccept, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Accept header fields consist of the corresponding HTTP request Accept header fields between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Accept-Charset", required = false) String psUAcceptCharset, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Accept header fields consist of the corresponding HTTP request Accept header fields between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Accept-Encoding", required = false) String psUAcceptEncoding, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Accept header fields consist of the corresponding HTTP request Accept header fields between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Accept-Language", required = false) String psUAcceptLanguage, @Parameter(in = ParameterIn.HEADER, description = "The forwarded Agent header field of the HTTP request between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-User-Agent", required = false) String psUUserAgent, @Parameter(in = ParameterIn.HEADER, description = "HTTP method used at the PSU ? TPP interface, if available. Valid values are: * GET * POST * PUT * PATCH * DELETE ", schema = @Schema(allowableValues = {"GET", "POST", "PUT", "PATCH", "DELETE"}
    )) @RequestHeader(value = "PSU-Http-Method", required = false) String psUHttpMethod, @Parameter(in = ParameterIn.HEADER, description = "UUID (Universally Unique Identifier) for a device, which is used by the PSU, if available. UUID identifies either a device or a device dependant application installation. In case of an installation identification this ID needs to be unaltered until removal from device. ", schema = @Schema()) @RequestHeader(value = "PSU-Device-ID", required = false) UUID psUDeviceID, @Parameter(in = ParameterIn.HEADER, description = "The forwarded Geo Location of the corresponding http request between PSU and TPP if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Geo-Location", required = false) String psUGeoLocation) {
        return getBalances(accountId, xRequestID, consentID, digest, signature, tpPSignatureCertificate, psUIPAddress, psUIPPort, psUAccept, psUAcceptCharset, psUAcceptEncoding, psUAcceptLanguage, psUUserAgent, psUHttpMethod, psUDeviceID, psUGeoLocation);
    }

    // Override this method
    default ResponseEntity<ReadAccountBalanceResponse200> getBalances(String accountId, UUID xRequestID, String consentID, String digest, String signature, byte[] tpPSignatureCertificate, String psUIPAddress, String psUIPPort, String psUAccept, String psUAcceptCharset, String psUAcceptEncoding, String psUAcceptLanguage, String psUUserAgent, String psUHttpMethod, UUID psUDeviceID, String psUGeoLocation) {
        if (getObjectMapper().isPresent() && getAcceptHeader().isPresent()) {
        } else {
            log.warn("ObjectMapper or HttpServletRequest not configured in default AccountInformationServiceAisApi interface so no example is generated");
        }
        return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
    }

    @Operation(summary = "Read transaction details", description = "Reads transaction details from a given transaction addressed by \"transactionId\" on a given account addressed by \"account-id\".  This call is only available on transactions as reported in a JSON format.  **Remark:** Please note that the PATH might be already given in detail by the corresponding entry of the response of the  \"Read Transaction List\" call within the _links subfield. ", security = {
        @SecurityRequirement(name = "BearerAuthOAuth")}, tags = {"Account Information Service (AIS)"})
    @ApiResponses(value = {
        @ApiResponse(responseCode = "200", description = "OK", content = @Content(mediaType = "application/json", schema = @Schema(implementation = InlineResponse2001.class))),

        @ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error400NGAIS.class))),

        @ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error401NGAIS.class))),

        @ApiResponse(responseCode = "403", description = "Forbidden", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error403NGAIS.class))),

        @ApiResponse(responseCode = "404", description = "Not found", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error404NGAIS.class))),

        @ApiResponse(responseCode = "405", description = "Method Not Allowed", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error405NGAIS.class))),

        @ApiResponse(responseCode = "406", description = "Not Acceptable", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error406NGAIS.class))),

        @ApiResponse(responseCode = "408", description = "Request Timeout"),

        @ApiResponse(responseCode = "409", description = "Conflict", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error409NGAIS.class))),

        @ApiResponse(responseCode = "415", description = "Unsupported Media Type"),

        @ApiResponse(responseCode = "429", description = "Too Many Requests", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error429NGAIS.class))),

        @ApiResponse(responseCode = "500", description = "Internal Server Error"),

        @ApiResponse(responseCode = "503", description = "Service Unavailable")})
    @RequestMapping(value = "/v1/accounts/{account-id}/transactions/{transactionId}",
        produces = {"application/json", "application/problem+json"},
        method = RequestMethod.GET)
    default ResponseEntity<InlineResponse2001> _getTransactionDetails(@Parameter(in = ParameterIn.PATH, description = "This identification is denoting the addressed (card) account.  The account-id is retrieved by using a \"Read Account List\" or \"Read Card Account list\" call.  The account-id is the \"resourceId\" attribute of the account structure.  Its value is constant at least throughout the lifecycle of a given consent. ", required = true, schema = @Schema()) @PathVariable("account-id") String accountId, @Parameter(in = ParameterIn.PATH, description = "This identification is given by the attribute transactionId of the corresponding entry of a transaction list. ", required = true, schema = @Schema()) @PathVariable("transactionId") String transactionId, @Parameter(in = ParameterIn.HEADER, description = "ID of the request, unique to the call, as determined by the initiating party.", required = true, schema = @Schema()) @RequestHeader(value = "X-Request-ID", required = true) UUID xRequestID, @Parameter(in = ParameterIn.HEADER, description = "This then contains the consentId of the related AIS consent, which was performed prior to this payment initiation. ", required = true, schema = @Schema()) @RequestHeader(value = "Consent-ID", required = true) String consentID, @Parameter(in = ParameterIn.HEADER, description = "Is contained if and only if the \"Signature\" element is contained in the header of the request.", schema = @Schema()) @RequestHeader(value = "Digest", required = false) String digest, @Parameter(in = ParameterIn.HEADER, description = "A signature of the request by the TPP on application level. This might be mandated by ASPSP. ", schema = @Schema()) @RequestHeader(value = "Signature", required = false) String signature, @Parameter(in = ParameterIn.HEADER, description = "The certificate used for signing the request, in base64 encoding.  Must be contained if a signature is contained. ", schema = @Schema()) @RequestHeader(value = "TPP-Signature-Certificate", required = false) byte[] tpPSignatureCertificate, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Address header field consists of the corresponding HTTP request  IP Address field between PSU and TPP.  It shall be contained if and only if this request was actively initiated by the PSU. ", schema = @Schema()) @RequestHeader(value = "PSU-IP-Address", required = false) String psUIPAddress, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Port header field consists of the corresponding HTTP request IP Port field between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-IP-Port", required = false) String psUIPPort, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Accept header fields consist of the corresponding HTTP request Accept header fields between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Accept", required = false) String psUAccept, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Accept header fields consist of the corresponding HTTP request Accept header fields between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Accept-Charset", required = false) String psUAcceptCharset, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Accept header fields consist of the corresponding HTTP request Accept header fields between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Accept-Encoding", required = false) String psUAcceptEncoding, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Accept header fields consist of the corresponding HTTP request Accept header fields between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Accept-Language", required = false) String psUAcceptLanguage, @Parameter(in = ParameterIn.HEADER, description = "The forwarded Agent header field of the HTTP request between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-User-Agent", required = false) String psUUserAgent, @Parameter(in = ParameterIn.HEADER, description = "HTTP method used at the PSU ? TPP interface, if available. Valid values are: * GET * POST * PUT * PATCH * DELETE ", schema = @Schema(allowableValues = {"GET", "POST", "PUT", "PATCH", "DELETE"}
    )) @RequestHeader(value = "PSU-Http-Method", required = false) String psUHttpMethod, @Parameter(in = ParameterIn.HEADER, description = "UUID (Universally Unique Identifier) for a device, which is used by the PSU, if available. UUID identifies either a device or a device dependant application installation. In case of an installation identification this ID needs to be unaltered until removal from device. ", schema = @Schema()) @RequestHeader(value = "PSU-Device-ID", required = false) UUID psUDeviceID, @Parameter(in = ParameterIn.HEADER, description = "The forwarded Geo Location of the corresponding http request between PSU and TPP if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Geo-Location", required = false) String psUGeoLocation) {
        return getTransactionDetails(accountId, transactionId, xRequestID, consentID, digest, signature, tpPSignatureCertificate, psUIPAddress, psUIPPort, psUAccept, psUAcceptCharset, psUAcceptEncoding, psUAcceptLanguage, psUUserAgent, psUHttpMethod, psUDeviceID, psUGeoLocation);
    }

    // Override this method
    default ResponseEntity<InlineResponse2001> getTransactionDetails(String accountId, String transactionId, UUID xRequestID, String consentID, String digest, String signature, byte[] tpPSignatureCertificate, String psUIPAddress, String psUIPPort, String psUAccept, String psUAcceptCharset, String psUAcceptEncoding, String psUAcceptLanguage, String psUUserAgent, String psUHttpMethod, UUID psUDeviceID, String psUGeoLocation) {
        if (getObjectMapper().isPresent() && getAcceptHeader().isPresent()) {
        } else {
            log.warn("ObjectMapper or HttpServletRequest not configured in default AccountInformationServiceAisApi interface so no example is generated");
        }
        return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
    }


    @Operation(summary = "Read transaction list of an account", description = "Read transaction reports or transaction lists of a given account addressed by \"account-id\", depending on the steering parameter  \"bookingStatus\" together with balances.  For a given account, additional parameters are e.g. the attributes \"dateFrom\" and \"dateTo\".  The ASPSP might add balance information, if transaction lists without balances are not supported. ", security = {
        @SecurityRequirement(name = "BearerAuthOAuth")}, tags = {"Account Information Service (AIS)"})
    @ApiResponses(value = {
        @ApiResponse(responseCode = "200", description = "OK", content = @Content(mediaType = "application/json", schema = @Schema(implementation = TransactionsResponse200Json.class))),

        @ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error400NGAIS.class))),

        @ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error401NGAIS.class))),

        @ApiResponse(responseCode = "403", description = "Forbidden", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error403NGAIS.class))),

        @ApiResponse(responseCode = "404", description = "Not found", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error404NGAIS.class))),

        @ApiResponse(responseCode = "405", description = "Method Not Allowed", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error405NGAIS.class))),

        @ApiResponse(responseCode = "406", description = "Not Acceptable", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error406NGAIS.class))),

        @ApiResponse(responseCode = "408", description = "Request Timeout"),

        @ApiResponse(responseCode = "409", description = "Conflict", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error409NGAIS.class))),

        @ApiResponse(responseCode = "415", description = "Unsupported Media Type"),

        @ApiResponse(responseCode = "429", description = "Too Many Requests", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error429NGAIS.class))),

        @ApiResponse(responseCode = "500", description = "Internal Server Error"),

        @ApiResponse(responseCode = "503", description = "Service Unavailable")})
    @RequestMapping(value = "/v1/accounts/{account-id}/transactions",
        produces = {"application/json", "application/xml", "text/plain", "application/problem+json"},
        method = RequestMethod.GET)
    default ResponseEntity<TransactionsResponse200Json> _getTransactionList(@Parameter(in = ParameterIn.PATH, description = "This identification is denoting the addressed (card) account.  The account-id is retrieved by using a \"Read Account List\" or \"Read Card Account list\" call.  The account-id is the \"resourceId\" attribute of the account structure.  Its value is constant at least throughout the lifecycle of a given consent. ", required = true, schema = @Schema()) @PathVariable("account-id") String accountId, @NotNull @Parameter(in = ParameterIn.QUERY, description = "Permitted codes are    * \"booked\",   * \"pending\",     * \"both\",   * \"information\" and   * \"all\" \"booked\" shall be supported by the ASPSP. To support the \"information\", \"pending\" and \"both\" feature is optional for the ASPSP, Error code if not supported in the online banking frontend. If supported, \"both\" means to request transaction reports of transaction of bookingStatus either \"pending\" or \"booked\". To support the \"information\" feature is optional for the ASPSP. Currently the booking status “information” only covers standing orders. Error code if not supported. To support the \"all\" feature is optional for the ASPSP, Error code if not supported. If supported, \"all\" means to request transaction reports of transaction of any bookingStatus (\"pending\", \"booked\" or \"information\"). ", required = true, schema = @Schema(allowableValues = {"information", "booked", "pending", "both", "all"}
    )) @Valid @RequestParam(value = "bookingStatus", required = true) String bookingStatus, @Parameter(in = ParameterIn.HEADER, description = "ID of the request, unique to the call, as determined by the initiating party.", required = true, schema = @Schema()) @RequestHeader(value = "X-Request-ID", required = true) UUID xRequestID, @Parameter(in = ParameterIn.HEADER, description = "This then contains the consentId of the related AIS consent, which was performed prior to this payment initiation. ", required = true, schema = @Schema()) @RequestHeader(value = "Consent-ID", required = true) String consentID, @Parameter(in = ParameterIn.QUERY, description = "Conditional: Starting date (inclusive the date dateFrom) of the transaction list, mandated if no delta access is required and if bookingStatus does not equal \"information\".  For booked transactions, the relevant date is the booking date.   For pending transactions, the relevant date is the entry date, which may not be transparent  neither in this API nor other channels of the ASPSP. ", schema = @Schema()) @Valid @RequestParam(value = "dateFrom", required = false) LocalDate dateFrom, @Parameter(in = ParameterIn.QUERY, description = "End date (inclusive the data dateTo) of the transaction list, default is \"now\" if not given.   Might be ignored if a delta function is used.  For booked transactions, the relevant date is the booking date.   For pending transactions, the relevant date is the entry date, which may not be transparent  neither in this API nor other channels of the ASPSP. ", schema = @Schema()) @Valid @RequestParam(value = "dateTo", required = false) LocalDate dateTo, @Parameter(in = ParameterIn.QUERY, description = "This data attribute is indicating that the AISP is in favour to get all transactions after  the transaction with identification entryReferenceFrom alternatively to the above defined period.  This is a implementation of a delta access.  If this data element is contained, the entries \"dateFrom\" and \"dateTo\" might be ignored by the ASPSP  if a delta report is supported.  Optional if supported by API provider. ", schema = @Schema()) @Valid @RequestParam(value = "entryReferenceFrom", required = false) String entryReferenceFrom, @Parameter(in = ParameterIn.QUERY, description = "This data attribute is indicating that the AISP is in favour to get all transactions after the last report access for this PSU on the addressed account. This is another implementation of a delta access-report. This delta indicator might be rejected by the ASPSP if this function is not supported. Optional if supported by API provider", schema = @Schema()) @Valid @RequestParam(value = "deltaList", required = false) Boolean deltaList, @Parameter(in = ParameterIn.QUERY, description = "If contained, this function reads the list of accessible payment accounts including the booking balance,  if granted by the PSU in the related consent and available by the ASPSP.  This parameter might be ignored by the ASPSP.  ", schema = @Schema()) @Valid @RequestParam(value = "withBalance", required = false) Boolean withBalance, @Parameter(in = ParameterIn.QUERY, description = "This data attribute is indicating current transaction page.  Optional if supported by API provider. ", schema = @Schema()) @Valid @RequestParam(value = "pageIndex", required = false) Integer pageIndex, @Parameter(in = ParameterIn.QUERY, description = "This data attribute is indicating current transaction items on one page.  Optional if supported by API provider. ", schema = @Schema()) @Valid @RequestParam(value = "itemsPerPage", required = false) Integer itemsPerPage, @Parameter(in = ParameterIn.HEADER, description = "Is contained if and only if the \"Signature\" element is contained in the header of the request.", schema = @Schema()) @RequestHeader(value = "Digest", required = false) String digest, @Parameter(in = ParameterIn.HEADER, description = "A signature of the request by the TPP on application level. This might be mandated by ASPSP. ", schema = @Schema()) @RequestHeader(value = "Signature", required = false) String signature, @Parameter(in = ParameterIn.HEADER, description = "The certificate used for signing the request, in base64 encoding.  Must be contained if a signature is contained. ", schema = @Schema()) @RequestHeader(value = "TPP-Signature-Certificate", required = false) byte[] tpPSignatureCertificate, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Address header field consists of the corresponding HTTP request  IP Address field between PSU and TPP.  It shall be contained if and only if this request was actively initiated by the PSU. ", schema = @Schema()) @RequestHeader(value = "PSU-IP-Address", required = false) String psUIPAddress, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Port header field consists of the corresponding HTTP request IP Port field between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-IP-Port", required = false) String psUIPPort, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Accept header fields consist of the corresponding HTTP request Accept header fields between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Accept", required = false) String psUAccept, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Accept header fields consist of the corresponding HTTP request Accept header fields between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Accept-Charset", required = false) String psUAcceptCharset, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Accept header fields consist of the corresponding HTTP request Accept header fields between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Accept-Encoding", required = false) String psUAcceptEncoding, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Accept header fields consist of the corresponding HTTP request Accept header fields between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Accept-Language", required = false) String psUAcceptLanguage, @Parameter(in = ParameterIn.HEADER, description = "The forwarded Agent header field of the HTTP request between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-User-Agent", required = false) String psUUserAgent, @Parameter(in = ParameterIn.HEADER, description = "HTTP method used at the PSU ? TPP interface, if available. Valid values are: * GET * POST * PUT * PATCH * DELETE ", schema = @Schema(allowableValues = {"GET", "POST", "PUT", "PATCH", "DELETE"}
    )) @RequestHeader(value = "PSU-Http-Method", required = false) String psUHttpMethod, @Parameter(in = ParameterIn.HEADER, description = "UUID (Universally Unique Identifier) for a device, which is used by the PSU, if available. UUID identifies either a device or a device dependant application installation. In case of an installation identification this ID needs to be unaltered until removal from device. ", schema = @Schema()) @RequestHeader(value = "PSU-Device-ID", required = false) UUID psUDeviceID, @Parameter(in = ParameterIn.HEADER, description = "The forwarded Geo Location of the corresponding http request between PSU and TPP if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Geo-Location", required = false) String psUGeoLocation) {
        return getTransactionList(accountId, bookingStatus, xRequestID, consentID, dateFrom, dateTo, entryReferenceFrom, deltaList, withBalance, pageIndex, itemsPerPage, digest, signature, tpPSignatureCertificate, psUIPAddress, psUIPPort, psUAccept, psUAcceptCharset, psUAcceptEncoding, psUAcceptLanguage, psUUserAgent, psUHttpMethod, psUDeviceID, psUGeoLocation);
    }

    // Override this method
    default ResponseEntity<TransactionsResponse200Json> getTransactionList(String accountId, String bookingStatus, UUID xRequestID, String consentID, LocalDate dateFrom, LocalDate dateTo, String entryReferenceFrom, Boolean deltaList, Boolean withBalance, Integer pageIndex, Integer itemsPerPage, String digest, String signature, byte[] tpPSignatureCertificate, String psUIPAddress, String psUIPPort, String psUAccept, String psUAcceptCharset, String psUAcceptEncoding, String psUAcceptLanguage, String psUUserAgent, String psUHttpMethod, UUID psUDeviceID, String psUGeoLocation) {
        if (getObjectMapper().isPresent() && getAcceptHeader().isPresent()) {
        } else {
            log.warn("ObjectMapper or HttpServletRequest not configured in default AccountInformationServiceAisApi interface so no example is generated");
        }
        return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
    }


    @Operation(summary = "Read account details", description = "Reads details about an account, with balances where required.  It is assumed that a consent of the PSU to  this access is already given and stored on the ASPSP system.  The addressed details of this account depends then on the stored consent addressed by consentId,  respectively the OAuth2 access token.  **NOTE:** The account-id can represent a multicurrency account.  In this case the currency code is set to \"XXX\".  Give detailed information about the addressed account.  Give detailed information about the addressed account together with balance information ", security = {
        @SecurityRequirement(name = "BearerAuthOAuth")}, tags = {"Account Information Service (AIS)"})
    @ApiResponses(value = {
        @ApiResponse(responseCode = "200", description = "OK", content = @Content(mediaType = "application/json", schema = @Schema(implementation = InlineResponse200.class))),

        @ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error400NGAIS.class))),

        @ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error401NGAIS.class))),

        @ApiResponse(responseCode = "403", description = "Forbidden", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error403NGAIS.class))),

        @ApiResponse(responseCode = "404", description = "Not found", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error404NGAIS.class))),

        @ApiResponse(responseCode = "405", description = "Method Not Allowed", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error405NGAIS.class))),

        @ApiResponse(responseCode = "406", description = "Not Acceptable", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error406NGAIS.class))),

        @ApiResponse(responseCode = "408", description = "Request Timeout"),

        @ApiResponse(responseCode = "409", description = "Conflict", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error409NGAIS.class))),

        @ApiResponse(responseCode = "415", description = "Unsupported Media Type"),

        @ApiResponse(responseCode = "429", description = "Too Many Requests", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Error429NGAIS.class))),

        @ApiResponse(responseCode = "500", description = "Internal Server Error"),

        @ApiResponse(responseCode = "503", description = "Service Unavailable")})
    @RequestMapping(value = "/v1/accounts/{account-id}",
        produces = {"application/json", "application/problem+json"},
        method = RequestMethod.GET)
    default ResponseEntity<InlineResponse200> _readAccountDetails(@Parameter(in = ParameterIn.PATH, description = "This identification is denoting the addressed (card) account.  The account-id is retrieved by using a \"Read Account List\" or \"Read Card Account list\" call.  The account-id is the \"resourceId\" attribute of the account structure.  Its value is constant at least throughout the lifecycle of a given consent. ", required = true, schema = @Schema()) @PathVariable("account-id") String accountId, @Parameter(in = ParameterIn.HEADER, description = "ID of the request, unique to the call, as determined by the initiating party.", required = true, schema = @Schema()) @RequestHeader(value = "X-Request-ID", required = true) UUID xRequestID, @Parameter(in = ParameterIn.HEADER, description = "This then contains the consentId of the related AIS consent, which was performed prior to this payment initiation. ", required = true, schema = @Schema()) @RequestHeader(value = "Consent-ID", required = true) String consentID, @Parameter(in = ParameterIn.QUERY, description = "If contained, this function reads the list of accessible payment accounts including the booking balance,  if granted by the PSU in the related consent and available by the ASPSP.  This parameter might be ignored by the ASPSP.  ", schema = @Schema()) @Valid @RequestParam(value = "withBalance", required = false) Boolean withBalance, @Parameter(in = ParameterIn.HEADER, description = "Is contained if and only if the \"Signature\" element is contained in the header of the request.", schema = @Schema()) @RequestHeader(value = "Digest", required = false) String digest, @Parameter(in = ParameterIn.HEADER, description = "A signature of the request by the TPP on application level. This might be mandated by ASPSP. ", schema = @Schema()) @RequestHeader(value = "Signature", required = false) String signature, @Parameter(in = ParameterIn.HEADER, description = "The certificate used for signing the request, in base64 encoding.  Must be contained if a signature is contained. ", schema = @Schema()) @RequestHeader(value = "TPP-Signature-Certificate", required = false) byte[] tpPSignatureCertificate, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Address header field consists of the corresponding HTTP request  IP Address field between PSU and TPP.  It shall be contained if and only if this request was actively initiated by the PSU. ", schema = @Schema()) @RequestHeader(value = "PSU-IP-Address", required = false) String psUIPAddress, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Port header field consists of the corresponding HTTP request IP Port field between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-IP-Port", required = false) String psUIPPort, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Accept header fields consist of the corresponding HTTP request Accept header fields between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Accept", required = false) String psUAccept, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Accept header fields consist of the corresponding HTTP request Accept header fields between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Accept-Charset", required = false) String psUAcceptCharset, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Accept header fields consist of the corresponding HTTP request Accept header fields between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Accept-Encoding", required = false) String psUAcceptEncoding, @Parameter(in = ParameterIn.HEADER, description = "The forwarded IP Accept header fields consist of the corresponding HTTP request Accept header fields between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Accept-Language", required = false) String psUAcceptLanguage, @Parameter(in = ParameterIn.HEADER, description = "The forwarded Agent header field of the HTTP request between PSU and TPP, if available. ", schema = @Schema()) @RequestHeader(value = "PSU-User-Agent", required = false) String psUUserAgent, @Parameter(in = ParameterIn.HEADER, description = "HTTP method used at the PSU ? TPP interface, if available. Valid values are: * GET * POST * PUT * PATCH * DELETE ", schema = @Schema(allowableValues = {"GET", "POST", "PUT", "PATCH", "DELETE"}
    )) @RequestHeader(value = "PSU-Http-Method", required = false) String psUHttpMethod, @Parameter(in = ParameterIn.HEADER, description = "UUID (Universally Unique Identifier) for a device, which is used by the PSU, if available. UUID identifies either a device or a device dependant application installation. In case of an installation identification this ID needs to be unaltered until removal from device. ", schema = @Schema()) @RequestHeader(value = "PSU-Device-ID", required = false) UUID psUDeviceID, @Parameter(in = ParameterIn.HEADER, description = "The forwarded Geo Location of the corresponding http request between PSU and TPP if available. ", schema = @Schema()) @RequestHeader(value = "PSU-Geo-Location", required = false) String psUGeoLocation) {
        return readAccountDetails(accountId, xRequestID, consentID, withBalance, digest, signature, tpPSignatureCertificate, psUIPAddress, psUIPPort, psUAccept, psUAcceptCharset, psUAcceptEncoding, psUAcceptLanguage, psUUserAgent, psUHttpMethod, psUDeviceID, psUGeoLocation);
    }

    // Override this method
    default ResponseEntity<InlineResponse200> readAccountDetails(String accountId, UUID xRequestID, String consentID, Boolean withBalance, String digest, String signature, byte[] tpPSignatureCertificate, String psUIPAddress, String psUIPPort, String psUAccept, String psUAcceptCharset, String psUAcceptEncoding, String psUAcceptLanguage, String psUUserAgent, String psUHttpMethod, UUID psUDeviceID, String psUGeoLocation) {
        if (getObjectMapper().isPresent() && getAcceptHeader().isPresent()) {
        } else {
            log.warn("ObjectMapper or HttpServletRequest not configured in default AccountInformationServiceAisApi interface so no example is generated");
        }
        return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
    }
}

