Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix java templates
  • Loading branch information
wing328 committed Jan 14, 2019
commit c1ec4ec23fe9d1531584b380bcb126ecccf86810
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ import java.text.DateFormat;
import {{invokerPackage}}.auth.Authentication;
import {{invokerPackage}}.auth.HttpBasicAuth;
import {{invokerPackage}}.auth.ApiKeyAuth;
{{#hasOAuthMethods}}
import {{invokerPackage}}.auth.OAuth;
{{/hasOAuthMethods}}

{{>generatedAnnotation}}
public class ApiClient {
Expand Down Expand Up @@ -261,6 +263,7 @@ public class ApiClient {
throw new RuntimeException("No API key authentication configured!");
}

{{#hasOAuthMethods}}
/**
* Helper method to set access token for the first OAuth2 authentication.
* @param accessToken Access token
Expand All @@ -275,6 +278,7 @@ public class ApiClient {
throw new RuntimeException("No OAuth2 authentication configured!");
}

{{/hasOAuthMethods}}
/**
* Set the User-Agent header's value (by adding to the default header map).
* @param userAgent User agent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ import java.util.regex.Pattern;
import {{invokerPackage}}.auth.Authentication;
import {{invokerPackage}}.auth.HttpBasicAuth;
import {{invokerPackage}}.auth.ApiKeyAuth;
{{#hasOAuthMethods}}
import {{invokerPackage}}.auth.OAuth;
{{/hasOAuthMethods}}

{{>generatedAnnotation}}
public class ApiClient {
Expand Down Expand Up @@ -190,6 +192,7 @@ public class ApiClient {
throw new RuntimeException("No API key authentication configured!");
}

{{#hasOAuthMethods}}
/**
* Helper method to set access token for the first OAuth2 authentication.
* @param accessToken Access token
Expand All @@ -204,6 +207,7 @@ public class ApiClient {
throw new RuntimeException("No OAuth2 authentication configured!");
}

{{/hasOAuthMethods}}
/**
* Set the User-Agent header's value (by adding to the default header map).
* @param userAgent Http user agent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ import org.jboss.resteasy.spi.ResteasyProviderFactory;
import {{invokerPackage}}.auth.Authentication;
import {{invokerPackage}}.auth.HttpBasicAuth;
import {{invokerPackage}}.auth.ApiKeyAuth;
{{#hasOAuthMethods}}
import {{invokerPackage}}.auth.OAuth;
{{/hasOAuthMethods}}

{{>generatedAnnotation}}
public class ApiClient {
Expand Down Expand Up @@ -200,6 +202,7 @@ public class ApiClient {
throw new RuntimeException("No API key authentication configured!");
}

{{#hasOAuthMethods}}
/**
* Helper method to set access token for the first OAuth2 authentication.
* @param accessToken the access token
Expand All @@ -214,6 +217,7 @@ public class ApiClient {
throw new RuntimeException("No OAuth2 authentication configured!");
}

{{/hasOAuthMethods}}
/**
* Set the User-Agent header's value (by adding to the default header map).
* @param userAgent the User-Agent header value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ import java.util.TimeZone;
import {{invokerPackage}}.auth.Authentication;
import {{invokerPackage}}.auth.HttpBasicAuth;
import {{invokerPackage}}.auth.ApiKeyAuth;
{{#hasOAuthMethods}}
import {{invokerPackage}}.auth.OAuth;
{{/hasOAuthMethods}}

{{>generatedAnnotation}}
@Component("{{invokerPackage}}.ApiClient")
Expand Down Expand Up @@ -239,6 +241,7 @@ public class ApiClient {
throw new RuntimeException("No API key authentication configured!");
}

{{#hasOAuthMethods}}
/**
* Helper method to set access token for the first OAuth2 authentication.
* @param accessToken the access token
Expand All @@ -253,6 +256,7 @@ public class ApiClient {
throw new RuntimeException("No OAuth2 authentication configured!");
}

{{/hasOAuthMethods}}
/**
* Set the User-Agent header's value (by adding to the default header map).
* @param userAgent the user agent string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package {{invokerPackage}};
import {{invokerPackage}}.auth.Authentication;
import {{invokerPackage}}.auth.HttpBasicAuth;
import {{invokerPackage}}.auth.ApiKeyAuth;
{{#hasOAuthMethods}}
import {{invokerPackage}}.auth.OAuth;
{{/hasOAuthMethods}}

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.type.TypeReference;
Expand Down Expand Up @@ -219,6 +221,7 @@ public class ApiClient {
throw new RuntimeException("No API key authentication configured!");
}

{{#hasOAuthMethods}}
/**
* Helper method to set access token for the first OAuth2 authentication.
*
Expand All @@ -234,6 +237,7 @@ public class ApiClient {
throw new RuntimeException("No OAuth2 authentication configured!");
}

{{/hasOAuthMethods}}
/**
* Format the given Date object into string.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ import java.util.TimeZone;
import {{invokerPackage}}.auth.Authentication;
import {{invokerPackage}}.auth.HttpBasicAuth;
import {{invokerPackage}}.auth.ApiKeyAuth;
{{#hasOAuthMethods}}
import {{invokerPackage}}.auth.OAuth;
{{/hasOAuthMethods}}

{{>generatedAnnotation}}
public class ApiClient {
Expand Down Expand Up @@ -236,6 +238,7 @@ public class ApiClient {
throw new RuntimeException("No API key authentication configured!");
}

{{#hasOAuthMethods}}
/**
* Helper method to set access token for the first OAuth2 authentication.
* @param accessToken the access token
Expand All @@ -250,6 +253,7 @@ public class ApiClient {
throw new RuntimeException("No OAuth2 authentication configured!");
}

{{/hasOAuthMethods}}
/**
* Set the User-Agent header's value (by adding to the default header map).
* @param userAgent the user agent string
Expand Down