Skip to content

Commit

Permalink
1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
PureCloud Jenkins committed Dec 17, 2018
1 parent f6a01fe commit 74d2c6a
Show file tree
Hide file tree
Showing 172 changed files with 578 additions and 545 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: PureCloud Guest Chat Client - Java
[![platform-client-v2](https://maven-badges.herokuapp.com/maven-central/com.mypurecloud/purecloud-guest-chat-client/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.mypurecloud/purecloud-guest-chat-client)

* **Documentation** https://developer.mypurecloud.com/api/rest/client-libraries/java-guest/
* **Source** https://github.com/MyPureCloud/purecloud-guest-chat-client
* **Source** https://github.com/MyPureCloud/purecloud-guest-chat-client-java
* **Guest chat documentation** https://developerpreview.inindca.com/api/webchat/guestchat.html (preview documentation)

## Install Using maven
Expand Down Expand Up @@ -85,7 +85,7 @@ System.out.println("Conversation ID: " + chatInfo.getId());


// Set JWT in SDK
apiClient.setAccessToken(chatInfo.getJwt());
apiClient.setJwt(chatInfo.getJwt());

// Create websocket instance
System.out.println("Connecting to websocket...");
Expand Down Expand Up @@ -167,10 +167,10 @@ Example of getting the authenticated user's information:

#### Set the JWT (access token)

The JWT from the newly created chat must be applied to the SDK before any requests can be made targeting the chat. Do this by setting the access token on the ApiClient instance.
The JWT from the newly created chat must be applied to the SDK before any requests can be made targeting the chat. Do this by setting the JWT on the ApiClient instance.

~~~ java
apiClient.setAccessToken(chatInfo.getJwt());
apiClient.setJwt(chatInfo.getJwt());
~~~

#### Using a request builder
Expand Down
8 changes: 4 additions & 4 deletions build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: PureCloud Guest Chat Client - Java
[![platform-client-v2](https://maven-badges.herokuapp.com/maven-central/com.mypurecloud/purecloud-guest-chat-client/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.mypurecloud/purecloud-guest-chat-client)

* **Documentation** https://developer.mypurecloud.com/api/rest/client-libraries/java-guest/
* **Source** https://github.com/MyPureCloud/purecloud-guest-chat-client
* **Source** https://github.com/MyPureCloud/purecloud-guest-chat-client-java
* **Guest chat documentation** https://developerpreview.inindca.com/api/webchat/guestchat.html (preview documentation)

## Install Using maven
Expand Down Expand Up @@ -85,7 +85,7 @@ System.out.println("Conversation ID: " + chatInfo.getId());


// Set JWT in SDK
apiClient.setAccessToken(chatInfo.getJwt());
apiClient.setJwt(chatInfo.getJwt());

// Create websocket instance
System.out.println("Connecting to websocket...");
Expand Down Expand Up @@ -167,10 +167,10 @@ Example of getting the authenticated user's information:

#### Set the JWT (access token)

The JWT from the newly created chat must be applied to the SDK before any requests can be made targeting the chat. Do this by setting the access token on the ApiClient instance.
The JWT from the newly created chat must be applied to the SDK before any requests can be made targeting the chat. Do this by setting the JWT on the ApiClient instance.

~~~ java
apiClient.setAccessToken(chatInfo.getJwt());
apiClient.setJwt(chatInfo.getJwt());
~~~

#### Using a request builder
Expand Down
2 changes: 1 addition & 1 deletion build/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'idea'
apply plugin: 'eclipse'

group = 'com.mypurecloud'
version = '1.0.1'
version = '1.0.2'

buildscript {
repositories {
Expand Down
8 changes: 4 additions & 4 deletions build/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: PureCloud Guest Chat Client - Java
[![platform-client-v2](https://maven-badges.herokuapp.com/maven-central/com.mypurecloud/purecloud-guest-chat-client/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.mypurecloud/purecloud-guest-chat-client)

* **Documentation** https://developer.mypurecloud.com/api/rest/client-libraries/java-guest/
* **Source** https://github.com/MyPureCloud/purecloud-guest-chat-client
* **Source** https://github.com/MyPureCloud/purecloud-guest-chat-client-java
* **Guest chat documentation** https://developerpreview.inindca.com/api/webchat/guestchat.html (preview documentation)

## Install Using maven
Expand Down Expand Up @@ -85,7 +85,7 @@ System.out.println("Conversation ID: " + chatInfo.getId());


// Set JWT in SDK
apiClient.setAccessToken(chatInfo.getJwt());
apiClient.setJwt(chatInfo.getJwt());

// Create websocket instance
System.out.println("Connecting to websocket...");
Expand Down Expand Up @@ -167,10 +167,10 @@ Example of getting the authenticated user's information:

#### Set the JWT (access token)

The JWT from the newly created chat must be applied to the SDK before any requests can be made targeting the chat. Do this by setting the access token on the ApiClient instance.
The JWT from the newly created chat must be applied to the SDK before any requests can be made targeting the chat. Do this by setting the JWT on the ApiClient instance.

~~~ java
apiClient.setAccessToken(chatInfo.getJwt());
apiClient.setJwt(chatInfo.getJwt());
~~~

#### Using a request builder
Expand Down
2 changes: 1 addition & 1 deletion build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>purecloud-guest-chat-client</artifactId>
<packaging>jar</packaging>
<name>purecloud-guest-chat-client</name>
<version>1.0.1</version>
<version>1.0.2</version>
<description>A Java package to interface with the PureCloud Platform API Guest Chat APIs</description>
<url>https://developer.mypurecloud.com/api/rest/client-libraries/java-guest/</url>

Expand Down
17 changes: 15 additions & 2 deletions build/src/main/java/com/mypurecloud/sdk/v2/guest/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class ApiClient implements AutoCloseable {
private static Map<String, Authentication> buildAuthentications() {
Map<String, Authentication> authentications = new HashMap<>();
authentications.put("PureCloud OAuth", new OAuth());
authentications.put("Guest Chat JWT", new ApiKeyAuth("header", "Authorization"));
authentications.put("Guest Chat JWT", new ApiKeyAuth("header", "Authorization") { { setApiKeyPrefix("Bearer"); } });

return Collections.unmodifiableMap(authentications);
}
Expand Down Expand Up @@ -147,6 +147,19 @@ public void setAccessToken(String accessToken) {
throw new RuntimeException("No OAuth2 authentication configured!");
}

/**
* Helper method to set access token for the first OAuth2 authentication.
*/
public void setJwt(String jwt) {
for (Authentication auth : authentications.values()) {
if (auth instanceof ApiKeyAuth) {
((ApiKeyAuth) auth).setApiKey(jwt);
return;
}
}
throw new RuntimeException("No OAuth2 authentication configured!");
}

/**
* Connect timeout (in milliseconds).
*/
Expand Down Expand Up @@ -657,7 +670,7 @@ public static ApiClient defaultClient() {
private Builder(ConnectorProperties properties) {
this.properties = (properties != null) ? properties.copy() : new ConnectorProperties();
withUserAgent(DEFAULT_USER_AGENT);
withDefaultHeader("purecloud-sdk", "1.0.1");
withDefaultHeader("purecloud-sdk", "1.0.2");
}

public Builder withDefaultHeader(String header, String value) {
Expand Down
4 changes: 2 additions & 2 deletions build/target/apidocs/allclasses-frame.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_192) on Mon Dec 17 20:44:20 UTC 2018 -->
<!-- Generated by javadoc (1.8.0_192) on Mon Dec 17 23:27:08 UTC 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>All Classes (purecloud-guest-chat-client 1.0.1 API)</title>
<title>All Classes (purecloud-guest-chat-client 1.0.2 API)</title>
<meta name="date" content="2018-12-17">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions build/target/apidocs/allclasses-noframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_192) on Mon Dec 17 20:44:20 UTC 2018 -->
<!-- Generated by javadoc (1.8.0_192) on Mon Dec 17 23:27:08 UTC 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>All Classes (purecloud-guest-chat-client 1.0.1 API)</title>
<title>All Classes (purecloud-guest-chat-client 1.0.2 API)</title>
<meta name="date" content="2018-12-17">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_192) on Mon Dec 17 20:44:19 UTC 2018 -->
<!-- Generated by javadoc (1.8.0_192) on Mon Dec 17 23:27:08 UTC 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ApiClient.Builder (purecloud-guest-chat-client 1.0.1 API)</title>
<title>ApiClient.Builder (purecloud-guest-chat-client 1.0.2 API)</title>
<meta name="date" content="2018-12-17">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
Expand All @@ -13,7 +13,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ApiClient.Builder (purecloud-guest-chat-client 1.0.1 API)";
parent.document.title="ApiClient.Builder (purecloud-guest-chat-client 1.0.2 API)";
}
}
catch(err) {
Expand Down
24 changes: 20 additions & 4 deletions build/target/apidocs/com/mypurecloud/sdk/v2/guest/ApiClient.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_192) on Mon Dec 17 20:44:19 UTC 2018 -->
<!-- Generated by javadoc (1.8.0_192) on Mon Dec 17 23:27:08 UTC 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ApiClient (purecloud-guest-chat-client 1.0.1 API)</title>
<title>ApiClient (purecloud-guest-chat-client 1.0.2 API)</title>
<meta name="date" content="2018-12-17">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
Expand All @@ -13,13 +13,13 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ApiClient (purecloud-guest-chat-client 1.0.1 API)";
parent.document.title="ApiClient (purecloud-guest-chat-client 1.0.2 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":9,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10};
var methods = {"i0":9,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
Expand Down Expand Up @@ -280,6 +280,12 @@ <h3>Method Summary</h3>
<div class="block">Helper method to set access token for the first OAuth2 authentication.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/mypurecloud/sdk/v2/guest/ApiClient.html#setJwt-java.lang.String-">setJwt</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;jwt)</code>
<div class="block">Helper method to set access token for the first OAuth2 authentication.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
Expand Down Expand Up @@ -381,6 +387,16 @@ <h4>setAccessToken</h4>
<div class="block">Helper method to set access token for the first OAuth2 authentication.</div>
</li>
</ul>
<a name="setJwt-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setJwt</h4>
<pre>public&nbsp;void&nbsp;setJwt(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;jwt)</pre>
<div class="block">Helper method to set access token for the first OAuth2 authentication.</div>
</li>
</ul>
<a name="getConnectTimeout--">
<!-- -->
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_192) on Mon Dec 17 20:44:19 UTC 2018 -->
<!-- Generated by javadoc (1.8.0_192) on Mon Dec 17 23:27:08 UTC 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ApiDateFormat (purecloud-guest-chat-client 1.0.1 API)</title>
<title>ApiDateFormat (purecloud-guest-chat-client 1.0.2 API)</title>
<meta name="date" content="2018-12-17">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
Expand All @@ -13,7 +13,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ApiDateFormat (purecloud-guest-chat-client 1.0.1 API)";
parent.document.title="ApiDateFormat (purecloud-guest-chat-client 1.0.2 API)";
}
}
catch(err) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_192) on Mon Dec 17 20:44:20 UTC 2018 -->
<!-- Generated by javadoc (1.8.0_192) on Mon Dec 17 23:27:08 UTC 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ApiException (purecloud-guest-chat-client 1.0.1 API)</title>
<title>ApiException (purecloud-guest-chat-client 1.0.2 API)</title>
<meta name="date" content="2018-12-17">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
Expand All @@ -13,7 +13,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ApiException (purecloud-guest-chat-client 1.0.1 API)";
parent.document.title="ApiException (purecloud-guest-chat-client 1.0.2 API)";
}
}
catch(err) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_192) on Mon Dec 17 20:44:20 UTC 2018 -->
<!-- Generated by javadoc (1.8.0_192) on Mon Dec 17 23:27:08 UTC 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ApiRequest (purecloud-guest-chat-client 1.0.1 API)</title>
<title>ApiRequest (purecloud-guest-chat-client 1.0.2 API)</title>
<meta name="date" content="2018-12-17">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
Expand All @@ -13,7 +13,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ApiRequest (purecloud-guest-chat-client 1.0.1 API)";
parent.document.title="ApiRequest (purecloud-guest-chat-client 1.0.2 API)";
}
}
catch(err) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_192) on Mon Dec 17 20:44:20 UTC 2018 -->
<!-- Generated by javadoc (1.8.0_192) on Mon Dec 17 23:27:08 UTC 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ApiRequestBuilder (purecloud-guest-chat-client 1.0.1 API)</title>
<title>ApiRequestBuilder (purecloud-guest-chat-client 1.0.2 API)</title>
<meta name="date" content="2018-12-17">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
Expand All @@ -13,7 +13,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ApiRequestBuilder (purecloud-guest-chat-client 1.0.1 API)";
parent.document.title="ApiRequestBuilder (purecloud-guest-chat-client 1.0.2 API)";
}
}
catch(err) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_192) on Mon Dec 17 20:44:20 UTC 2018 -->
<!-- Generated by javadoc (1.8.0_192) on Mon Dec 17 23:27:08 UTC 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ApiResponse (purecloud-guest-chat-client 1.0.1 API)</title>
<title>ApiResponse (purecloud-guest-chat-client 1.0.2 API)</title>
<meta name="date" content="2018-12-17">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
Expand All @@ -13,7 +13,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ApiResponse (purecloud-guest-chat-client 1.0.1 API)";
parent.document.title="ApiResponse (purecloud-guest-chat-client 1.0.2 API)";
}
}
catch(err) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_192) on Mon Dec 17 20:44:20 UTC 2018 -->
<!-- Generated by javadoc (1.8.0_192) on Mon Dec 17 23:27:08 UTC 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>AsyncApiCallback (purecloud-guest-chat-client 1.0.1 API)</title>
<title>AsyncApiCallback (purecloud-guest-chat-client 1.0.2 API)</title>
<meta name="date" content="2018-12-17">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
Expand All @@ -13,7 +13,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="AsyncApiCallback (purecloud-guest-chat-client 1.0.1 API)";
parent.document.title="AsyncApiCallback (purecloud-guest-chat-client 1.0.2 API)";
}
}
catch(err) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_192) on Mon Dec 17 20:44:20 UTC 2018 -->
<!-- Generated by javadoc (1.8.0_192) on Mon Dec 17 23:27:08 UTC 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Configuration (purecloud-guest-chat-client 1.0.1 API)</title>
<title>Configuration (purecloud-guest-chat-client 1.0.2 API)</title>
<meta name="date" content="2018-12-17">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
Expand All @@ -13,7 +13,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Configuration (purecloud-guest-chat-client 1.0.1 API)";
parent.document.title="Configuration (purecloud-guest-chat-client 1.0.2 API)";
}
}
catch(err) {
Expand Down
Loading

0 comments on commit 74d2c6a

Please sign in to comment.