Skip to content

Commit d4f636e

Browse files
committed
docs: Flesh out Usage section
1 parent 07f7631 commit d4f636e

File tree

3 files changed

+31
-3
lines changed

3 files changed

+31
-3
lines changed

README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![Maven Central](https://img.shields.io/maven-central/v/com.vonage/server-sdk-kotlin)](https://central.sonatype.com/artifact/com.vonage/server-sdk-kotlin)
44
[![Build Status](https://github.com/Vonage/vonage-kotlin-sdk/actions/workflows/build.yml/badge.svg)](https://github.com/Vonage/vonage-kotlin-sdk/actions/workflows/build.yml)
55
[![codecov](https://codecov.io/gh/Vonage/vonage-kotlin-sdk/graph/badge.svg?token=YNBJUD8OUT)](https://codecov.io/gh/Vonage/vonage-kotlin-sdk)
6+
[![KDoc](https://javadoc.io/badge2/com.vonage/server-sdk-kotlin/javadoc.svg)](https://javadoc.io/doc/com.vonage/server-sdk-kotlin)
67
![SLOC](https://sloc.xyz/github/Vonage/vonage-kotlin-sdk)
78
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)
89
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE.txt)
@@ -115,9 +116,30 @@ val vonageClient = Vonage {
115116
```
116117

117118
## Usage
119+
120+
As with our other SDKs, the architecture is based around the `Vonage` class, which defines the authentication
121+
credentials and optional advanced settings for the HTTP client. The class has a field for each supported API,
122+
which returns an object containing methods available on that API. Where the SDK differs from other SDKs is that
123+
it uses a resource-based approach for CRUD operations, rather than a flat list of methods.
124+
These are inner classes defined for each API resources and are always prefixed with `Existing` - for example,
125+
`ExistingCall`, `ExistingSession`, `ExistingApplication` etc. As a general rule, resources with unique identifiers
126+
have a corresponding `Existing[Resource]` class which is used to perform operations on that resource, rather
127+
than repeatedly passing the ID of that resource to methods on the parent class, as is the case in the Java SDK.
128+
129+
### Examples
118130
You can find complete runnable code samples in the [Code Snippets repository](https://github.com/Vonage/vonage-kotlin-code-snippets),
119131
including [a searchable list of snippets](https://github.com/Vonage/vonage-kotlin-code-snippets/blob/main/SNIPPETS.md).
120132

133+
### Documentation
134+
The SDK is fully documented with KDocs, so you should have complete documentation from your IDE. You may need to
135+
click "Download Sources" in IntelliJ to get the full documentation. Alternatively, you can browse the documentation
136+
using a service such as [Javadoc.io](https://javadoc.io/doc/com.vonage/server-sdk-kotlin/latest/index.html), which
137+
renders the documentation for you from [the artifacts on Maven Central](https://repo.maven.apache.org/maven2/com/vonage/server-sdk-kotlin/).
138+
139+
For help with any specific APIs, refer to the relevant documentation on our [developer portal](https://developer.vonage.com/en/documentation),
140+
using the links provided in the [Supported APIs](#supported-apis) section. For completeness, you can also consult the
141+
[API specifications](https://developer.vonage.com/api) if you believe there are any discrepancies.
142+
121143
## Frequently Asked Questions
122144

123145
**Q: Why use this SDK instead of the [Vonage Java Server SDK](https://github.com/Vonage/vonage-java-sdk)?**
@@ -126,14 +148,20 @@ including [a searchable list of snippets](https://github.com/Vonage/vonage-kotli
126148
syntactic sugar, so you can avoid the cumbersome builder pattern in favour of a more idiomatic DSL-like
127149
syntax, optional and named parameters with default values etc. whilst still reataining the strong typing
128150
offered by the Java SDK. Furthermore, you are more partially shielded from "platform types" (the `!`)
129-
so you have a better idea of what is and isn't nullable when creating requests.
151+
so you have a better idea of what is and isn't nullable when creating requests. You can read more about the
152+
differences in [the v1.0.0 announcement blog post](https://developer.vonage.com/en/blog/announcing-the-vonage-kotlin-server-sdk).
130153

131154
**Q: What is your policy on thread safety?**
132155

133156
**A:** As with the Java Server SDK, only one thread should use the client at a time.
134157
If you would like to use the SDK in a multithreaded environment, create a separate instance of
135158
`Vonage` for each thread, or use a ThreadLocal instance.
136159

160+
**Q: I'm having issues with my project when including the SDK as a dependency. How can I troubleshoot this?**
161+
162+
**A:** Please see [this blog post](https://developer.vonage.com/en/blog/one-simple-trick-for-resolving-java-runtime-dependency-issues).
163+
In short, you may have conflicting dependency versions in your project which clash with this SDK's transitive dependencies.
164+
137165
## Contribute!
138166

139167
_We :heart: contributions to this library!_

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.vonage</groupId>
77
<artifactId>server-sdk-kotlin</artifactId>
8-
<version>1.1.0</version>
8+
<version>1.1.1</version>
99

1010
<name>Vonage Kotlin Server SDK</name>
1111
<description>Kotlin client for Vonage APIs</description>

src/main/kotlin/com/vonage/client/kt/Vonage.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ package com.vonage.client.kt
1818
import com.vonage.client.HttpConfig
1919
import com.vonage.client.VonageClient
2020

21-
const val VONAGE_KOTLIN_SDK_VERSION = "1.1.0"
21+
const val VONAGE_KOTLIN_SDK_VERSION = "1.1.1"
2222
private const val SDK_USER_AGENT = "vonage-kotlin-sdk/$VONAGE_KOTLIN_SDK_VERSION"
2323

2424
/**

0 commit comments

Comments
 (0)