Skip to content

Commit

Permalink
Add method description in service constructors (#1113)
Browse files Browse the repository at this point in the history
* modify mustache templates and generate checkout

* indenting

* indeting #2

* use api_single classname in mustache
  • Loading branch information
jillingk authored Aug 21, 2023
1 parent 1effec2 commit 7cc02ee
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,21 @@ public class ClassicCheckoutSdkApi extends Service {

protected String baseURL;

/**
* Classic Checkout SDK constructor in {@link com.adyen.service.checkout package}.
* @param client {@link Client } (required)
*/
public ClassicCheckoutSdkApi(Client client) {
super(client);
this.baseURL = createBaseURL("https://checkout-test.adyen.com/v70");
}

/**
* Classic Checkout SDK constructor in {@link com.adyen.service.checkout package}.
* Please use this constructor only if you would like to pass along your own url for routing or testing purposes. The latest API version is defined in this class as a constant.
* @param client {@link Client } (required)
* @param baseURL {@link String } (required)
*/
public ClassicCheckoutSdkApi(Client client, String baseURL) {
super(client);
this.baseURL = baseURL;
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/adyen/service/checkout/ModificationsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,21 @@ public class ModificationsApi extends Service {

protected String baseURL;

/**
* Modifications constructor in {@link com.adyen.service.checkout package}.
* @param client {@link Client } (required)
*/
public ModificationsApi(Client client) {
super(client);
this.baseURL = createBaseURL("https://checkout-test.adyen.com/v70");
}

/**
* Modifications constructor in {@link com.adyen.service.checkout package}.
* Please use this constructor only if you would like to pass along your own url for routing or testing purposes. The latest API version is defined in this class as a constant.
* @param client {@link Client } (required)
* @param baseURL {@link String } (required)
*/
public ModificationsApi(Client client, String baseURL) {
super(client);
this.baseURL = baseURL;
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/adyen/service/checkout/OrdersApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,21 @@ public class OrdersApi extends Service {

protected String baseURL;

/**
* Orders constructor in {@link com.adyen.service.checkout package}.
* @param client {@link Client } (required)
*/
public OrdersApi(Client client) {
super(client);
this.baseURL = createBaseURL("https://checkout-test.adyen.com/v70");
}

/**
* Orders constructor in {@link com.adyen.service.checkout package}.
* Please use this constructor only if you would like to pass along your own url for routing or testing purposes. The latest API version is defined in this class as a constant.
* @param client {@link Client } (required)
* @param baseURL {@link String } (required)
*/
public OrdersApi(Client client, String baseURL) {
super(client);
this.baseURL = baseURL;
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/adyen/service/checkout/PaymentLinksApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,21 @@ public class PaymentLinksApi extends Service {

protected String baseURL;

/**
* Payment links constructor in {@link com.adyen.service.checkout package}.
* @param client {@link Client } (required)
*/
public PaymentLinksApi(Client client) {
super(client);
this.baseURL = createBaseURL("https://checkout-test.adyen.com/v70");
}

/**
* Payment links constructor in {@link com.adyen.service.checkout package}.
* Please use this constructor only if you would like to pass along your own url for routing or testing purposes. The latest API version is defined in this class as a constant.
* @param client {@link Client } (required)
* @param baseURL {@link String } (required)
*/
public PaymentLinksApi(Client client, String baseURL) {
super(client);
this.baseURL = baseURL;
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/adyen/service/checkout/PaymentsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,21 @@ public class PaymentsApi extends Service {

protected String baseURL;

/**
* Payments constructor in {@link com.adyen.service.checkout package}.
* @param client {@link Client } (required)
*/
public PaymentsApi(Client client) {
super(client);
this.baseURL = createBaseURL("https://checkout-test.adyen.com/v70");
}

/**
* Payments constructor in {@link com.adyen.service.checkout package}.
* Please use this constructor only if you would like to pass along your own url for routing or testing purposes. The latest API version is defined in this class as a constant.
* @param client {@link Client } (required)
* @param baseURL {@link String } (required)
*/
public PaymentsApi(Client client, String baseURL) {
super(client);
this.baseURL = baseURL;
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/adyen/service/checkout/RecurringApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,21 @@ public class RecurringApi extends Service {

protected String baseURL;

/**
* Recurring constructor in {@link com.adyen.service.checkout package}.
* @param client {@link Client } (required)
*/
public RecurringApi(Client client) {
super(client);
this.baseURL = createBaseURL("https://checkout-test.adyen.com/v70");
}

/**
* Recurring constructor in {@link com.adyen.service.checkout package}.
* Please use this constructor only if you would like to pass along your own url for routing or testing purposes. The latest API version is defined in this class as a constant.
* @param client {@link Client } (required)
* @param baseURL {@link String } (required)
*/
public RecurringApi(Client client, String baseURL) {
super(client);
this.baseURL = baseURL;
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/adyen/service/checkout/UtilityApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,21 @@ public class UtilityApi extends Service {

protected String baseURL;

/**
* Utility constructor in {@link com.adyen.service.checkout package}.
* @param client {@link Client } (required)
*/
public UtilityApi(Client client) {
super(client);
this.baseURL = createBaseURL("https://checkout-test.adyen.com/v70");
}

/**
* Utility constructor in {@link com.adyen.service.checkout package}.
* Please use this constructor only if you would like to pass along your own url for routing or testing purposes. The latest API version is defined in this class as a constant.
* @param client {@link Client } (required)
* @param baseURL {@link String } (required)
*/
public UtilityApi(Client client, String baseURL) {
super(client);
this.baseURL = baseURL;
Expand Down
10 changes: 10 additions & 0 deletions templates/libraries/jersey3/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,21 @@ public class {{classname}} extends Service {
protected String baseURL;
/**
* {{#operation}}{{#-first}}{{vendorExtensions.x-groupName}}{{/-first}}{{/operation}} constructor in {@link {{{package}}} package}.
* @param client {@link Client } (required)
*/
public {{classname}}(Client client) {
super(client);
this.baseURL = createBaseURL("{{{basePath}}}");
}

/**
* {{#operation}}{{#-first}}{{vendorExtensions.x-groupName}}{{/-first}}{{/operation}} constructor in {@link {{{package}}} package}.
* Please use this constructor only if you would like to pass along your own url for routing or testing purposes. The latest API version is defined in this class as a constant.
* @param client {@link Client } (required)
* @param baseURL {@link String } (required)
*/
public {{classname}}(Client client, String baseURL) {
super(client);
this.baseURL = baseURL;
Expand Down
18 changes: 18 additions & 0 deletions templates/libraries/jersey3/api_single.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,30 @@ import java.util.Map;

{{#operations}}
public class {{smallServiceName}} extends Service {
public static final String API_VERSION = "{{{version}}}";
protected String baseURL;
/**
* {{#operation}}{{#-first}}{{vendorExtensions.x-groupName}}{{/-first}}{{/operation}} constructor in {@link {{{package}}} package}.
* @param client {@link Client } (required)
*/
public {{smallServiceName}}(Client client) {
super(client);
this.baseURL = createBaseURL("{{{basePath}}}");
}

/**
* {{#operation}}{{#-first}}{{vendorExtensions.x-groupName}}{{/-first}}{{/operation}} constructor in {@link {{{package}}} package}.
* Please use this constructor only if you would like to pass along your own url for routing or testing purposes. The latest API version is defined in this class as a constant.
* @param client {@link Client } (required)
* @param baseURL {@link String } (required)
*/
public {{smallServiceName}}(Client client, String baseURL) {
super(client);
this.baseURL = baseURL;
}
{{#operation}}

{{>api_summary_overload}}
Expand Down

0 comments on commit 7cc02ee

Please sign in to comment.