Class WebhooksApi

java.lang.Object
com.duffel.sdk.api.WebhooksApi

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2024-01-16T15:26:22.356688490+07:00[Asia/Bangkok]") public class WebhooksApi extends Object
  • Constructor Details

    • WebhooksApi

      public WebhooksApi()
    • WebhooksApi

      @Autowired public WebhooksApi(ApiClient apiClient)
  • Method Details

    • getApiClient

      public ApiClient getApiClient()
    • setApiClient

      public void setApiClient(ApiClient apiClient)
    • createWebhook

      public reactor.core.publisher.Mono<CreateWebhook201Response> createWebhook(String accept, String duffelVersion, String acceptEncoding, String contentType, CreateWebhookRequest createWebhookRequest) throws org.springframework.web.reactive.function.client.WebClientResponseException
      Create a webhook To start receiving notifications of events, you'll need to create a webhook that details the server that will receive the notifications. The webhook will be created in live mode or test mode based on the access token you're using. If you're using a test mode access token, the webhook will be created in test mode and will receive events related to test mode resources. If you're using a live mode access token, it'll receive events related to live mode. Duffel only allows one webhook to be defined per live mode value, basically your organisation can only have one url with `live_mode: true` and another with `live_mode: false`. To ensure the highest level of security we run some checks on the URL we receive, the URL must be for an https server, we do not accept IP addresses and some URLs are blacklisted (e.g. https://localhost). By default, the webhook will be active.

      201 - A webhook object

      Parameters:
      accept - All responses from the API are in JSON format with UTF-8 encoding. An `Accept` header is required with every request.
      duffelVersion - You'll need to send a `Duffel-Version` header with each request so we know which version of the API you want to use. Currently, the only available API version is `beta`.
      acceptEncoding - We recommend enabling compression for responses returned by the API, since they can be very large. To enable compression, send an `Accept-Encoding` header. You'll need to configure your HTTP client to decompress responses. Most clients will have this functionality built-in.
      contentType - All request bodies sent to the API should be in JSON format. A `Content-Type` header is required whenever you're sending a request body (i.e. for POST and PUT requests).
      createWebhookRequest - The createWebhookRequest parameter
      Returns:
      CreateWebhook201Response
      Throws:
      org.springframework.web.reactive.function.client.WebClientResponseException - if an error occurs while attempting to invoke the API
    • createWebhookWithHttpInfo

      public reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<CreateWebhook201Response>> createWebhookWithHttpInfo(String accept, String duffelVersion, String acceptEncoding, String contentType, CreateWebhookRequest createWebhookRequest) throws org.springframework.web.reactive.function.client.WebClientResponseException
      Create a webhook To start receiving notifications of events, you'll need to create a webhook that details the server that will receive the notifications. The webhook will be created in live mode or test mode based on the access token you're using. If you're using a test mode access token, the webhook will be created in test mode and will receive events related to test mode resources. If you're using a live mode access token, it'll receive events related to live mode. Duffel only allows one webhook to be defined per live mode value, basically your organisation can only have one url with `live_mode: true` and another with `live_mode: false`. To ensure the highest level of security we run some checks on the URL we receive, the URL must be for an https server, we do not accept IP addresses and some URLs are blacklisted (e.g. https://localhost). By default, the webhook will be active.

      201 - A webhook object

      Parameters:
      accept - All responses from the API are in JSON format with UTF-8 encoding. An `Accept` header is required with every request.
      duffelVersion - You'll need to send a `Duffel-Version` header with each request so we know which version of the API you want to use. Currently, the only available API version is `beta`.
      acceptEncoding - We recommend enabling compression for responses returned by the API, since they can be very large. To enable compression, send an `Accept-Encoding` header. You'll need to configure your HTTP client to decompress responses. Most clients will have this functionality built-in.
      contentType - All request bodies sent to the API should be in JSON format. A `Content-Type` header is required whenever you're sending a request body (i.e. for POST and PUT requests).
      createWebhookRequest - The createWebhookRequest parameter
      Returns:
      ResponseEntity<CreateWebhook201Response>
      Throws:
      org.springframework.web.reactive.function.client.WebClientResponseException - if an error occurs while attempting to invoke the API
    • createWebhookWithResponseSpec

      public org.springframework.web.reactive.function.client.WebClient.ResponseSpec createWebhookWithResponseSpec(String accept, String duffelVersion, String acceptEncoding, String contentType, CreateWebhookRequest createWebhookRequest) throws org.springframework.web.reactive.function.client.WebClientResponseException
      Create a webhook To start receiving notifications of events, you'll need to create a webhook that details the server that will receive the notifications. The webhook will be created in live mode or test mode based on the access token you're using. If you're using a test mode access token, the webhook will be created in test mode and will receive events related to test mode resources. If you're using a live mode access token, it'll receive events related to live mode. Duffel only allows one webhook to be defined per live mode value, basically your organisation can only have one url with `live_mode: true` and another with `live_mode: false`. To ensure the highest level of security we run some checks on the URL we receive, the URL must be for an https server, we do not accept IP addresses and some URLs are blacklisted (e.g. https://localhost). By default, the webhook will be active.

      201 - A webhook object

      Parameters:
      accept - All responses from the API are in JSON format with UTF-8 encoding. An `Accept` header is required with every request.
      duffelVersion - You'll need to send a `Duffel-Version` header with each request so we know which version of the API you want to use. Currently, the only available API version is `beta`.
      acceptEncoding - We recommend enabling compression for responses returned by the API, since they can be very large. To enable compression, send an `Accept-Encoding` header. You'll need to configure your HTTP client to decompress responses. Most clients will have this functionality built-in.
      contentType - All request bodies sent to the API should be in JSON format. A `Content-Type` header is required whenever you're sending a request body (i.e. for POST and PUT requests).
      createWebhookRequest - The createWebhookRequest parameter
      Returns:
      ResponseSpec
      Throws:
      org.springframework.web.reactive.function.client.WebClientResponseException - if an error occurs while attempting to invoke the API
    • getWebhook

      public reactor.core.publisher.Mono<GetWebhook200Response> getWebhook(String accept, String duffelVersion, String acceptEncoding, Integer limit, String before, String after) throws org.springframework.web.reactive.function.client.WebClientResponseException
      List webhooks Retrieve a paginated list of webhooks

      200 - A paginated list of webhooks

      Parameters:
      accept - All responses from the API are in JSON format with UTF-8 encoding. An `Accept` header is required with every request.
      duffelVersion - You'll need to send a `Duffel-Version` header with each request so we know which version of the API you want to use. Currently, the only available API version is `beta`.
      acceptEncoding - We recommend enabling compression for responses returned by the API, since they can be very large. To enable compression, send an `Accept-Encoding` header. You'll need to configure your HTTP client to decompress responses. Most clients will have this functionality built-in.
      limit - The maximum number of records to return per page. Defaults to `50`. May be set to any integer between `1` and `200`. For more information on how to paginate through records, see the [Pagination](/docs/api/overview/pagination) section.
      before - A cursor pointing to the next page of records. For more information on how to paginate through records, see the [Pagination](/docs/api/overview/pagination) section.
      after - A cursor pointing to the previous page of records. For more information on how to paginate through records, see the [Pagination](/docs/api/overview/pagination) section.
      Returns:
      GetWebhook200Response
      Throws:
      org.springframework.web.reactive.function.client.WebClientResponseException - if an error occurs while attempting to invoke the API
    • getWebhookWithHttpInfo

      public reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<GetWebhook200Response>> getWebhookWithHttpInfo(String accept, String duffelVersion, String acceptEncoding, Integer limit, String before, String after) throws org.springframework.web.reactive.function.client.WebClientResponseException
      List webhooks Retrieve a paginated list of webhooks

      200 - A paginated list of webhooks

      Parameters:
      accept - All responses from the API are in JSON format with UTF-8 encoding. An `Accept` header is required with every request.
      duffelVersion - You'll need to send a `Duffel-Version` header with each request so we know which version of the API you want to use. Currently, the only available API version is `beta`.
      acceptEncoding - We recommend enabling compression for responses returned by the API, since they can be very large. To enable compression, send an `Accept-Encoding` header. You'll need to configure your HTTP client to decompress responses. Most clients will have this functionality built-in.
      limit - The maximum number of records to return per page. Defaults to `50`. May be set to any integer between `1` and `200`. For more information on how to paginate through records, see the [Pagination](/docs/api/overview/pagination) section.
      before - A cursor pointing to the next page of records. For more information on how to paginate through records, see the [Pagination](/docs/api/overview/pagination) section.
      after - A cursor pointing to the previous page of records. For more information on how to paginate through records, see the [Pagination](/docs/api/overview/pagination) section.
      Returns:
      ResponseEntity<GetWebhook200Response>
      Throws:
      org.springframework.web.reactive.function.client.WebClientResponseException - if an error occurs while attempting to invoke the API
    • getWebhookWithResponseSpec

      public org.springframework.web.reactive.function.client.WebClient.ResponseSpec getWebhookWithResponseSpec(String accept, String duffelVersion, String acceptEncoding, Integer limit, String before, String after) throws org.springframework.web.reactive.function.client.WebClientResponseException
      List webhooks Retrieve a paginated list of webhooks

      200 - A paginated list of webhooks

      Parameters:
      accept - All responses from the API are in JSON format with UTF-8 encoding. An `Accept` header is required with every request.
      duffelVersion - You'll need to send a `Duffel-Version` header with each request so we know which version of the API you want to use. Currently, the only available API version is `beta`.
      acceptEncoding - We recommend enabling compression for responses returned by the API, since they can be very large. To enable compression, send an `Accept-Encoding` header. You'll need to configure your HTTP client to decompress responses. Most clients will have this functionality built-in.
      limit - The maximum number of records to return per page. Defaults to `50`. May be set to any integer between `1` and `200`. For more information on how to paginate through records, see the [Pagination](/docs/api/overview/pagination) section.
      before - A cursor pointing to the next page of records. For more information on how to paginate through records, see the [Pagination](/docs/api/overview/pagination) section.
      after - A cursor pointing to the previous page of records. For more information on how to paginate through records, see the [Pagination](/docs/api/overview/pagination) section.
      Returns:
      ResponseSpec
      Throws:
      org.springframework.web.reactive.function.client.WebClientResponseException - if an error occurs while attempting to invoke the API
    • pingWebhook

      public reactor.core.publisher.Mono<Void> pingWebhook(String accept, String duffelVersion, String id, String acceptEncoding) throws org.springframework.web.reactive.function.client.WebClientResponseException
      Ping a webhook Send a ping, a \"fake event\" notification, to a webhook

      204 - Ping sent to webhook

      Parameters:
      accept - All responses from the API are in JSON format with UTF-8 encoding. An `Accept` header is required with every request.
      duffelVersion - You'll need to send a `Duffel-Version` header with each request so we know which version of the API you want to use. Currently, the only available API version is `beta`.
      id - Duffel's unique identifier for the webhook
      acceptEncoding - We recommend enabling compression for responses returned by the API, since they can be very large. To enable compression, send an `Accept-Encoding` header. You'll need to configure your HTTP client to decompress responses. Most clients will have this functionality built-in.
      Throws:
      org.springframework.web.reactive.function.client.WebClientResponseException - if an error occurs while attempting to invoke the API
    • pingWebhookWithHttpInfo

      public reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<Void>> pingWebhookWithHttpInfo(String accept, String duffelVersion, String id, String acceptEncoding) throws org.springframework.web.reactive.function.client.WebClientResponseException
      Ping a webhook Send a ping, a \"fake event\" notification, to a webhook

      204 - Ping sent to webhook

      Parameters:
      accept - All responses from the API are in JSON format with UTF-8 encoding. An `Accept` header is required with every request.
      duffelVersion - You'll need to send a `Duffel-Version` header with each request so we know which version of the API you want to use. Currently, the only available API version is `beta`.
      id - Duffel's unique identifier for the webhook
      acceptEncoding - We recommend enabling compression for responses returned by the API, since they can be very large. To enable compression, send an `Accept-Encoding` header. You'll need to configure your HTTP client to decompress responses. Most clients will have this functionality built-in.
      Throws:
      org.springframework.web.reactive.function.client.WebClientResponseException - if an error occurs while attempting to invoke the API
    • pingWebhookWithResponseSpec

      public org.springframework.web.reactive.function.client.WebClient.ResponseSpec pingWebhookWithResponseSpec(String accept, String duffelVersion, String id, String acceptEncoding) throws org.springframework.web.reactive.function.client.WebClientResponseException
      Ping a webhook Send a ping, a \"fake event\" notification, to a webhook

      204 - Ping sent to webhook

      Parameters:
      accept - All responses from the API are in JSON format with UTF-8 encoding. An `Accept` header is required with every request.
      duffelVersion - You'll need to send a `Duffel-Version` header with each request so we know which version of the API you want to use. Currently, the only available API version is `beta`.
      id - Duffel's unique identifier for the webhook
      acceptEncoding - We recommend enabling compression for responses returned by the API, since they can be very large. To enable compression, send an `Accept-Encoding` header. You'll need to configure your HTTP client to decompress responses. Most clients will have this functionality built-in.
      Returns:
      ResponseSpec
      Throws:
      org.springframework.web.reactive.function.client.WebClientResponseException - if an error occurs while attempting to invoke the API
    • updateWebhook

      public reactor.core.publisher.Mono<UpdateWebhook200Response> updateWebhook(String accept, String duffelVersion, String id, String acceptEncoding, UpdateWebhookRequest updateWebhookRequest) throws org.springframework.web.reactive.function.client.WebClientResponseException
      Update a webhook Update a webhook

      200 - A webhook object

      Parameters:
      accept - All responses from the API are in JSON format with UTF-8 encoding. An `Accept` header is required with every request.
      duffelVersion - You'll need to send a `Duffel-Version` header with each request so we know which version of the API you want to use. Currently, the only available API version is `beta`.
      id - Duffel's unique identifier for the webhook
      acceptEncoding - We recommend enabling compression for responses returned by the API, since they can be very large. To enable compression, send an `Accept-Encoding` header. You'll need to configure your HTTP client to decompress responses. Most clients will have this functionality built-in.
      updateWebhookRequest - The updateWebhookRequest parameter
      Returns:
      UpdateWebhook200Response
      Throws:
      org.springframework.web.reactive.function.client.WebClientResponseException - if an error occurs while attempting to invoke the API
    • updateWebhookWithHttpInfo

      public reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<UpdateWebhook200Response>> updateWebhookWithHttpInfo(String accept, String duffelVersion, String id, String acceptEncoding, UpdateWebhookRequest updateWebhookRequest) throws org.springframework.web.reactive.function.client.WebClientResponseException
      Update a webhook Update a webhook

      200 - A webhook object

      Parameters:
      accept - All responses from the API are in JSON format with UTF-8 encoding. An `Accept` header is required with every request.
      duffelVersion - You'll need to send a `Duffel-Version` header with each request so we know which version of the API you want to use. Currently, the only available API version is `beta`.
      id - Duffel's unique identifier for the webhook
      acceptEncoding - We recommend enabling compression for responses returned by the API, since they can be very large. To enable compression, send an `Accept-Encoding` header. You'll need to configure your HTTP client to decompress responses. Most clients will have this functionality built-in.
      updateWebhookRequest - The updateWebhookRequest parameter
      Returns:
      ResponseEntity<UpdateWebhook200Response>
      Throws:
      org.springframework.web.reactive.function.client.WebClientResponseException - if an error occurs while attempting to invoke the API
    • updateWebhookWithResponseSpec

      public org.springframework.web.reactive.function.client.WebClient.ResponseSpec updateWebhookWithResponseSpec(String accept, String duffelVersion, String id, String acceptEncoding, UpdateWebhookRequest updateWebhookRequest) throws org.springframework.web.reactive.function.client.WebClientResponseException
      Update a webhook Update a webhook

      200 - A webhook object

      Parameters:
      accept - All responses from the API are in JSON format with UTF-8 encoding. An `Accept` header is required with every request.
      duffelVersion - You'll need to send a `Duffel-Version` header with each request so we know which version of the API you want to use. Currently, the only available API version is `beta`.
      id - Duffel's unique identifier for the webhook
      acceptEncoding - We recommend enabling compression for responses returned by the API, since they can be very large. To enable compression, send an `Accept-Encoding` header. You'll need to configure your HTTP client to decompress responses. Most clients will have this functionality built-in.
      updateWebhookRequest - The updateWebhookRequest parameter
      Returns:
      ResponseSpec
      Throws:
      org.springframework.web.reactive.function.client.WebClientResponseException - if an error occurs while attempting to invoke the API