Class AddLinkifierApiRequest
java.lang.Object
com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
com.github.jamesnetherton.zulip.client.api.server.request.AddLinkifierApiRequest
- All Implemented Interfaces:
ExecutableApiRequest<Long>
Zulip API request builder for adding a linkifier.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAddLinkifierApiRequest(ZulipHttpClient client, String pattern, String urlTemplate) Constrtucts aAddLinkifierApiRequest. -
Method Summary
Modifier and TypeMethodDescriptionexecute()Executes the Zulip API request for adding a linkifier.withAlternativeUrlTemplates(String... alternativeUrlTemplates) Sets additional RFC 6570 compliant URL templates used for reverse linkification.withExampleInput(String exampleInput) Sets an example input string that matches the linkifier pattern.withReverseTemplate(String reverseTemplate) Sets the template used to convert a URL back into the text that the linkifier pattern matches.Methods inherited from class ZulipApiRequest
client, getParam, getParam, getParams, putParam, putParamAsJsonString, putParamAsWrappedObject
-
Field Details
-
PATTERN
- See Also:
-
URL_TEMPLATE
- See Also:
-
EXAMPLE_INPUT
- See Also:
-
REVERSE_TEMPLATE
- See Also:
-
ALTERNATIVE_URL_TEMPLATES
- See Also:
-
-
Constructor Details
-
AddLinkifierApiRequest
Constrtucts aAddLinkifierApiRequest.- Parameters:
client- The Zulip HTTP clientpattern- The The regular expression that should trigger the linkifierurlTemplate- The RFC 6570 compliant URL template used for the link
-
-
Method Details
-
withExampleInput
Sets an example input string that matches the linkifier pattern. Required when setting a reverse template.- Parameters:
exampleInput- The example input- Returns:
- This
AddLinkifierApiRequestinstance - See Also:
-
withReverseTemplate
Sets the template used to convert a URL back into the text that the linkifier pattern matches.- Parameters:
reverseTemplate- The reverse template- Returns:
- This
AddLinkifierApiRequestinstance - See Also:
-
withAlternativeUrlTemplates
Sets additional RFC 6570 compliant URL templates used for reverse linkification.- Parameters:
alternativeUrlTemplates- The alternative URL templates- Returns:
- This
AddLinkifierApiRequestinstance - See Also:
-
execute
Executes the Zulip API request for adding a linkifier.- Specified by:
executein interfaceExecutableApiRequest<Long>- Returns:
- The id of the created linkifier
- Throws:
ZulipClientException- if the request was not successful
-