@@ -29,6 +29,35 @@ mvn clean deploy
2929Refer to the [ OSSRH Guide] ( http://central.sonatype.org/pages/ossrh-guide.html ) for more information.
3030
3131### Maven users
32+ Please refer to https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry
33+
34+ Please update settings.xml as described above:
35+ <profiles >
36+ <profile >
37+ <id >github</id >
38+ <repositories >
39+ <repository >
40+ <id >central</id >
41+ <url >https://repo1.maven.org/maven2 </url >
42+ </repository >
43+ <repository >
44+ <id >github</id >
45+ <url >https://maven.pkg.github.com/telstra/MessagingAPI-SDK-Java </url >
46+ <snapshots >
47+ <enabled >true</enabled >
48+ </snapshots >
49+ </repository >
50+ </repositories >
51+ </profile >
52+ </profiles >
53+
54+ <servers >
55+ <server>
56+ <id>github</id>
57+ <username>USERNAME</username>
58+ <password>TOKEN</password>
59+ </server>
60+ </servers >
3261
3362Add this dependency to your project's POM:
3463
@@ -65,37 +94,6 @@ Then manually install the following JARs:
6594
6695Please follow the [ installation] ( #installation ) instruction and execute the following Java code:
6796
68- ``` java
69- import com.telstra.* ;
70- import org.junit.Before ;
71- import org.junit.Test ;
72- import static org.junit.Assert.assertNotNull ;
73-
74- public class AuthenticationApiExample {
75-
76- public static void main (String [] args ) {
77- ApiClient defaultClient = new ApiClient ();
78- String clientId = " YOUR CLIENT ID" ;
79- String clientSecret = " YOUR CLIENT SECRET" ;
80- String grantType = " client_credentials" ;
81- String scope = " free-trial-numbers:read free-trial-numbers:write messages:read messages:write virtual-numbers:read virtual-numbers:write reports:read reports:write" ;
82-
83- defaultClient. setAccessSecret(clientId, clientSecret, grantType, scope);
84- AuthenticationApi authenticationApi = new AuthenticationApi (defaultClient);
85- try {
86- OAuth oAuthResponse = authenticationApi. authToken(defaultClient. getClientId(), defaultClient. getClientSecret(), defaultClient. getGrantType(), defaultClient. getScope());
87- System . out. println(" getAuthToken: " + oAuthResponse. getAccessToken());
88- assertNotNull(oAuthResponse. getAccessToken());
89- } catch (ApiException e) {
90- System . err. println(" Exception when calling AuthenticationApi#authToken" );
91- System . err. println(" Status code: " + e. getCode());
92- System . err. println(" Reason: " + e. getResponseBody());
93- System . err. println(" Response headers: " + e. getResponseHeaders());
94- e. printStackTrace();
95- }
96- }
97- }
98- ```
9997
10098## Documentation for API Endpoints
10199
@@ -144,6 +142,39 @@ Authentication schemes defined for the API:
144142 - virtual-numbers:write: write information for virtual numbers
145143
146144
145+ ``` java
146+ import com.telstra.* ;
147+ import com.telstra.messaging.AuthenticationApi ;
148+ import org.junit.Before ;
149+ import org.junit.Test ;
150+ import static org.junit.Assert.assertNotNull ;
151+
152+ public class AuthenticationApiExample {
153+
154+ public static void main (String [] args ) {
155+ ApiClient defaultClient = new ApiClient ();
156+ String clientId = " YOUR CLIENT ID" ;
157+ String clientSecret = " YOUR CLIENT SECRET" ;
158+ String grantType = " client_credentials" ;
159+ String scope = " free-trial-numbers:read free-trial-numbers:write messages:read messages:write virtual-numbers:read virtual-numbers:write reports:read reports:write" ;
160+
161+ defaultClient. setAccessSecret(clientId, clientSecret, grantType, scope);
162+ AuthenticationApi authenticationApi = new AuthenticationApi (defaultClient);
163+ try {
164+ OAuth oAuthResponse = authenticationApi. authToken(defaultClient. getClientId(), defaultClient. getClientSecret(), defaultClient. getGrantType(), defaultClient. getScope());
165+ System . out. println(" getAuthToken: " + oAuthResponse. getAccessToken());
166+ assertNotNull(oAuthResponse. getAccessToken());
167+ } catch (ApiException e) {
168+ System . err. println(" Exception when calling AuthenticationApi#authToken" );
169+ System . err. println(" Status code: " + e. getCode());
170+ System . err. println(" Reason: " + e. getResponseBody());
171+ System . err. println(" Response headers: " + e. getResponseHeaders());
172+ e. printStackTrace();
173+ }
174+ }
175+ }
176+ ```
177+
147178## Recommendation
148179
149180It's recommended to create an instance of ` ApiClient ` per thread in a multithreaded environment to avoid any potential issues.
@@ -178,6 +209,7 @@ For example:
178209
179210``` java
180211import com.telstra.* ;
212+ import com.telstra.messaging.FreeTrialNumbersApi ;
181213import org.junit.Before ;
182214import org.junit.Test ;
183215import static com.telstra.messaging.AuthenticationApi.getAuthToken ;
@@ -223,6 +255,7 @@ For example:
223255
224256``` java
225257import com.telstra.* ;
258+ import com.telstra.messaging.FreeTrialNumbersApi ;
226259import org.junit.Before ;
227260import org.junit.Test ;
228261import static com.telstra.messaging.AuthenticationApi.getAuthToken ;
@@ -280,6 +313,7 @@ For example:
280313
281314``` java
282315import com.telstra.* ;
316+ import com.telstra.messaging.VirtualNumbersApi ;
283317import org.junit.Before ;
284318import org.junit.Test ;
285319import static com.telstra.messaging.AuthenticationApi.getAuthToken ;
@@ -339,6 +373,7 @@ For example:
339373
340374``` java
341375import com.telstra.* ;
376+ import com.telstra.messaging.VirtualNumbersApi ;
342377import org.junit.Before ;
343378import org.junit.Test ;
344379import static com.telstra.messaging.AuthenticationApi.getAuthToken ;
@@ -384,6 +419,7 @@ For example:
384419
385420``` java
386421import com.telstra.* ;
422+ import com.telstra.messaging.VirtualNumbersApi ;
387423import org.junit.Before ;
388424import org.junit.Test ;
389425import static com.telstra.messaging.AuthenticationApi.getAuthToken ;
@@ -435,6 +471,7 @@ For example:
435471
436472``` java
437473import com.telstra.* ;
474+ import com.telstra.messaging.VirtualNumbersApi ;
438475import org.junit.Before ;
439476import org.junit.Test ;
440477import static com.telstra.messaging.AuthenticationApi.getAuthToken ;
@@ -482,6 +519,7 @@ For example:
482519
483520``` java
484521import com.telstra.* ;
522+ import com.telstra.messaging.VirtualNumbersApi ;
485523import org.junit.Before ;
486524import org.junit.Test ;
487525import static com.telstra.messaging.AuthenticationApi.getAuthToken ;
@@ -532,6 +570,7 @@ For example:
532570
533571``` java
534572import com.telstra.* ;
573+ import com.telstra.messaging.VirtualNumbersApi ;
535574import org.junit.Before ;
536575import org.junit.Test ;
537576import static com.telstra.messaging.AuthenticationApi.getAuthToken ;
@@ -609,6 +648,7 @@ For example:
609648
610649``` java
611650import com.telstra.* ;
651+ import com.telstra.messaging.MessagesApi ;
612652import java.util.UUID ;
613653import org.junit.Before ;
614654import org.junit.Test ;
@@ -712,6 +752,7 @@ For example:
712752
713753``` java
714754import com.telstra.* ;
755+ import com.telstra.messaging.MessagesApi ;
715756import java.util.UUID ;
716757import org.junit.Before ;
717758import org.junit.Test ;
@@ -764,6 +805,7 @@ For example:
764805
765806``` java
766807import com.telstra.* ;
808+ import com.telstra.messaging.MessagesApi ;
767809import java.util.UUID ;
768810import org.junit.Before ;
769811import org.junit.Test ;
@@ -851,6 +893,7 @@ For example:
851893
852894``` java
853895import com.telstra.* ;
896+ import com.telstra.messaging.MessagesApi ;
854897import java.util.UUID ;
855898import org.junit.Before ;
856899import org.junit.Test ;
@@ -939,6 +982,7 @@ For example:
939982
940983``` java
941984import com.telstra.* ;
985+ import com.telstra.messaging.MessagesApi ;
942986import java.util.UUID ;
943987import org.junit.Before ;
944988import org.junit.Test ;
@@ -987,6 +1031,7 @@ For example:
9871031
9881032``` java
9891033import com.telstra.* ;
1034+ import com.telstra.messaging.MessagesApi ;
9901035import java.util.UUID ;
9911036import org.junit.Before ;
9921037import org.junit.Test ;
@@ -1054,6 +1099,7 @@ For example:
10541099
10551100``` java
10561101import com.telstra.* ;
1102+ import com.telstra.messaging.ReportsApi ;
10571103import java.util.UUID ;
10581104import org.junit.Before ;
10591105import org.junit.Test ;
@@ -1104,6 +1150,7 @@ For example:
11041150
11051151``` java
11061152import com.telstra.* ;
1153+ import com.telstra.messaging.ReportsApi ;
11071154import java.util.UUID ;
11081155import org.junit.Before ;
11091156import org.junit.Test ;
@@ -1152,6 +1199,7 @@ For example:
11521199
11531200``` java
11541201import com.telstra.* ;
1202+ import com.telstra.messaging.ReportsApi ;
11551203import java.util.UUID ;
11561204import org.junit.Before ;
11571205import org.junit.Test ;
@@ -1195,6 +1243,7 @@ For example:
11951243
11961244``` java
11971245import com.telstra.* ;
1246+ import com.telstra.messaging.HealthCheckApi ;
11981247import org.junit.Before ;
11991248import org.junit.Test ;
12001249import static com.telstra.messaging.AuthenticationApi.getAuthToken ;
0 commit comments