From f492c712bdaf0bb126d39cd0235037fe2320093d Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Fri, 4 Jun 2021 13:15:08 -0700 Subject: [PATCH] Fixed KDocs. --- .../-bitlinks/clicks.html | 2 +- .../-bitlinks/create.html | 2 +- .../-bitlinks/expand.html | 2 +- .../-bitlinks/shorten.html | 2 +- .../-bitlinks/update.html | 2 +- .../kotlin/net/thauvin/erik/bitly/Bitlinks.kt | 24 +++++++++---------- .../net/thauvin/erik/bitly/BitlyTest.kt | 5 ++++ 7 files changed, 22 insertions(+), 17 deletions(-) diff --git a/docs/bitly-shorten/net.thauvin.erik.bitly/-bitlinks/clicks.html b/docs/bitly-shorten/net.thauvin.erik.bitly/-bitlinks/clicks.html index 48b12de..b2ae3df 100644 --- a/docs/bitly-shorten/net.thauvin.erik.bitly/-bitlinks/clicks.html +++ b/docs/bitly-shorten/net.thauvin.erik.bitly/-bitlinks/clicks.html @@ -28,7 +28,7 @@
fun clicks(bitlink: String, unit: Units = Units.DAY, units: Int = -1, size: Int = 50, unit_reference: String = Constants.EMPTY, toJson: Boolean = false): String
-

Returns the click counts for a specified Bitlink.

See the Bitly API for more information.

Return

The click counts or JSON response object.

Parameters

bitlink

A Bitlink made of the domain and hash.

units

An integer representing the time units to query data for. Pass -1 to return all units available.

size

The quantity of items to be be returned.

unit_reference

An ISO-8601 timestamp, indicating the most recent time for which to pull metrics. Will default to current time.

toJson

Returns the full JSON response if true

+

Returns the click counts for a specified Bitlink.

See the Bitly API for more information.

Return

The click counts.

Parameters

bitlink

A Bitlink made of the domain and hash.

units

An integer representing the time units to query data for. Pass -1 to return all units available.

size

The quantity of items to be be returned.

unit_reference

An ISO-8601 timestamp, indicating the most recent time for which to pull metrics. Will default to current time.

toJson

Returns the full JSON response if true.

diff --git a/docs/bitly-shorten/net.thauvin.erik.bitly/-bitlinks/create.html b/docs/bitly-shorten/net.thauvin.erik.bitly/-bitlinks/create.html index 6290bd0..b16d29c 100644 --- a/docs/bitly-shorten/net.thauvin.erik.bitly/-bitlinks/create.html +++ b/docs/bitly-shorten/net.thauvin.erik.bitly/-bitlinks/create.html @@ -28,7 +28,7 @@
fun create(domain: String = Constants.EMPTY, title: String = Constants.EMPTY, group_guid: String = Constants.EMPTY, tags: Array<String> = emptyArray(), deeplinks: Array<Map<String, String>> = emptyArray(), long_url: String, toJson: Boolean = false): String
-

Converts a long url to a Bitlink and sets additional parameters.

See the Bit.ly API for more information.

Return

The shorten URL or JSON response, or on error, an empty string/JSON object.

Parameters

toJson

Returns the full JSON response if true

+

Converts a long url to a Bitlink and sets additional parameters.

See the Bit.ly API for more information.

Return

The shorten URL or an empty string on error.

Parameters

long_url

The long URL.

toJson

Returns the full JSON response if true.

diff --git a/docs/bitly-shorten/net.thauvin.erik.bitly/-bitlinks/expand.html b/docs/bitly-shorten/net.thauvin.erik.bitly/-bitlinks/expand.html index cabf4e8..7649ef8 100644 --- a/docs/bitly-shorten/net.thauvin.erik.bitly/-bitlinks/expand.html +++ b/docs/bitly-shorten/net.thauvin.erik.bitly/-bitlinks/expand.html @@ -28,7 +28,7 @@
fun expand(bitlink_id: String, toJson: Boolean = false): String
-

Expands a Bitlink.

See the Bit.ly API for more information.

Return

The long URL or JSON response, or on error, an empty string/JSON object.

Parameters

bitlink_id

The bitlink ID.

toJson

Returns the full JSON response if true

+

Expands a Bitlink.

See the Bit.ly API for more information.

Return

The long URL or an empty string on error.

Parameters

bitlink_id

The bitlink ID.

toJson

Returns the full JSON response if true.

diff --git a/docs/bitly-shorten/net.thauvin.erik.bitly/-bitlinks/shorten.html b/docs/bitly-shorten/net.thauvin.erik.bitly/-bitlinks/shorten.html index 8ba0a99..9373859 100644 --- a/docs/bitly-shorten/net.thauvin.erik.bitly/-bitlinks/shorten.html +++ b/docs/bitly-shorten/net.thauvin.erik.bitly/-bitlinks/shorten.html @@ -28,7 +28,7 @@
fun shorten(long_url: String, group_guid: String = Constants.EMPTY, domain: String = Constants.EMPTY, toJson: Boolean = false): String
-

Shortens a long URL.

See the Bit.ly API for more information.

Return

The short URL or JSON response, or on error, the long_url or an empty JSON object.

Parameters

long_url

The long URL.

toJson

Returns the full JSON response if true

+

Shortens a long URL.

See the Bit.ly API for more information.

Return

The short URL or the long_url on error.

Parameters

long_url

The long URL.

toJson

Returns the full JSON response if true.

diff --git a/docs/bitly-shorten/net.thauvin.erik.bitly/-bitlinks/update.html b/docs/bitly-shorten/net.thauvin.erik.bitly/-bitlinks/update.html index 44d3426..dbe8a9b 100644 --- a/docs/bitly-shorten/net.thauvin.erik.bitly/-bitlinks/update.html +++ b/docs/bitly-shorten/net.thauvin.erik.bitly/-bitlinks/update.html @@ -28,7 +28,7 @@
fun update(bitlink: String, references: Map<String, String> = emptyMap(), archived: Boolean = false, tags: Array<String> = emptyArray(), created_at: String = Constants.EMPTY, title: String = Constants.EMPTY, deeplinks: Array<Map<String, String>> = emptyArray(), created_by: String = Constants.EMPTY, long_url: String = Constants.EMPTY, client_id: String = Constants.EMPTY, custom_bitlinks: Array<String> = emptyArray(), link: String = Constants.EMPTY, id: String = Constants.EMPTY, toJson: Boolean = false): String
-

Updates fields in the specified Bitlink.

See the Bit.ly API for more information.

Return

true is the update was successful, false otherwise, or JSON response.

Parameters

toJson

Returns the full JSON response if true

+

Updates fields in the specified Bitlink.

See the Bit.ly API for more information.

Return

Constants.TRUE if the update was successful, Constants.FALSE otherwise.

Parameters

bitlink

A Bitlink made of the domain and hash.

toJson

Returns the full JSON response if true.

diff --git a/src/main/kotlin/net/thauvin/erik/bitly/Bitlinks.kt b/src/main/kotlin/net/thauvin/erik/bitly/Bitlinks.kt index 45217a8..6ed046b 100644 --- a/src/main/kotlin/net/thauvin/erik/bitly/Bitlinks.kt +++ b/src/main/kotlin/net/thauvin/erik/bitly/Bitlinks.kt @@ -62,8 +62,8 @@ open class Bitlinks(private val accessToken: String) { * @param size The quantity of items to be be returned. * @param unit_reference An ISO-8601 timestamp, indicating the most recent time for which to pull metrics. * Will default to current time. - * @param toJson Returns the full JSON response if `true` - * @return The click counts or JSON response object. + * @param toJson Returns the full JSON response if `true`. + * @return The click counts. */ @Synchronized @JvmOverloads @@ -98,9 +98,9 @@ open class Bitlinks(private val accessToken: String) { * * See the [Bit.ly API](https://dev.bitly.com/api-reference#createFullBitlink) for more information. * - * @oaran long_url The long URL. - * @param toJson Returns the full JSON response if `true` - * @return The shorten URL or JSON response, or on error, an empty string/JSON object. + * @param long_url The long URL. + * @param toJson Returns the full JSON response if `true`. + * @return The shorten URL or an empty string on error. */ @Synchronized @JvmOverloads @@ -138,8 +138,8 @@ open class Bitlinks(private val accessToken: String) { * See the [Bit.ly API](https://dev.bitly.com/api-reference#expandBitlink) for more information. * * @param bitlink_id The bitlink ID. - * @param toJson Returns the full JSON response if `true` - * @return The long URL or JSON response, or on error, an empty string/JSON object. + * @param toJson Returns the full JSON response if `true`. + * @return The long URL or an empty string on error. */ @Synchronized @JvmOverloads @@ -187,8 +187,8 @@ open class Bitlinks(private val accessToken: String) { * See the [Bit.ly API](https://dev.bitly.com/api-reference#createBitlink) for more information. * * @param long_url The long URL. - * @param toJson Returns the full JSON response if `true` - * @return The short URL or JSON response, or on error, the [long_url] or an empty JSON object. + * @param toJson Returns the full JSON response if `true`. + * @return The short URL or the [long_url] on error. */ @Synchronized @JvmOverloads @@ -221,9 +221,9 @@ open class Bitlinks(private val accessToken: String) { * * See the [Bit.ly API](https://dev.bitly.com/api-reference#updateBitlink) for more information. * - * @oaran bitlink A Bitlink made of the domain and hash. - * @param toJson Returns the full JSON response if `true` - * @return `true` is the update was successful, `false` otherwise, or JSON response. + * @param bitlink A Bitlink made of the domain and hash. + * @param toJson Returns the full JSON response if `true`. + * @return [Constants.TRUE] if the update was successful, [Constants.FALSE] otherwise. */ @Synchronized @JvmOverloads diff --git a/src/test/kotlin/net/thauvin/erik/bitly/BitlyTest.kt b/src/test/kotlin/net/thauvin/erik/bitly/BitlyTest.kt index 8964d02..a7fc0d3 100644 --- a/src/test/kotlin/net/thauvin/erik/bitly/BitlyTest.kt +++ b/src/test/kotlin/net/thauvin/erik/bitly/BitlyTest.kt @@ -84,6 +84,11 @@ class BitlyTest { assertEquals(Constants.EMPTY, bitly.bitlinks().shorten(Constants.EMPTY)) } + @Test + fun `long url should not be short`() { + assertEquals(shortUrl, bitly.bitlinks().shorten(shortUrl)) + } + @Test fun `shorten = expand`() { val shortUrl = bitly.bitlinks().shorten(longUrl, domain = "bit.ly")