jp.gopay.sdk.resources.WebhooksResource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gopay-java-sdk Show documentation
Show all versions of gopay-java-sdk Show documentation
Official Gyro-n Payments Java SDK
package jp.gopay.sdk.resources;
import jp.gopay.sdk.models.common.IdempotencyKey;
import jp.gopay.sdk.models.common.StoreId;
import jp.gopay.sdk.models.common.Void;
import jp.gopay.sdk.models.common.WebhookId;
import jp.gopay.sdk.models.request.store.WebhookReq;
import jp.gopay.sdk.models.response.PaginatedList;
import jp.gopay.sdk.models.response.webhook.Webhook;
import jp.gopay.sdk.types.CursorDirection;
import retrofit2.Call;
import retrofit2.http.*;
import javax.annotation.Nullable;
import static jp.gopay.sdk.constants.GopayConstants.idempotencyKeyHeaderName;
/**
* Resources for managing webhooks associated with the merchant's stores.
*/
public interface WebhooksResource {
@GET("/webhooks")
Call> list(
@Query("limit") @Nullable Integer limit,
@Query("cursor_direction") @Nullable CursorDirection cursorDirection,
@Query("cursor") @Nullable WebhookId cursor
);
@GET("/webhooks/{webhookId}")
Call get(
@Path("webhookId") WebhookId webhookId
);
@POST("/webhooks")
Call create(
@Body WebhookReq dataToPost,
@Header(idempotencyKeyHeaderName) IdempotencyKey idempotencyKey
);
@PATCH("/webhooks/{webhookId}")
Call update(
@Path("webhookId") WebhookId webhookId,
@Body WebhookReq dataToPost,
@Header(idempotencyKeyHeaderName) IdempotencyKey idempotencyKey
);
@DELETE("/webhooks/{webhookId}")
Call delete(
@Path("webhookId") WebhookId webhookId
);
@GET("/stores/{storeId}/webhooks")
Call> list(
@Path("storeId") StoreId storeId,
@Query("limit") @Nullable Integer limit,
@Query("cursor_direction") @Nullable CursorDirection cursorDirection,
@Query("cursor") @Nullable WebhookId cursor
);
@POST("/stores/{storeId}/webhooks")
Call create(
@Path("storeId") StoreId storeId,
@Body WebhookReq dataToPost,
@Header(idempotencyKeyHeaderName) IdempotencyKey idempotencyKey
);
@GET("/stores/{storeId}/webhooks/{webhookId}")
Call get(
@Path("storeId") StoreId storeId,
@Path("webhookId") WebhookId webhookId
);
@PATCH("/stores/{storeId}/webhooks/{webhookId}")
Call update(
@Path("storeId") StoreId storeId,
@Path("webhookId") WebhookId webhookId,
@Body WebhookReq dataToPost,
@Header(idempotencyKeyHeaderName) IdempotencyKey idempotencyKey
);
@DELETE("/stores/{storeId}/webhooks/{webhookId}")
Call delete(
@Path("storeId") StoreId storeId,
@Path("webhookId") WebhookId webhookId
);
}