From 427f7b2b373795db125691958ab7d4d2283f4c60 Mon Sep 17 00:00:00 2001 From: developersteve Date: Thu, 8 Mar 2018 13:29:43 +1100 Subject: [PATCH] notifyURL for sendmms update --- LICENSE | 201 -------- README.md | 32 +- build.gradle | 3 +- build.sbt | 3 +- docs/AuthApi.md | 56 --- docs/AuthenticationApi.md | 0 docs/AuthgeneratetokenpostResponse.md | 13 - docs/DeleteNumberRequest.md | 0 docs/ErrorError.md | 0 docs/ErrorErrorError.md | 0 docs/ErrorErrorError62.md | 11 - docs/ErrorErrorErrorError.md | 11 - docs/GetSubscriptionResponse.md | 0 docs/InboundPollResponse.md | 0 docs/MMSContent.md | 0 docs/Message.md | 0 docs/MessageSentResponse.md | 0 docs/MessageType.md | 0 docs/MessagingApi.md | 0 docs/OAuthRequest.md | 0 docs/OAuthResponse.md | 0 docs/OutboundPollResponse.md | 0 docs/OutboundPollResponseInner.md | 13 - docs/ProvisionNumberRequest.md | 0 docs/ProvisionNumberResponse.md | 0 docs/ProvisioningApi.md | 0 docs/SendMmsRequest.md | 1 + docs/SendMmsRequestMMSContent.md | 12 - docs/SendSMSRequest.md | 0 docs/Status.md | 0 gradle.properties | 0 gradle/wrapper/gradle-wrapper.jar | Bin gradle/wrapper/gradle-wrapper.properties | 0 gradlew | 0 gradlew.bat | 0 pom.xml | 439 ++++++++--------- settings.gradle | 0 src/main/AndroidManifest.xml | 0 src/main/java/com/telstra/ApiCallback.java | 2 +- src/main/java/com/telstra/ApiClient.java | 453 ++++++++++++------ src/main/java/com/telstra/ApiException.java | 4 +- src/main/java/com/telstra/ApiResponse.java | 2 +- src/main/java/com/telstra/Configuration.java | 4 +- .../com/telstra/GzipRequestInterceptor.java | 2 +- src/main/java/com/telstra/JSON.java | 369 +++++--------- src/main/java/com/telstra/Pair.java | 4 +- .../java/com/telstra/ProgressRequestBody.java | 2 +- .../com/telstra/ProgressResponseBody.java | 2 +- src/main/java/com/telstra/StringUtil.java | 4 +- .../java/com/telstra/auth/ApiKeyAuth.java | 4 +- .../java/com/telstra/auth/Authentication.java | 2 +- .../java/com/telstra/auth/HttpBasicAuth.java | 2 +- src/main/java/com/telstra/auth/OAuth.java | 4 +- src/main/java/com/telstra/auth/OAuthFlow.java | 2 +- .../java/com/telstra/messaging/AuthApi.java | 192 -------- .../telstra/messaging/AuthenticationApi.java | 15 +- .../AuthgeneratetokenpostResponse.java | 162 ------- .../messaging/DeleteNumberRequest.java | 6 +- .../com/telstra/messaging/ErrorError.java | 6 +- .../telstra/messaging/ErrorErrorError.java | 6 +- .../telstra/messaging/ErrorErrorError62.java | 116 ----- .../messaging/ErrorErrorErrorError.java | 117 ----- .../messaging/GetSubscriptionResponse.java | 6 +- .../messaging/InboundPollResponse.java | 6 +- .../com/telstra/messaging/MMSContent.java | 6 +- .../java/com/telstra/messaging/Message.java | 6 +- .../messaging/MessageSentResponse.java | 6 +- .../com/telstra/messaging/MessageType.java | 2 +- .../com/telstra/messaging/MessagingApi.java | 67 ++- .../com/telstra/messaging/OAuthRequest.java | 6 +- .../com/telstra/messaging/OAuthResponse.java | 6 +- .../messaging/OutboundPollResponse.java | 6 +- .../messaging/OutboundPollResponseInner.java | 163 ------- .../messaging/ProvisionNumberRequest.java | 6 +- .../messaging/ProvisionNumberResponse.java | 6 +- .../telstra/messaging/ProvisioningApi.java | 41 +- .../com/telstra/messaging/SendMmsRequest.java | 33 +- .../messaging/SendMmsRequestMMSContent.java | 139 ------ .../com/telstra/messaging/SendSMSRequest.java | 8 +- .../java/com/telstra/messaging/Status.java | 2 +- .../com/telstra/messaging/AuthApiTest.java | 52 -- .../messaging/AuthenticationApiTest.java | 2 +- .../telstra/messaging/MessagingApiTest.java | 10 +- .../messaging/ProvisioningApiTest.java | 14 +- 84 files changed, 839 insertions(+), 2031 deletions(-) delete mode 100644 LICENSE mode change 100644 => 100755 README.md mode change 100644 => 100755 build.gradle mode change 100644 => 100755 build.sbt delete mode 100644 docs/AuthApi.md mode change 100644 => 100755 docs/AuthenticationApi.md delete mode 100644 docs/AuthgeneratetokenpostResponse.md mode change 100644 => 100755 docs/DeleteNumberRequest.md mode change 100644 => 100755 docs/ErrorError.md mode change 100644 => 100755 docs/ErrorErrorError.md delete mode 100644 docs/ErrorErrorError62.md delete mode 100644 docs/ErrorErrorErrorError.md mode change 100644 => 100755 docs/GetSubscriptionResponse.md mode change 100644 => 100755 docs/InboundPollResponse.md mode change 100644 => 100755 docs/MMSContent.md mode change 100644 => 100755 docs/Message.md mode change 100644 => 100755 docs/MessageSentResponse.md mode change 100644 => 100755 docs/MessageType.md mode change 100644 => 100755 docs/MessagingApi.md mode change 100644 => 100755 docs/OAuthRequest.md mode change 100644 => 100755 docs/OAuthResponse.md mode change 100644 => 100755 docs/OutboundPollResponse.md delete mode 100644 docs/OutboundPollResponseInner.md mode change 100644 => 100755 docs/ProvisionNumberRequest.md mode change 100644 => 100755 docs/ProvisionNumberResponse.md mode change 100644 => 100755 docs/ProvisioningApi.md mode change 100644 => 100755 docs/SendMmsRequest.md delete mode 100644 docs/SendMmsRequestMMSContent.md mode change 100644 => 100755 docs/SendSMSRequest.md mode change 100644 => 100755 docs/Status.md mode change 100644 => 100755 gradle.properties mode change 100644 => 100755 gradle/wrapper/gradle-wrapper.jar mode change 100644 => 100755 gradle/wrapper/gradle-wrapper.properties mode change 100644 => 100755 gradlew mode change 100644 => 100755 gradlew.bat mode change 100644 => 100755 pom.xml mode change 100644 => 100755 settings.gradle mode change 100644 => 100755 src/main/AndroidManifest.xml mode change 100644 => 100755 src/main/java/com/telstra/ApiCallback.java mode change 100644 => 100755 src/main/java/com/telstra/ApiClient.java mode change 100644 => 100755 src/main/java/com/telstra/ApiException.java mode change 100644 => 100755 src/main/java/com/telstra/ApiResponse.java mode change 100644 => 100755 src/main/java/com/telstra/Configuration.java mode change 100644 => 100755 src/main/java/com/telstra/GzipRequestInterceptor.java mode change 100644 => 100755 src/main/java/com/telstra/JSON.java mode change 100644 => 100755 src/main/java/com/telstra/Pair.java mode change 100644 => 100755 src/main/java/com/telstra/ProgressRequestBody.java mode change 100644 => 100755 src/main/java/com/telstra/ProgressResponseBody.java mode change 100644 => 100755 src/main/java/com/telstra/StringUtil.java mode change 100644 => 100755 src/main/java/com/telstra/auth/ApiKeyAuth.java mode change 100644 => 100755 src/main/java/com/telstra/auth/Authentication.java mode change 100644 => 100755 src/main/java/com/telstra/auth/HttpBasicAuth.java mode change 100644 => 100755 src/main/java/com/telstra/auth/OAuth.java mode change 100644 => 100755 src/main/java/com/telstra/auth/OAuthFlow.java delete mode 100644 src/main/java/com/telstra/messaging/AuthApi.java mode change 100644 => 100755 src/main/java/com/telstra/messaging/AuthenticationApi.java delete mode 100644 src/main/java/com/telstra/messaging/AuthgeneratetokenpostResponse.java mode change 100644 => 100755 src/main/java/com/telstra/messaging/DeleteNumberRequest.java mode change 100644 => 100755 src/main/java/com/telstra/messaging/ErrorError.java mode change 100644 => 100755 src/main/java/com/telstra/messaging/ErrorErrorError.java delete mode 100644 src/main/java/com/telstra/messaging/ErrorErrorError62.java delete mode 100644 src/main/java/com/telstra/messaging/ErrorErrorErrorError.java mode change 100644 => 100755 src/main/java/com/telstra/messaging/GetSubscriptionResponse.java mode change 100644 => 100755 src/main/java/com/telstra/messaging/InboundPollResponse.java mode change 100644 => 100755 src/main/java/com/telstra/messaging/MMSContent.java mode change 100644 => 100755 src/main/java/com/telstra/messaging/Message.java mode change 100644 => 100755 src/main/java/com/telstra/messaging/MessageSentResponse.java mode change 100644 => 100755 src/main/java/com/telstra/messaging/MessageType.java mode change 100644 => 100755 src/main/java/com/telstra/messaging/MessagingApi.java mode change 100644 => 100755 src/main/java/com/telstra/messaging/OAuthRequest.java mode change 100644 => 100755 src/main/java/com/telstra/messaging/OAuthResponse.java mode change 100644 => 100755 src/main/java/com/telstra/messaging/OutboundPollResponse.java delete mode 100644 src/main/java/com/telstra/messaging/OutboundPollResponseInner.java mode change 100644 => 100755 src/main/java/com/telstra/messaging/ProvisionNumberRequest.java mode change 100644 => 100755 src/main/java/com/telstra/messaging/ProvisionNumberResponse.java mode change 100644 => 100755 src/main/java/com/telstra/messaging/ProvisioningApi.java mode change 100644 => 100755 src/main/java/com/telstra/messaging/SendMmsRequest.java delete mode 100644 src/main/java/com/telstra/messaging/SendMmsRequestMMSContent.java mode change 100644 => 100755 src/main/java/com/telstra/messaging/SendSMSRequest.java mode change 100644 => 100755 src/main/java/com/telstra/messaging/Status.java delete mode 100644 src/test/java/com/telstra/messaging/AuthApiTest.java mode change 100644 => 100755 src/test/java/com/telstra/messaging/AuthenticationApiTest.java mode change 100644 => 100755 src/test/java/com/telstra/messaging/MessagingApiTest.java mode change 100644 => 100755 src/test/java/com/telstra/messaging/ProvisioningApiTest.java diff --git a/LICENSE b/LICENSE deleted file mode 100644 index acb0be4..0000000 --- a/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2017 Telstra Corporation Limited (ABN 33 051 775 556) - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/README.md b/README.md old mode 100644 new mode 100755 index d4b5e02..0855299 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ To deploy it to a remote Maven repository instead, configure the settings of the mvn deploy ``` +Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. ### Maven users @@ -44,9 +45,11 @@ compile "Telstra:TelstraMessaging:1.0.0" At first generate the JAR by executing: + mvn package Then manually install the following JARs: +* target/TelstraMessaging-1.0.0.jar * target/lib/*.jar ## Getting Started @@ -88,6 +91,7 @@ public class AuthenticationApiExample { All URIs are relative to *https://tapi.telstra.com/v2* Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- *AuthenticationApi* | [**authToken**](docs/AuthenticationApi.md#authToken) | **POST** /oauth/token | Generate authentication token *MessagingApi* | [**getMMSStatus**](docs/MessagingApi.md#getMMSStatus) | **GET** /messages/mms/{messageid}/status | Get MMS Status *MessagingApi* | [**getSMSStatus**](docs/MessagingApi.md#getSMSStatus) | **GET** /messages/sms/{messageId}/status | Get SMS Status @@ -101,13 +105,35 @@ Class | Method | HTTP request | Description ## Documentation for Models - - -## Documentation for Authorisation + - [DeleteNumberRequest](docs/DeleteNumberRequest.md) + - [ErrorError](docs/ErrorError.md) + - [ErrorErrorError](docs/ErrorErrorError.md) + - [GetSubscriptionResponse](docs/GetSubscriptionResponse.md) + - [InboundPollResponse](docs/InboundPollResponse.md) + - [MMSContent](docs/MMSContent.md) + - [Message](docs/Message.md) + - [MessageSentResponse](docs/MessageSentResponse.md) + - [MessageType](docs/MessageType.md) + - [OAuthRequest](docs/OAuthRequest.md) + - [OAuthResponse](docs/OAuthResponse.md) + - [OutboundPollResponse](docs/OutboundPollResponse.md) + - [ProvisionNumberRequest](docs/ProvisionNumberRequest.md) + - [ProvisionNumberResponse](docs/ProvisionNumberResponse.md) + - [SendMmsRequest](docs/SendMmsRequest.md) + - [SendSMSRequest](docs/SendSMSRequest.md) + - [Status](docs/Status.md) + + +## Documentation for Authorization Authentication schemes defined for the API: ### auth +- **Type**: OAuth +- **Flow**: application +- **Authorization URL**: +- **Scopes**: + - NSMS: NSMS ## Recommendation diff --git a/build.gradle b/build.gradle old mode 100644 new mode 100755 index d2e0d3d..1feb2e3 --- a/build.gradle +++ b/build.gradle @@ -98,7 +98,6 @@ dependencies { compile 'com.squareup.okhttp:okhttp:2.7.5' compile 'com.squareup.okhttp:logging-interceptor:2.7.5' compile 'com.google.code.gson:gson:2.8.1' - compile 'io.gsonfire:gson-fire:1.8.0' - compile 'org.threeten:threetenbp:1.3.5' + compile 'joda-time:joda-time:2.9.9' testCompile 'junit:junit:4.12' } diff --git a/build.sbt b/build.sbt old mode 100644 new mode 100755 index ede0355..fbf7965 --- a/build.sbt +++ b/build.sbt @@ -13,8 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp" % "okhttp" % "2.7.5", "com.squareup.okhttp" % "logging-interceptor" % "2.7.5", "com.google.code.gson" % "gson" % "2.8.1", - "org.threeten" % "threetenbp" % "1.3.5" % "compile", - "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", + "joda-time" % "joda-time" % "2.9.9" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) diff --git a/docs/AuthApi.md b/docs/AuthApi.md deleted file mode 100644 index 02271de..0000000 --- a/docs/AuthApi.md +++ /dev/null @@ -1,56 +0,0 @@ -# AuthApi - -All URIs are relative to *https://tapi.telstra.com/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**oauthTokenPost**](AuthApi.md#oauthTokenPost) | **POST** /oauth/token | AuthGeneratetokenPost - - - -# **oauthTokenPost** -> AuthgeneratetokenpostResponse oauthTokenPost(oAuthClientId, oAuthClientSecret) - -AuthGeneratetokenPost - -generate auth token - -### Example -```java -// Import classes: -//import com.telstra.ApiException; -//import com.telstra.messaging.AuthApi; - - -AuthApi apiInstance = new AuthApi(); -String oAuthClientId = "oAuthClientId_example"; // String | -String oAuthClientSecret = "oAuthClientSecret_example"; // String | -try { - AuthgeneratetokenpostResponse result = apiInstance.oauthTokenPost(oAuthClientId, oAuthClientSecret); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling AuthApi#oauthTokenPost"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **oAuthClientId** | **String**| | - **oAuthClientSecret** | **String**| | - -### Return type - -[**AuthgeneratetokenpostResponse**](AuthgeneratetokenpostResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - diff --git a/docs/AuthenticationApi.md b/docs/AuthenticationApi.md old mode 100644 new mode 100755 diff --git a/docs/AuthgeneratetokenpostResponse.md b/docs/AuthgeneratetokenpostResponse.md deleted file mode 100644 index 2a29ebc..0000000 --- a/docs/AuthgeneratetokenpostResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - -# AuthgeneratetokenpostResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**accessToken** | **String** | | [optional] -**expiresIn** | **Integer** | | [optional] -**refreshToken** | **String** | | [optional] -**tokenType** | **String** | | [optional] - - - diff --git a/docs/DeleteNumberRequest.md b/docs/DeleteNumberRequest.md old mode 100644 new mode 100755 diff --git a/docs/ErrorError.md b/docs/ErrorError.md old mode 100644 new mode 100755 diff --git a/docs/ErrorErrorError.md b/docs/ErrorErrorError.md old mode 100644 new mode 100755 diff --git a/docs/ErrorErrorError62.md b/docs/ErrorErrorError62.md deleted file mode 100644 index 352f0aa..0000000 --- a/docs/ErrorErrorError62.md +++ /dev/null @@ -1,11 +0,0 @@ - -# ErrorErrorError62 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **String** | A short error code | -**message** | **String** | Message describing the error. | [optional] - - - diff --git a/docs/ErrorErrorErrorError.md b/docs/ErrorErrorErrorError.md deleted file mode 100644 index 6f939da..0000000 --- a/docs/ErrorErrorErrorError.md +++ /dev/null @@ -1,11 +0,0 @@ - -# ErrorErrorErrorError - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **Integer** | The status code. | [optional] -**message** | **String** | Message describing the error. | [optional] - - - diff --git a/docs/GetSubscriptionResponse.md b/docs/GetSubscriptionResponse.md old mode 100644 new mode 100755 diff --git a/docs/InboundPollResponse.md b/docs/InboundPollResponse.md old mode 100644 new mode 100755 diff --git a/docs/MMSContent.md b/docs/MMSContent.md old mode 100644 new mode 100755 diff --git a/docs/Message.md b/docs/Message.md old mode 100644 new mode 100755 diff --git a/docs/MessageSentResponse.md b/docs/MessageSentResponse.md old mode 100644 new mode 100755 diff --git a/docs/MessageType.md b/docs/MessageType.md old mode 100644 new mode 100755 diff --git a/docs/MessagingApi.md b/docs/MessagingApi.md old mode 100644 new mode 100755 diff --git a/docs/OAuthRequest.md b/docs/OAuthRequest.md old mode 100644 new mode 100755 diff --git a/docs/OAuthResponse.md b/docs/OAuthResponse.md old mode 100644 new mode 100755 diff --git a/docs/OutboundPollResponse.md b/docs/OutboundPollResponse.md old mode 100644 new mode 100755 diff --git a/docs/OutboundPollResponseInner.md b/docs/OutboundPollResponseInner.md deleted file mode 100644 index 977f072..0000000 --- a/docs/OutboundPollResponseInner.md +++ /dev/null @@ -1,13 +0,0 @@ - -# OutboundPollResponseInner - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**to** | **String** | The phone number (recipient) the message was sent to (in E.164 format). | [optional] -**receivedTimestamp** | **String** | The date and time when the message was recieved by recipient. | [optional] -**sentTimestamp** | **String** | The date and time when the message was sent. | [optional] -**deliveryStatus** | [**Status**](Status.md) | | [optional] - - - diff --git a/docs/ProvisionNumberRequest.md b/docs/ProvisionNumberRequest.md old mode 100644 new mode 100755 diff --git a/docs/ProvisionNumberResponse.md b/docs/ProvisionNumberResponse.md old mode 100644 new mode 100755 diff --git a/docs/ProvisioningApi.md b/docs/ProvisioningApi.md old mode 100644 new mode 100755 diff --git a/docs/SendMmsRequest.md b/docs/SendMmsRequest.md old mode 100644 new mode 100755 index 7db5570..1fc14ae --- a/docs/SendMmsRequest.md +++ b/docs/SendMmsRequest.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **to** | **String** | This is the destination address. | **subject** | **String** | The subject that will be used in an MMS message. | **replyRequest** | **Boolean** | If set to true, the reply message functionality will be implemented and the to address will be ignored if present. | +**notifyURL** | **String** | Notify url | [optional] **mmSContent** | [**List<MMSContent>**](MMSContent.md) | An Array of content that will be sent in an MMS message. If this array is present it will cause the “body” element to be ignored, and the message will be sent as an MMS. | diff --git a/docs/SendMmsRequestMMSContent.md b/docs/SendMmsRequestMMSContent.md deleted file mode 100644 index 80748a2..0000000 --- a/docs/SendMmsRequestMMSContent.md +++ /dev/null @@ -1,12 +0,0 @@ - -# SendMmsRequestMMSContent - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **String** | The following types are supported audio/amr audio/aac audio/mp3 audio/mpeg3 audio/mpeg audio/mpg audio/wav audio/3gpp audio/mp4 image/gif image/jpeg image/jpg image/png image/bmp video/mpeg4 video/mp4 video/mpeg video/3gpp video/3gp video/h263 text/plain text/x-vCard text/x-vCalendar | -**filename** | **String** | The file name to be associated with the content. Some devices will display this file name with a placeholder for the content. | -**payload** | **String** | | - - - diff --git a/docs/SendSMSRequest.md b/docs/SendSMSRequest.md old mode 100644 new mode 100755 diff --git a/docs/Status.md b/docs/Status.md old mode 100644 new mode 100755 diff --git a/gradle.properties b/gradle.properties old mode 100644 new mode 100755 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar old mode 100644 new mode 100755 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties old mode 100644 new mode 100755 diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/gradlew.bat b/gradlew.bat old mode 100644 new mode 100755 diff --git a/pom.xml b/pom.xml old mode 100644 new mode 100755 index d99c581..1cf3e57 --- a/pom.xml +++ b/pom.xml @@ -1,242 +1,217 @@ - 4.0.0 - Telstra - TelstraMessaging - jar - TelstraMessaging - 1.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + Telstra + TelstraMessaging + jar + TelstraMessaging + 1.0.0 + https://github.com/swagger-api/swagger-codegen + Swagger Java + + scm:git:git@github.com:swagger-api/swagger-codegen.git + scm:git:git@github.com:swagger-api/swagger-codegen.git https://github.com/swagger-api/swagger-codegen - Swagger Java - - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - + + + 2.2.0 + - - - Unlicense - http://github.com/gruntjs/grunt/blob/master/LICENSE-MIT - repo - - + + + Unlicense + http://github.com/gruntjs/grunt/blob/master/LICENSE-MIT + repo + + - - - Swagger - apiteam@swagger.io - Swagger - http://swagger.io - - + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0-M1 - - - enforce-maven - - enforce - - - - - 2.2.0 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + - - org.codehaus.mojo - build-helper-maven-plugin - 1.10 - - - add_sources - generate-sources - - add-source - - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + - - - io.swagger - swagger-annotations - ${swagger-core-version} - - - com.squareup.okhttp - okhttp - ${okhttp-version} - - - com.squareup.okhttp - logging-interceptor - ${okhttp-version} - - - com.google.code.gson - gson - ${gson-version} - - - io.gsonfire - gson-fire - ${gson-fire-version} - - - org.threeten - threetenbp - ${threetenbp-version} - - - - junit - junit - ${junit-version} - test - - - - 1.7 - ${java.version} - ${java.version} - 1.8.0 - 1.5.15 - 2.7.5 - 2.8.1 - 1.3.5 - 1.0.0 - 4.12 - UTF-8 - + + + io.swagger + swagger-annotations + ${swagger-core-version} + + + com.squareup.okhttp + okhttp + ${okhttp-version} + + + com.squareup.okhttp + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + joda-time + joda-time + ${jodatime-version} + + + + junit + junit + ${junit-version} + test + + + + 1.7 + ${java.version} + ${java.version} + 1.5.15 + 2.7.5 + 2.8.1 + 2.9.9 + 1.0.0 + 4.12 + UTF-8 + diff --git a/settings.gradle b/settings.gradle old mode 100644 new mode 100755 diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml old mode 100644 new mode 100755 diff --git a/src/main/java/com/telstra/ApiCallback.java b/src/main/java/com/telstra/ApiCallback.java old mode 100644 new mode 100755 index d74b300..e75da0b --- a/src/main/java/com/telstra/ApiCallback.java +++ b/src/main/java/com/telstra/ApiCallback.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. diff --git a/src/main/java/com/telstra/ApiClient.java b/src/main/java/com/telstra/ApiClient.java old mode 100644 new mode 100755 index 683c79b..90471d2 --- a/src/main/java/com/telstra/ApiClient.java +++ b/src/main/java/com/telstra/ApiClient.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -13,24 +13,43 @@ package com.telstra; -import com.squareup.okhttp.*; +import com.squareup.okhttp.Call; +import com.squareup.okhttp.Callback; +import com.squareup.okhttp.OkHttpClient; +import com.squareup.okhttp.Request; +import com.squareup.okhttp.Response; +import com.squareup.okhttp.RequestBody; +import com.squareup.okhttp.FormEncodingBuilder; +import com.squareup.okhttp.MultipartBuilder; +import com.squareup.okhttp.MediaType; +import com.squareup.okhttp.Headers; import com.squareup.okhttp.internal.http.HttpMethod; import com.squareup.okhttp.logging.HttpLoggingInterceptor; import com.squareup.okhttp.logging.HttpLoggingInterceptor.Level; -import okio.BufferedSink; -import okio.Okio; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import javax.net.ssl.*; +import java.lang.reflect.Type; + +import java.util.Collection; +import java.util.Collections; +import java.util.Map; +import java.util.Map.Entry; +import java.util.HashMap; +import java.util.List; +import java.util.ArrayList; +import java.util.Date; +import java.util.TimeZone; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import java.net.URLEncoder; +import java.net.URLConnection; + import java.io.File; -import java.io.IOException; import java.io.InputStream; +import java.io.IOException; import java.io.UnsupportedEncodingException; -import java.lang.reflect.Type; -import java.net.URLConnection; -import java.net.URLEncoder; + import java.security.GeneralSecurityException; import java.security.KeyStore; import java.security.SecureRandom; @@ -38,12 +57,22 @@ import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; + import java.text.DateFormat; -import java.util.*; -import java.util.Map.Entry; -import java.util.concurrent.TimeUnit; -import java.util.regex.Matcher; -import java.util.regex.Pattern; +import java.text.SimpleDateFormat; +import java.text.ParseException; + +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.KeyManager; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSession; +import javax.net.ssl.TrustManager; +import javax.net.ssl.TrustManagerFactory; +import javax.net.ssl.X509TrustManager; + +import okio.BufferedSink; +import okio.Okio; import com.telstra.auth.Authentication; import com.telstra.auth.HttpBasicAuth; @@ -51,8 +80,40 @@ import com.telstra.auth.OAuth; public class ApiClient { + public static final double JAVA_VERSION; + public static final boolean IS_ANDROID; + public static final int ANDROID_SDK_VERSION; + + static { + JAVA_VERSION = Double.parseDouble(System.getProperty("java.specification.version")); + boolean isAndroid; + try { + Class.forName("android.app.Activity"); + isAndroid = true; + } catch (ClassNotFoundException e) { + isAndroid = false; + } + IS_ANDROID = isAndroid; + int sdkVersion = 0; + if (IS_ANDROID) { + try { + sdkVersion = Class.forName("android.os.Build$VERSION").getField("SDK_INT").getInt(null); + } catch (Exception e) { + try { + sdkVersion = Integer.parseInt((String) Class.forName("android.os.Build$VERSION").getField("SDK").get(null)); + } catch (Exception e2) { } + } + } + ANDROID_SDK_VERSION = sdkVersion; + } + + /** + * The datetime format to be used when lenientDatetimeFormat is enabled. + */ + public static final String LENIENT_DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"; private String basePath = "https://tapi.telstra.com/v2"; + private boolean lenientOnJson = false; private boolean debugging = false; private Map defaultHeaderMap = new HashMap(); private String tempFolderPath = null; @@ -82,7 +143,20 @@ public ApiClient() { verifyingSsl = true; - json = new JSON(); + json = new JSON(this); + + /* + * Use RFC3339 format for date and datetime. + * See http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14 + */ + this.dateFormat = new SimpleDateFormat("yyyy-MM-dd"); + // Always use UTC as the default time zone when dealing with date (without time). + this.dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + initDatetimeFormat(); + + // Be lenient on datetime formats when parsing datetime from string. + // See parseDatetime. + this.lenientDatetimeFormat = true; // Set default User-Agent. setUserAgent("Swagger-Codegen/1.0.0/java"); @@ -221,30 +295,140 @@ public DateFormat getDateFormat() { } public ApiClient setDateFormat(DateFormat dateFormat) { - this.json.setDateFormat(dateFormat); + this.dateFormat = dateFormat; + this.dateLength = this.dateFormat.format(new Date()).length(); return this; } - public ApiClient setSqlDateFormat(DateFormat dateFormat) { - this.json.setSqlDateFormat(dateFormat); - return this; + public DateFormat getDatetimeFormat() { + return datetimeFormat; } - public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - this.json.setOffsetDateTimeFormat(dateFormat); + public ApiClient setDatetimeFormat(DateFormat datetimeFormat) { + this.datetimeFormat = datetimeFormat; return this; } - public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - this.json.setLocalDateFormat(dateFormat); - return this; + /** + * Whether to allow various ISO 8601 datetime formats when parsing a datetime string. + * @see #parseDatetime(String) + * @return True if lenientDatetimeFormat flag is set to true + */ + public boolean isLenientDatetimeFormat() { + return lenientDatetimeFormat; } - public ApiClient setLenientOnJson(boolean lenientOnJson) { - this.json.setLenientOnJson(lenientOnJson); + public ApiClient setLenientDatetimeFormat(boolean lenientDatetimeFormat) { + this.lenientDatetimeFormat = lenientDatetimeFormat; return this; } + /** + * Parse the given date string into Date object. + * The default dateFormat supports these ISO 8601 date formats: + * 2015-08-16 + * 2015-8-16 + * @param str String to be parsed + * @return Date + */ + public Date parseDate(String str) { + if (str == null) + return null; + try { + return dateFormat.parse(str); + } catch (ParseException e) { + throw new RuntimeException(e); + } + } + + /** + * Parse the given datetime string into Date object. + * When lenientDatetimeFormat is enabled, the following ISO 8601 datetime formats are supported: + * 2015-08-16T08:20:05Z + * 2015-8-16T8:20:05Z + * 2015-08-16T08:20:05+00:00 + * 2015-08-16T08:20:05+0000 + * 2015-08-16T08:20:05.376Z + * 2015-08-16T08:20:05.376+00:00 + * 2015-08-16T08:20:05.376+00 + * Note: The 3-digit milli-seconds is optional. Time zone is required and can be in one of + * these formats: + * Z (same with +0000) + * +08:00 (same with +0800) + * -02 (same with -0200) + * -0200 + * @see ISO 8601 + * @param str Date time string to be parsed + * @return Date representation of the string + */ + public Date parseDatetime(String str) { + if (str == null) + return null; + + DateFormat format; + if (lenientDatetimeFormat) { + /* + * When lenientDatetimeFormat is enabled, normalize the date string + * into LENIENT_DATETIME_FORMAT to support various formats + * defined by ISO 8601. + */ + // normalize time zone + // trailing "Z": 2015-08-16T08:20:05Z => 2015-08-16T08:20:05+0000 + str = str.replaceAll("[zZ]\\z", "+0000"); + // remove colon in time zone: 2015-08-16T08:20:05+00:00 => 2015-08-16T08:20:05+0000 + str = str.replaceAll("([+-]\\d{2}):(\\d{2})\\z", "$1$2"); + // expand time zone: 2015-08-16T08:20:05+00 => 2015-08-16T08:20:05+0000 + str = str.replaceAll("([+-]\\d{2})\\z", "$100"); + // add milliseconds when missing + // 2015-08-16T08:20:05+0000 => 2015-08-16T08:20:05.000+0000 + str = str.replaceAll("(:\\d{1,2})([+-]\\d{4})\\z", "$1.000$2"); + format = new SimpleDateFormat(LENIENT_DATETIME_FORMAT); + } else { + format = this.datetimeFormat; + } + + try { + return format.parse(str); + } catch (ParseException e) { + throw new RuntimeException(e); + } + } + + /* + * Parse date or date time in string format into Date object. + * + * @param str Date time string to be parsed + * @return Date representation of the string + */ + public Date parseDateOrDatetime(String str) { + if (str == null) + return null; + else if (str.length() <= dateLength) + return parseDate(str); + else + return parseDatetime(str); + } + + /** + * Format the given Date object into string (Date format). + * + * @param date Date object + * @return Formatted date in string representation + */ + public String formatDate(Date date) { + return dateFormat.format(date); + } + + /** + * Format the given Date object into string (Datetime format). + * + * @param date Date object + * @return Formatted datetime in string representation + */ + public String formatDatetime(Date date) { + return datetimeFormat.format(date); + } + /** * Get authentications (key: authentication name, value: authentication). * @@ -362,6 +546,26 @@ public ApiClient addDefaultHeader(String key, String value) { return this; } + /** + * @see setLenient + * + * @return True if lenientOnJson is enabled, false otherwise. + */ + public boolean isLenientOnJson() { + return lenientOnJson; + } + + /** + * Set LenientOnJson + * + * @param lenient True to enable lenientOnJson + * @return ApiClient + */ + public ApiClient setLenientOnJson(boolean lenient) { + this.lenientOnJson = lenient; + return this; + } + /** * Check that whether debugging is enabled for this API client. * @@ -405,7 +609,7 @@ public String getTempFolderPath() { } /** - * Set the temporary folder path (for downloading files) + * Set the tempoaray folder path (for downloading files) * * @param tempFolderPath Temporary folder path * @return ApiClient @@ -427,7 +631,6 @@ public int getConnectTimeout() { /** * Sets the connect timeout (in milliseconds). * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link Integer#MAX_VALUE}. * * @param connectionTimeout connection timeout in milliseconds * @return Api client @@ -437,50 +640,6 @@ public ApiClient setConnectTimeout(int connectionTimeout) { return this; } - /** - * Get read timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getReadTimeout() { - return httpClient.getReadTimeout(); - } - - /** - * Sets the read timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link Integer#MAX_VALUE}. - * - * @param readTimeout read timeout in milliseconds - * @return Api client - */ - public ApiClient setReadTimeout(int readTimeout) { - httpClient.setReadTimeout(readTimeout, TimeUnit.MILLISECONDS); - return this; - } - - /** - * Get write timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getWriteTimeout() { - return httpClient.getWriteTimeout(); - } - - /** - * Sets the write timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link Integer#MAX_VALUE}. - * - * @param writeTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setWriteTimeout(int writeTimeout) { - httpClient.setWriteTimeout(writeTimeout, TimeUnit.MILLISECONDS); - return this; - } - /** * Format the given parameter object into string. * @@ -490,10 +649,8 @@ public ApiClient setWriteTimeout(int writeTimeout) { public String parameterToString(Object param) { if (param == null) { return ""; - } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { - //Serialize to json string and remove the " enclosing characters - String jsonStr = json.serialize(param); - return jsonStr.substring(1, jsonStr.length() - 1); + } else if (param instanceof Date) { + return formatDatetime((Date) param); } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); for (Object o : (Collection)param) { @@ -509,70 +666,62 @@ public String parameterToString(Object param) { } /** - * Formats the specified query parameter to a list containing a single {@code Pair} object. + * Format to {@code Pair} objects. * - * Note that {@code value} must not be a collection. - * - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list containing a single {@code Pair} object. + * @param collectionFormat collection format (e.g. csv, tsv) + * @param name Name + * @param value Value + * @return A list of Pair objects */ - public List parameterToPair(String name, Object value) { + public List parameterToPairs(String collectionFormat, String name, Object value){ List params = new ArrayList(); // preconditions - if (name == null || name.isEmpty() || value == null || value instanceof Collection) return params; - - params.add(new Pair(name, parameterToString(value))); - return params; - } + if (name == null || name.isEmpty() || value == null) return params; - /** - * Formats the specified collection query parameters to a list of {@code Pair} objects. - * - * Note that the values of each of the returned Pair objects are percent-encoded. - * - * @param collectionFormat The collection format of the parameter. - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list of {@code Pair} objects. - */ - public List parameterToPairs(String collectionFormat, String name, Collection value) { - List params = new ArrayList(); + Collection valueCollection = null; + if (value instanceof Collection) { + valueCollection = (Collection) value; + } else { + params.add(new Pair(name, parameterToString(value))); + return params; + } - // preconditions - if (name == null || name.isEmpty() || value == null || value.isEmpty()) { + if (valueCollection.isEmpty()){ return params; } + // get the collection format + collectionFormat = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); // default: csv + // create the params based on the collection format - if ("multi".equals(collectionFormat)) { - for (Object item : value) { - params.add(new Pair(name, escapeString(parameterToString(item)))); + if (collectionFormat.equals("multi")) { + for (Object item : valueCollection) { + params.add(new Pair(name, parameterToString(item))); } + return params; } - // collectionFormat is assumed to be "csv" by default String delimiter = ","; - // escape all delimiters except commas, which are URI reserved - // characters - if ("ssv".equals(collectionFormat)) { - delimiter = escapeString(" "); - } else if ("tsv".equals(collectionFormat)) { - delimiter = escapeString("\t"); - } else if ("pipes".equals(collectionFormat)) { - delimiter = escapeString("|"); + if (collectionFormat.equals("csv")) { + delimiter = ","; + } else if (collectionFormat.equals("ssv")) { + delimiter = " "; + } else if (collectionFormat.equals("tsv")) { + delimiter = "\t"; + } else if (collectionFormat.equals("pipes")) { + delimiter = "|"; } StringBuilder sb = new StringBuilder() ; - for (Object item : value) { + for (Object item : valueCollection) { sb.append(delimiter); - sb.append(escapeString(parameterToString(item))); + sb.append(parameterToString(item)); } - params.add(new Pair(name, sb.substring(delimiter.length()))); + params.add(new Pair(name, sb.substring(1))); return params; } @@ -595,13 +744,12 @@ public String sanitizeFilename(String filename) { * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json - * "* / *" is also default to JSON * @param mime MIME (Multipurpose Internet Mail Extensions) * @return True if the given MIME is JSON, false otherwise. */ public boolean isJsonMime(String mime) { String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + return mime != null && (mime.matches(jsonMime) || mime.equalsIgnoreCase("application/json-patch+json")); } /** @@ -632,11 +780,11 @@ public String selectHeaderAccept(String[] accepts) { * * @param contentTypes The Content-Type array to select from * @return The Content-Type header to use. If the given array is empty, - * or matches "any", JSON will be used. + * JSON will be used. */ public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0 || contentTypes[0].equals("*/*")) { - return "application/json"; + if (contentTypes.length == 0) { + return "application/json"; } for (String contentType : contentTypes) { if (isJsonMime(contentType)) { @@ -933,7 +1081,6 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept * @param path The sub-path of the HTTP URL * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters * @param body The request body object * @param headerParams The header parameters * @param formParams The form parameters @@ -942,8 +1089,8 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept * @return The HTTP call * @throws ApiException If fail to serialize the request body object */ - public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, formParams, authNames, progressRequestListener); + public Call buildCall(String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Request request = buildRequest(path, method, queryParams, body, headerParams, formParams, authNames, progressRequestListener); return httpClient.newCall(request); } @@ -954,7 +1101,6 @@ public Call buildCall(String path, String method, List queryParams, List

queryParams, List

queryParams, List collectionQueryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + public Request buildRequest(String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { updateParamsForAuth(authNames, queryParams, headerParams); - final String url = buildUrl(path, queryParams, collectionQueryParams); + final String url = buildUrl(path, queryParams); final Request.Builder reqBuilder = new Request.Builder().url(url); processHeaderParams(headerParams, reqBuilder); @@ -1012,10 +1158,9 @@ public Request buildRequest(String path, String method, List queryParams, * * @param path The sub path * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters * @return The full URL */ - public String buildUrl(String path, List queryParams, List collectionQueryParams) { + public String buildUrl(String path, List queryParams) { final StringBuilder url = new StringBuilder(); url.append(basePath).append(path); @@ -1036,23 +1181,6 @@ public String buildUrl(String path, List queryParams, List collectio } } - if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { - String prefix = url.toString().contains("?") ? "&" : "?"; - for (Pair param : collectionQueryParams) { - if (param.getValue() != null) { - if (prefix != null) { - url.append(prefix); - prefix = null; - } else { - url.append("&"); - } - String value = parameterToString(param.getValue()); - // collection query parameter value already escaped as part of parameterToPairs - url.append(escapeString(param.getName())).append("=").append(value); - } - } - } - return url.toString(); } @@ -1140,6 +1268,31 @@ public String guessContentTypeFromFile(File file) { } } + /** + * Initialize datetime format according to the current environment, e.g. Java 1.7 and Android. + */ + private void initDatetimeFormat() { + String formatWithTimeZone = null; + if (IS_ANDROID) { + if (ANDROID_SDK_VERSION >= 18) { + // The time zone format "ZZZZZ" is available since Android 4.3 (SDK version 18) + formatWithTimeZone = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ"; + } + } else if (JAVA_VERSION >= 1.7) { + // The time zone format "XXX" is available since Java 1.7 + formatWithTimeZone = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"; + } + if (formatWithTimeZone != null) { + this.datetimeFormat = new SimpleDateFormat(formatWithTimeZone); + // NOTE: Use the system's default time zone (mainly for datetime formatting). + } else { + // Use a common format that works across all systems. + this.datetimeFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); + // Always use the UTC time zone as we are using a constant trailing "Z" here. + this.datetimeFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + } + } + /** * Apply SSL related settings to httpClient according to the current values of * verifyingSsl and sslCaCert. diff --git a/src/main/java/com/telstra/ApiException.java b/src/main/java/com/telstra/ApiException.java old mode 100644 new mode 100755 index ed6c94a..8213858 --- a/src/main/java/com/telstra/ApiException.java +++ b/src/main/java/com/telstra/ApiException.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -16,7 +16,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-12T11:05:07.187+11:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-08T00:36:43.245Z") public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; diff --git a/src/main/java/com/telstra/ApiResponse.java b/src/main/java/com/telstra/ApiResponse.java old mode 100644 new mode 100755 index a2cfcb2..5ccdb23 --- a/src/main/java/com/telstra/ApiResponse.java +++ b/src/main/java/com/telstra/ApiResponse.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. diff --git a/src/main/java/com/telstra/Configuration.java b/src/main/java/com/telstra/Configuration.java old mode 100644 new mode 100755 index 769a74b..d259574 --- a/src/main/java/com/telstra/Configuration.java +++ b/src/main/java/com/telstra/Configuration.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -13,7 +13,7 @@ package com.telstra; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-12T11:05:07.187+11:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-08T00:36:43.245Z") public class Configuration { private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/telstra/GzipRequestInterceptor.java b/src/main/java/com/telstra/GzipRequestInterceptor.java old mode 100644 new mode 100755 index 5724587..524f42e --- a/src/main/java/com/telstra/GzipRequestInterceptor.java +++ b/src/main/java/com/telstra/GzipRequestInterceptor.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. diff --git a/src/main/java/com/telstra/JSON.java b/src/main/java/com/telstra/JSON.java old mode 100644 new mode 100755 index 03093fd..04683d9 --- a/src/main/java/com/telstra/JSON.java +++ b/src/main/java/com/telstra/JSON.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -15,66 +15,43 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonParseException; +import com.google.gson.JsonPrimitive; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; import com.google.gson.TypeAdapter; -import com.google.gson.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.google.gson.JsonElement; -import io.gsonfire.GsonFireBuilder; -import io.gsonfire.TypeSelector; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; - -import com.telstra.messaging.*; import java.io.IOException; import java.io.StringReader; import java.lang.reflect.Type; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.ParsePosition; import java.util.Date; -import java.util.Map; -import java.util.HashMap; + +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; public class JSON { + private ApiClient apiClient; private Gson gson; - private boolean isLenientOnJson = false; - private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); - private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); - private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); - private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); - - public static GsonBuilder createGson() { - GsonFireBuilder fireBuilder = new GsonFireBuilder() - ; - return fireBuilder.createGsonBuilder(); - } - private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { - JsonElement element = readElement.getAsJsonObject().get(discriminatorField); - if(null == element) { - throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); - } - return element.getAsString(); - } - - private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { - Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue.toUpperCase()); - if(null == clazz) { - throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); - } - return clazz; - } - - public JSON() { - gson = createGson() - .registerTypeAdapter(Date.class, dateTypeAdapter) - .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) - .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) - .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) + /** + * JSON constructor. + * + * @param apiClient An instance of ApiClient + */ + public JSON(ApiClient apiClient) { + this.apiClient = apiClient; + gson = new GsonBuilder() + .registerTypeAdapter(Date.class, new DateAdapter(apiClient)) + .registerTypeAdapter(DateTime.class, new DateTimeTypeAdapter()) + .registerTypeAdapter(LocalDate.class, new LocalDateTypeAdapter()) .create(); } @@ -91,16 +68,9 @@ public Gson getGson() { * Set Gson. * * @param gson Gson - * @return JSON */ - public JSON setGson(Gson gson) { + public void setGson(Gson gson) { this.gson = gson; - return this; - } - - public JSON setLenientOnJson(boolean lenientOnJson) { - isLenientOnJson = lenientOnJson; - return this; } /** @@ -116,15 +86,15 @@ public String serialize(Object obj) { /** * Deserialize the given JSON string to Java object. * - * @param Type - * @param body The JSON string + * @param Type + * @param body The JSON string * @param returnType The type to deserialize into * @return The deserialized Java object */ @SuppressWarnings("unchecked") public T deserialize(String body, Type returnType) { try { - if (isLenientOnJson) { + if (apiClient.isLenientOnJson()) { JsonReader jsonReader = new JsonReader(new StringReader(body)); // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) jsonReader.setLenient(true); @@ -134,229 +104,122 @@ public T deserialize(String body, Type returnType) { } } catch (JsonParseException e) { // Fallback processing when failed to parse JSON form response body: - // return the response body string directly for the String return type; + // return the response body string directly for the String return type; + // parse response body into date or datetime for the Date return type. if (returnType.equals(String.class)) return (T) body; - else throw (e); + else if (returnType.equals(Date.class)) + return (T) apiClient.parseDateOrDatetime(body); + else throw(e); } } +} + +class DateAdapter implements JsonSerializer, JsonDeserializer { + private final ApiClient apiClient; /** - * Gson TypeAdapter for JSR310 OffsetDateTime type + * Constructor for DateAdapter + * + * @param apiClient Api client */ - public static class OffsetDateTimeTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public OffsetDateTimeTypeAdapter() { - this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); - } - - public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, OffsetDateTime date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.format(date)); - } - } - - @Override - public OffsetDateTime read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - if (date.endsWith("+0000")) { - date = date.substring(0, date.length()-5) + "Z"; - } - return OffsetDateTime.parse(date, formatter); - } - } + public DateAdapter(ApiClient apiClient) { + super(); + this.apiClient = apiClient; } /** - * Gson TypeAdapter for JSR310 LocalDate type + * Serialize + * + * @param src Date + * @param typeOfSrc Type + * @param context Json Serialization Context + * @return Json Element */ - public class LocalDateTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public LocalDateTypeAdapter() { - this(DateTimeFormatter.ISO_LOCAL_DATE); - } - - public LocalDateTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, LocalDate date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.format(date)); - } - } - - @Override - public LocalDate read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - return LocalDate.parse(date, formatter); - } + @Override + public JsonElement serialize(Date src, Type typeOfSrc, JsonSerializationContext context) { + if (src == null) { + return JsonNull.INSTANCE; + } else { + return new JsonPrimitive(apiClient.formatDatetime(src)); } } - public JSON setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - offsetDateTimeTypeAdapter.setFormat(dateFormat); - return this; - } - - public JSON setLocalDateFormat(DateTimeFormatter dateFormat) { - localDateTypeAdapter.setFormat(dateFormat); - return this; - } - /** - * Gson TypeAdapter for java.sql.Date type - * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used - * (more efficient than SimpleDateFormat). + * Deserialize + * + * @param json Json element + * @param date Type + * @param context Json Serialization Context + * @return Date + * @throws JsonParseException if fail to parse */ - public static class SqlDateTypeAdapter extends TypeAdapter { - - private DateFormat dateFormat; - - public SqlDateTypeAdapter() { - } - - public SqlDateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - @Override - public void write(JsonWriter out, java.sql.Date date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = date.toString(); - } - out.value(value); - } - } - - @Override - public java.sql.Date read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - try { - if (dateFormat != null) { - return new java.sql.Date(dateFormat.parse(date).getTime()); - } - return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); - } catch (ParseException e) { - throw new JsonParseException(e); - } - } + @Override + public Date deserialize(JsonElement json, Type date, JsonDeserializationContext context) throws JsonParseException { + String str = json.getAsJsonPrimitive().getAsString(); + try { + return apiClient.parseDateOrDatetime(str); + } catch (RuntimeException e) { + throw new JsonParseException(e); } } +} - /** - * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, ISO8601Utils will be used. - */ - public static class DateTypeAdapter extends TypeAdapter { +/** + * Gson TypeAdapter for Joda DateTime type + */ +class DateTimeTypeAdapter extends TypeAdapter { - private DateFormat dateFormat; + private final DateTimeFormatter parseFormatter = ISODateTimeFormat.dateOptionalTimeParser(); + private final DateTimeFormatter printFormatter = ISODateTimeFormat.dateTime(); - public DateTypeAdapter() { + @Override + public void write(JsonWriter out, DateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(printFormatter.print(date)); } + } - public DateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; + @Override + public DateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return parseFormatter.parseDateTime(date); } + } +} - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } +/** + * Gson TypeAdapter for Joda LocalDate type + */ +class LocalDateTypeAdapter extends TypeAdapter { - @Override - public void write(JsonWriter out, Date date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = ISO8601Utils.format(date, true); - } - out.value(value); - } - } + private final DateTimeFormatter formatter = ISODateTimeFormat.date(); - @Override - public Date read(JsonReader in) throws IOException { - try { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - try { - if (dateFormat != null) { - return dateFormat.parse(date); - } - return ISO8601Utils.parse(date, new ParsePosition(0)); - } catch (ParseException e) { - throw new JsonParseException(e); - } - } - } catch (IllegalArgumentException e) { - throw new JsonParseException(e); - } + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.print(date)); } } - public JSON setDateFormat(DateFormat dateFormat) { - dateTypeAdapter.setFormat(dateFormat); - return this; - } - - public JSON setSqlDateFormat(DateFormat dateFormat) { - sqlDateTypeAdapter.setFormat(dateFormat); - return this; + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return formatter.parseLocalDate(date); + } } - } diff --git a/src/main/java/com/telstra/Pair.java b/src/main/java/com/telstra/Pair.java old mode 100644 new mode 100755 index 6fd3dbb..cce2e59 --- a/src/main/java/com/telstra/Pair.java +++ b/src/main/java/com/telstra/Pair.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -13,7 +13,7 @@ package com.telstra; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-12T11:05:07.187+11:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-08T00:36:43.245Z") public class Pair { private String name = ""; private String value = ""; diff --git a/src/main/java/com/telstra/ProgressRequestBody.java b/src/main/java/com/telstra/ProgressRequestBody.java old mode 100644 new mode 100755 index 26e864c..cac1940 --- a/src/main/java/com/telstra/ProgressRequestBody.java +++ b/src/main/java/com/telstra/ProgressRequestBody.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. diff --git a/src/main/java/com/telstra/ProgressResponseBody.java b/src/main/java/com/telstra/ProgressResponseBody.java old mode 100644 new mode 100755 index 357f47c..8fd5170 --- a/src/main/java/com/telstra/ProgressResponseBody.java +++ b/src/main/java/com/telstra/ProgressResponseBody.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. diff --git a/src/main/java/com/telstra/StringUtil.java b/src/main/java/com/telstra/StringUtil.java old mode 100644 new mode 100755 index 97e038b..91e0687 --- a/src/main/java/com/telstra/StringUtil.java +++ b/src/main/java/com/telstra/StringUtil.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -13,7 +13,7 @@ package com.telstra; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-12T11:05:07.187+11:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-08T00:36:43.245Z") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/src/main/java/com/telstra/auth/ApiKeyAuth.java b/src/main/java/com/telstra/auth/ApiKeyAuth.java old mode 100644 new mode 100755 index 51542cb..f4506a9 --- a/src/main/java/com/telstra/auth/ApiKeyAuth.java +++ b/src/main/java/com/telstra/auth/ApiKeyAuth.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -18,7 +18,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-12T11:05:07.187+11:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-08T00:36:43.245Z") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/src/main/java/com/telstra/auth/Authentication.java b/src/main/java/com/telstra/auth/Authentication.java old mode 100644 new mode 100755 index d87161d..a5d9e25 --- a/src/main/java/com/telstra/auth/Authentication.java +++ b/src/main/java/com/telstra/auth/Authentication.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. diff --git a/src/main/java/com/telstra/auth/HttpBasicAuth.java b/src/main/java/com/telstra/auth/HttpBasicAuth.java old mode 100644 new mode 100755 index 986fb12..f544e35 --- a/src/main/java/com/telstra/auth/HttpBasicAuth.java +++ b/src/main/java/com/telstra/auth/HttpBasicAuth.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. diff --git a/src/main/java/com/telstra/auth/OAuth.java b/src/main/java/com/telstra/auth/OAuth.java old mode 100644 new mode 100755 index 48f2309..b565e3e --- a/src/main/java/com/telstra/auth/OAuth.java +++ b/src/main/java/com/telstra/auth/OAuth.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -18,7 +18,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-12T11:05:07.187+11:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-08T00:36:43.245Z") public class OAuth implements Authentication { private String accessToken; diff --git a/src/main/java/com/telstra/auth/OAuthFlow.java b/src/main/java/com/telstra/auth/OAuthFlow.java old mode 100644 new mode 100755 index b48b9b2..4a7efb4 --- a/src/main/java/com/telstra/auth/OAuthFlow.java +++ b/src/main/java/com/telstra/auth/OAuthFlow.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. diff --git a/src/main/java/com/telstra/messaging/AuthApi.java b/src/main/java/com/telstra/messaging/AuthApi.java deleted file mode 100644 index 080c6af..0000000 --- a/src/main/java/com/telstra/messaging/AuthApi.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Telstra Messaging API - * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. - * - * OpenAPI spec version: 2.2.4 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package com.telstra.messaging; - -import com.telstra.ApiCallback; -import com.telstra.ApiClient; -import com.telstra.ApiException; -import com.telstra.ApiResponse; -import com.telstra.Configuration; -import com.telstra.Pair; -import com.telstra.ProgressRequestBody; -import com.telstra.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.telstra.messaging.AuthgeneratetokenpostResponse; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class AuthApi { - private ApiClient apiClient; - - public AuthApi() { - this(Configuration.getDefaultApiClient()); - } - - public AuthApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - public ApiClient getApiClient() { - return apiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * Build call for oauthTokenPost - * @param oAuthClientId (required) - * @param oAuthClientSecret (required) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call oauthTokenPostCall(String oAuthClientId, String oAuthClientSecret, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/oauth/token"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - if (oAuthClientId != null) - localVarFormParams.put("oAuthClientId", oAuthClientId); - if (oAuthClientSecret != null) - localVarFormParams.put("oAuthClientSecret", oAuthClientSecret); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call oauthTokenPostValidateBeforeCall(String oAuthClientId, String oAuthClientSecret, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - // verify the required parameter 'oAuthClientId' is set - if (oAuthClientId == null) { - throw new ApiException("Missing the required parameter 'oAuthClientId' when calling oauthTokenPost(Async)"); - } - - // verify the required parameter 'oAuthClientSecret' is set - if (oAuthClientSecret == null) { - throw new ApiException("Missing the required parameter 'oAuthClientSecret' when calling oauthTokenPost(Async)"); - } - - - com.squareup.okhttp.Call call = oauthTokenPostCall(oAuthClientId, oAuthClientSecret, progressListener, progressRequestListener); - return call; - - } - - /** - * AuthGeneratetokenPost - * generate auth token - * @param oAuthClientId (required) - * @param oAuthClientSecret (required) - * @return AuthgeneratetokenpostResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public AuthgeneratetokenpostResponse oauthTokenPost(String oAuthClientId, String oAuthClientSecret) throws ApiException { - ApiResponse resp = oauthTokenPostWithHttpInfo(oAuthClientId, oAuthClientSecret); - return resp.getData(); - } - - /** - * AuthGeneratetokenPost - * generate auth token - * @param oAuthClientId (required) - * @param oAuthClientSecret (required) - * @return ApiResponse<AuthgeneratetokenpostResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse oauthTokenPostWithHttpInfo(String oAuthClientId, String oAuthClientSecret) throws ApiException { - com.squareup.okhttp.Call call = oauthTokenPostValidateBeforeCall(oAuthClientId, oAuthClientSecret, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * AuthGeneratetokenPost (asynchronously) - * generate auth token - * @param oAuthClientId (required) - * @param oAuthClientSecret (required) - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call oauthTokenPostAsync(String oAuthClientId, String oAuthClientSecret, final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = oauthTokenPostValidateBeforeCall(oAuthClientId, oAuthClientSecret, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } -} diff --git a/src/main/java/com/telstra/messaging/AuthenticationApi.java b/src/main/java/com/telstra/messaging/AuthenticationApi.java old mode 100644 new mode 100755 index 648da7f..f308070 --- a/src/main/java/com/telstra/messaging/AuthenticationApi.java +++ b/src/main/java/com/telstra/messaging/AuthenticationApi.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -66,12 +66,11 @@ public void setApiClient(ApiClient apiClient) { */ public com.squareup.okhttp.Call authTokenCall(String clientId, String clientSecret, String grantType, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/oauth/token"; List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); @@ -108,9 +107,9 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch } String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call authTokenValidateBeforeCall(String clientId, String clientSecret, String grantType, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { @@ -129,10 +128,14 @@ private com.squareup.okhttp.Call authTokenValidateBeforeCall(String clientId, St throw new ApiException("Missing the required parameter 'grantType' when calling authToken(Async)"); } - + com.squareup.okhttp.Call call = authTokenCall(clientId, clientSecret, grantType, progressListener, progressRequestListener); return call; + + + + } /** diff --git a/src/main/java/com/telstra/messaging/AuthgeneratetokenpostResponse.java b/src/main/java/com/telstra/messaging/AuthgeneratetokenpostResponse.java deleted file mode 100644 index f782925..0000000 --- a/src/main/java/com/telstra/messaging/AuthgeneratetokenpostResponse.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Telstra Messaging API - * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. - * - * OpenAPI spec version: 2.2.4 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package com.telstra.messaging; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -/** - * AuthgeneratetokenpostResponse - */ -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-08T22:00:21.379+11:00") -public class AuthgeneratetokenpostResponse { - @SerializedName("access_token") - private String accessToken = null; - - @SerializedName("expires_in") - private Integer expiresIn = null; - - @SerializedName("refresh_token") - private String refreshToken = null; - - @SerializedName("token_type") - private String tokenType = null; - - public AuthgeneratetokenpostResponse accessToken(String accessToken) { - this.accessToken = accessToken; - return this; - } - - /** - * - * @return accessToken - **/ - @ApiModelProperty(example = "a8856a1a4e25b23d86fa9ae2ffce3b63", value = "") - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - public AuthgeneratetokenpostResponse expiresIn(Integer expiresIn) { - this.expiresIn = expiresIn; - return this; - } - - /** - * - * @return expiresIn - **/ - @ApiModelProperty(example = "6900", value = "") - public Integer getExpiresIn() { - return expiresIn; - } - - public void setExpiresIn(Integer expiresIn) { - this.expiresIn = expiresIn; - } - - public AuthgeneratetokenpostResponse refreshToken(String refreshToken) { - this.refreshToken = refreshToken; - return this; - } - - /** - * - * @return refreshToken - **/ - @ApiModelProperty(example = "6fdad23ccbc1f8e415fc2cf8cd245dae", value = "") - public String getRefreshToken() { - return refreshToken; - } - - public void setRefreshToken(String refreshToken) { - this.refreshToken = refreshToken; - } - - public AuthgeneratetokenpostResponse tokenType(String tokenType) { - this.tokenType = tokenType; - return this; - } - - /** - * - * @return tokenType - **/ - @ApiModelProperty(example = "bearer", value = "") - public String getTokenType() { - return tokenType; - } - - public void setTokenType(String tokenType) { - this.tokenType = tokenType; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AuthgeneratetokenpostResponse authgeneratetokenpostResponse = (AuthgeneratetokenpostResponse) o; - return Objects.equals(this.accessToken, authgeneratetokenpostResponse.accessToken) && - Objects.equals(this.expiresIn, authgeneratetokenpostResponse.expiresIn) && - Objects.equals(this.refreshToken, authgeneratetokenpostResponse.refreshToken) && - Objects.equals(this.tokenType, authgeneratetokenpostResponse.tokenType); - } - - @Override - public int hashCode() { - return Objects.hash(accessToken, expiresIn, refreshToken, tokenType); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AuthgeneratetokenpostResponse {\n"); - - sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); - sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); - sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); - sb.append(" tokenType: ").append(toIndentedString(tokenType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/com/telstra/messaging/DeleteNumberRequest.java b/src/main/java/com/telstra/messaging/DeleteNumberRequest.java old mode 100644 new mode 100755 index a066e4a..520815d --- a/src/main/java/com/telstra/messaging/DeleteNumberRequest.java +++ b/src/main/java/com/telstra/messaging/DeleteNumberRequest.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -26,7 +26,7 @@ /** * DeleteNumberRequest */ -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-12T11:05:07.187+11:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-08T00:36:43.245Z") public class DeleteNumberRequest { @SerializedName("emptyArr") private Integer emptyArr = 0; @@ -88,6 +88,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } - + } diff --git a/src/main/java/com/telstra/messaging/ErrorError.java b/src/main/java/com/telstra/messaging/ErrorError.java old mode 100644 new mode 100755 index 77aa70d..7b074ef --- a/src/main/java/com/telstra/messaging/ErrorError.java +++ b/src/main/java/com/telstra/messaging/ErrorError.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -26,7 +26,7 @@ /** * ErrorError */ -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-12T11:05:07.187+11:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-08T00:36:43.245Z") public class ErrorError { @SerializedName("status") private String status = null; @@ -111,6 +111,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } - + } diff --git a/src/main/java/com/telstra/messaging/ErrorErrorError.java b/src/main/java/com/telstra/messaging/ErrorErrorError.java old mode 100644 new mode 100755 index 31dc8a6..5e5a656 --- a/src/main/java/com/telstra/messaging/ErrorErrorError.java +++ b/src/main/java/com/telstra/messaging/ErrorErrorError.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -27,7 +27,7 @@ * Returns error status code and message */ @ApiModel(description = "Returns error status code and message") -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-12T11:05:07.187+11:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-08T00:36:43.245Z") public class ErrorErrorError { @SerializedName("status") private Integer status = null; @@ -112,6 +112,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } - + } diff --git a/src/main/java/com/telstra/messaging/ErrorErrorError62.java b/src/main/java/com/telstra/messaging/ErrorErrorError62.java deleted file mode 100644 index e101ca8..0000000 --- a/src/main/java/com/telstra/messaging/ErrorErrorError62.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Telstra Messaging API - * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. - * - * OpenAPI spec version: 2.2.4 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package com.telstra.messaging; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -/** - * ErrorErrorError62 - */ -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-08T22:00:21.379+11:00") -public class ErrorErrorError62 { - @SerializedName("status") - private String status = null; - - @SerializedName("message") - private String message = null; - - public ErrorErrorError62 status(String status) { - this.status = status; - return this; - } - - /** - * A short error code - * @return status - **/ - @ApiModelProperty(required = true, value = "A short error code") - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public ErrorErrorError62 message(String message) { - this.message = message; - return this; - } - - /** - * Message describing the error. - * @return message - **/ - @ApiModelProperty(value = "Message describing the error.") - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ErrorErrorError62 errorErrorError62 = (ErrorErrorError62) o; - return Objects.equals(this.status, errorErrorError62.status) && - Objects.equals(this.message, errorErrorError62.message); - } - - @Override - public int hashCode() { - return Objects.hash(status, message); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ErrorErrorError62 {\n"); - - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/com/telstra/messaging/ErrorErrorErrorError.java b/src/main/java/com/telstra/messaging/ErrorErrorErrorError.java deleted file mode 100644 index db89172..0000000 --- a/src/main/java/com/telstra/messaging/ErrorErrorErrorError.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Telstra Messaging API - * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. - * - * OpenAPI spec version: 2.2.4 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package com.telstra.messaging; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -/** - * Returns error status code and message - */ -@ApiModel(description = "Returns error status code and message") -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-08T22:00:21.379+11:00") -public class ErrorErrorErrorError { - @SerializedName("status") - private Integer status = null; - - @SerializedName("message") - private String message = null; - - public ErrorErrorErrorError status(Integer status) { - this.status = status; - return this; - } - - /** - * The status code. - * @return status - **/ - @ApiModelProperty(value = "The status code.") - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - public ErrorErrorErrorError message(String message) { - this.message = message; - return this; - } - - /** - * Message describing the error. - * @return message - **/ - @ApiModelProperty(value = "Message describing the error.") - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ErrorErrorErrorError errorErrorErrorError = (ErrorErrorErrorError) o; - return Objects.equals(this.status, errorErrorErrorError.status) && - Objects.equals(this.message, errorErrorErrorError.message); - } - - @Override - public int hashCode() { - return Objects.hash(status, message); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ErrorErrorErrorError {\n"); - - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/com/telstra/messaging/GetSubscriptionResponse.java b/src/main/java/com/telstra/messaging/GetSubscriptionResponse.java old mode 100644 new mode 100755 index cde481c..df316e9 --- a/src/main/java/com/telstra/messaging/GetSubscriptionResponse.java +++ b/src/main/java/com/telstra/messaging/GetSubscriptionResponse.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -26,7 +26,7 @@ /** * GetSubscriptionResponse */ -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-12T11:05:07.187+11:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-08T00:36:43.245Z") public class GetSubscriptionResponse { @SerializedName("activeDays") private String activeDays = null; @@ -134,6 +134,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } - + } diff --git a/src/main/java/com/telstra/messaging/InboundPollResponse.java b/src/main/java/com/telstra/messaging/InboundPollResponse.java old mode 100644 new mode 100755 index f02cd17..c338e6c --- a/src/main/java/com/telstra/messaging/InboundPollResponse.java +++ b/src/main/java/com/telstra/messaging/InboundPollResponse.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -27,7 +27,7 @@ * Poll for incoming messages returning the latest. Only works if no callback url was specified when provisioning a number. */ @ApiModel(description = "Poll for incoming messages returning the latest. Only works if no callback url was specified when provisioning a number.") -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-12T11:05:07.187+11:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-08T00:36:43.245Z") public class InboundPollResponse { @SerializedName("status") private String status = null; @@ -204,6 +204,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } - + } diff --git a/src/main/java/com/telstra/messaging/MMSContent.java b/src/main/java/com/telstra/messaging/MMSContent.java old mode 100644 new mode 100755 index 9cb9d51..d3c2ee7 --- a/src/main/java/com/telstra/messaging/MMSContent.java +++ b/src/main/java/com/telstra/messaging/MMSContent.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -26,7 +26,7 @@ /** * MMSContent */ -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-12T11:05:07.187+11:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-08T00:36:43.245Z") public class MMSContent { @SerializedName("type") private String type = null; @@ -134,6 +134,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } - + } diff --git a/src/main/java/com/telstra/messaging/Message.java b/src/main/java/com/telstra/messaging/Message.java old mode 100644 new mode 100755 index dd6f5e2..6d5c403 --- a/src/main/java/com/telstra/messaging/Message.java +++ b/src/main/java/com/telstra/messaging/Message.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -26,7 +26,7 @@ /** * Message */ -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-12T11:05:07.187+11:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-08T00:36:43.245Z") public class Message { @SerializedName("to") private String to = null; @@ -157,6 +157,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } - + } diff --git a/src/main/java/com/telstra/messaging/MessageSentResponse.java b/src/main/java/com/telstra/messaging/MessageSentResponse.java old mode 100644 new mode 100755 index c231134..b6af89d --- a/src/main/java/com/telstra/messaging/MessageSentResponse.java +++ b/src/main/java/com/telstra/messaging/MessageSentResponse.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +29,7 @@ /** * MessageSentResponse */ -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-12T11:05:07.187+11:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-08T00:36:43.245Z") public class MessageSentResponse { @SerializedName("messages") private List messages = new ArrayList(); @@ -188,6 +188,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } - + } diff --git a/src/main/java/com/telstra/messaging/MessageType.java b/src/main/java/com/telstra/messaging/MessageType.java old mode 100644 new mode 100755 index 3734608..fab5686 --- a/src/main/java/com/telstra/messaging/MessageType.java +++ b/src/main/java/com/telstra/messaging/MessageType.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. diff --git a/src/main/java/com/telstra/messaging/MessagingApi.java b/src/main/java/com/telstra/messaging/MessagingApi.java old mode 100644 new mode 100755 index 6597e3a..68088b0 --- a/src/main/java/com/telstra/messaging/MessagingApi.java +++ b/src/main/java/com/telstra/messaging/MessagingApi.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -68,13 +68,12 @@ public void setApiClient(ApiClient apiClient) { */ public com.squareup.okhttp.Call getMMSStatusCall(String messageid, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/messages/mms/{messageid}/status" .replaceAll("\\{" + "messageid" + "\\}", apiClient.escapeString(messageid.toString())); List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); @@ -105,9 +104,9 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch } String[] localVarAuthNames = new String[] { "auth" }; - return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call getMMSStatusValidateBeforeCall(String messageid, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { @@ -116,10 +115,14 @@ private com.squareup.okhttp.Call getMMSStatusValidateBeforeCall(String messageid throw new ApiException("Missing the required parameter 'messageid' when calling getMMSStatus(Async)"); } - + com.squareup.okhttp.Call call = getMMSStatusCall(messageid, progressListener, progressRequestListener); return call; + + + + } /** @@ -191,13 +194,12 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don */ public com.squareup.okhttp.Call getSMSStatusCall(String messageId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/messages/sms/{messageId}/status" .replaceAll("\\{" + "messageId" + "\\}", apiClient.escapeString(messageId.toString())); List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); @@ -228,9 +230,9 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch } String[] localVarAuthNames = new String[] { "auth" }; - return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call getSMSStatusValidateBeforeCall(String messageId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { @@ -239,10 +241,14 @@ private com.squareup.okhttp.Call getSMSStatusValidateBeforeCall(String messageId throw new ApiException("Missing the required parameter 'messageId' when calling getSMSStatus(Async)"); } - + com.squareup.okhttp.Call call = getSMSStatusCall(messageId, progressListener, progressRequestListener); return call; + + + + } /** @@ -313,12 +319,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don */ public com.squareup.okhttp.Call retrieveSMSResponsesCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/messages/sms"; List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); @@ -349,16 +354,20 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch } String[] localVarAuthNames = new String[] { "auth" }; - return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call retrieveSMSResponsesValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - + com.squareup.okhttp.Call call = retrieveSMSResponsesCall(progressListener, progressRequestListener); return call; + + + + } /** @@ -427,12 +436,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don */ public com.squareup.okhttp.Call sendMMSCall(SendMmsRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; - + // create path and map variables String localVarPath = "/messages/mms"; List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); @@ -463,9 +471,9 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch } String[] localVarAuthNames = new String[] { "auth" }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call sendMMSValidateBeforeCall(SendMmsRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { @@ -474,10 +482,14 @@ private com.squareup.okhttp.Call sendMMSValidateBeforeCall(SendMmsRequest body, throw new ApiException("Missing the required parameter 'body' when calling sendMMS(Async)"); } - + com.squareup.okhttp.Call call = sendMMSCall(body, progressListener, progressRequestListener); return call; + + + + } /** @@ -549,12 +561,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don */ public com.squareup.okhttp.Call sendSMSCall(SendSMSRequest payload, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = payload; - + // create path and map variables String localVarPath = "/messages/sms"; List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); @@ -585,9 +596,9 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch } String[] localVarAuthNames = new String[] { "auth" }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call sendSMSValidateBeforeCall(SendSMSRequest payload, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { @@ -596,10 +607,14 @@ private com.squareup.okhttp.Call sendSMSValidateBeforeCall(SendSMSRequest payloa throw new ApiException("Missing the required parameter 'payload' when calling sendSMS(Async)"); } - + com.squareup.okhttp.Call call = sendSMSCall(payload, progressListener, progressRequestListener); return call; + + + + } /** diff --git a/src/main/java/com/telstra/messaging/OAuthRequest.java b/src/main/java/com/telstra/messaging/OAuthRequest.java old mode 100644 new mode 100755 index dc738b5..e3796a4 --- a/src/main/java/com/telstra/messaging/OAuthRequest.java +++ b/src/main/java/com/telstra/messaging/OAuthRequest.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -26,7 +26,7 @@ /** * OAuthRequest */ -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-12T11:05:07.187+11:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-08T00:36:43.245Z") public class OAuthRequest { @SerializedName("client_id") private String clientId = null; @@ -157,6 +157,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } - + } diff --git a/src/main/java/com/telstra/messaging/OAuthResponse.java b/src/main/java/com/telstra/messaging/OAuthResponse.java old mode 100644 new mode 100755 index 51e237f..03f0a1e --- a/src/main/java/com/telstra/messaging/OAuthResponse.java +++ b/src/main/java/com/telstra/messaging/OAuthResponse.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -26,7 +26,7 @@ /** * OAuthResponse */ -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-12T11:05:07.187+11:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-08T00:36:43.245Z") public class OAuthResponse { @SerializedName("access_token") private String accessToken = null; @@ -134,6 +134,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } - + } diff --git a/src/main/java/com/telstra/messaging/OutboundPollResponse.java b/src/main/java/com/telstra/messaging/OutboundPollResponse.java old mode 100644 new mode 100755 index 425667b..8ff7500 --- a/src/main/java/com/telstra/messaging/OutboundPollResponse.java +++ b/src/main/java/com/telstra/messaging/OutboundPollResponse.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -27,7 +27,7 @@ /** * OutboundPollResponse */ -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-12T11:05:07.187+11:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-08T00:36:43.245Z") public class OutboundPollResponse { @SerializedName("to") private String to = null; @@ -158,6 +158,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } - + } diff --git a/src/main/java/com/telstra/messaging/OutboundPollResponseInner.java b/src/main/java/com/telstra/messaging/OutboundPollResponseInner.java deleted file mode 100644 index a56e531..0000000 --- a/src/main/java/com/telstra/messaging/OutboundPollResponseInner.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Telstra Messaging API - * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. - * - * OpenAPI spec version: 2.2.4 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package com.telstra.messaging; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.telstra.messaging.Status; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -/** - * OutboundPollResponseInner - */ -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-08T21:54:42.448+11:00") -public class OutboundPollResponseInner { - @SerializedName("to") - private String to = null; - - @SerializedName("receivedTimestamp") - private String receivedTimestamp = null; - - @SerializedName("sentTimestamp") - private String sentTimestamp = null; - - @SerializedName("deliveryStatus") - private Status deliveryStatus = null; - - public OutboundPollResponseInner to(String to) { - this.to = to; - return this; - } - - /** - * The phone number (recipient) the message was sent to (in E.164 format). - * @return to - **/ - @ApiModelProperty(value = "The phone number (recipient) the message was sent to (in E.164 format).") - public String getTo() { - return to; - } - - public void setTo(String to) { - this.to = to; - } - - public OutboundPollResponseInner receivedTimestamp(String receivedTimestamp) { - this.receivedTimestamp = receivedTimestamp; - return this; - } - - /** - * The date and time when the message was recieved by recipient. - * @return receivedTimestamp - **/ - @ApiModelProperty(value = "The date and time when the message was recieved by recipient.") - public String getReceivedTimestamp() { - return receivedTimestamp; - } - - public void setReceivedTimestamp(String receivedTimestamp) { - this.receivedTimestamp = receivedTimestamp; - } - - public OutboundPollResponseInner sentTimestamp(String sentTimestamp) { - this.sentTimestamp = sentTimestamp; - return this; - } - - /** - * The date and time when the message was sent. - * @return sentTimestamp - **/ - @ApiModelProperty(value = "The date and time when the message was sent.") - public String getSentTimestamp() { - return sentTimestamp; - } - - public void setSentTimestamp(String sentTimestamp) { - this.sentTimestamp = sentTimestamp; - } - - public OutboundPollResponseInner deliveryStatus(Status deliveryStatus) { - this.deliveryStatus = deliveryStatus; - return this; - } - - /** - * Get deliveryStatus - * @return deliveryStatus - **/ - @ApiModelProperty(value = "") - public Status getDeliveryStatus() { - return deliveryStatus; - } - - public void setDeliveryStatus(Status deliveryStatus) { - this.deliveryStatus = deliveryStatus; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OutboundPollResponseInner outboundPollResponseInner = (OutboundPollResponseInner) o; - return Objects.equals(this.to, outboundPollResponseInner.to) && - Objects.equals(this.receivedTimestamp, outboundPollResponseInner.receivedTimestamp) && - Objects.equals(this.sentTimestamp, outboundPollResponseInner.sentTimestamp) && - Objects.equals(this.deliveryStatus, outboundPollResponseInner.deliveryStatus); - } - - @Override - public int hashCode() { - return Objects.hash(to, receivedTimestamp, sentTimestamp, deliveryStatus); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OutboundPollResponseInner {\n"); - - sb.append(" to: ").append(toIndentedString(to)).append("\n"); - sb.append(" receivedTimestamp: ").append(toIndentedString(receivedTimestamp)).append("\n"); - sb.append(" sentTimestamp: ").append(toIndentedString(sentTimestamp)).append("\n"); - sb.append(" deliveryStatus: ").append(toIndentedString(deliveryStatus)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/com/telstra/messaging/ProvisionNumberRequest.java b/src/main/java/com/telstra/messaging/ProvisionNumberRequest.java old mode 100644 new mode 100755 index 9df089e..eb5fb23 --- a/src/main/java/com/telstra/messaging/ProvisionNumberRequest.java +++ b/src/main/java/com/telstra/messaging/ProvisionNumberRequest.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -26,7 +26,7 @@ /** * ProvisionNumberRequest */ -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-12T11:05:07.187+11:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-08T00:36:43.245Z") public class ProvisionNumberRequest { @SerializedName("activeDays") private Integer activeDays = null; @@ -111,6 +111,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } - + } diff --git a/src/main/java/com/telstra/messaging/ProvisionNumberResponse.java b/src/main/java/com/telstra/messaging/ProvisionNumberResponse.java old mode 100644 new mode 100755 index e6bd51a..1032125 --- a/src/main/java/com/telstra/messaging/ProvisionNumberResponse.java +++ b/src/main/java/com/telstra/messaging/ProvisionNumberResponse.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -26,7 +26,7 @@ /** * ProvisionNumberResponse */ -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-12T11:05:07.187+11:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-08T00:36:43.245Z") public class ProvisionNumberResponse { @SerializedName("destinationAddress") private String destinationAddress = null; @@ -88,6 +88,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } - + } diff --git a/src/main/java/com/telstra/messaging/ProvisioningApi.java b/src/main/java/com/telstra/messaging/ProvisioningApi.java old mode 100644 new mode 100755 index c118c9f..9cf4c3f --- a/src/main/java/com/telstra/messaging/ProvisioningApi.java +++ b/src/main/java/com/telstra/messaging/ProvisioningApi.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -67,12 +67,11 @@ public void setApiClient(ApiClient apiClient) { */ public com.squareup.okhttp.Call createSubscriptionCall(ProvisionNumberRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; - + // create path and map variables String localVarPath = "/messages/provisioning/subscriptions"; List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); @@ -103,9 +102,9 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch } String[] localVarAuthNames = new String[] { "auth" }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call createSubscriptionValidateBeforeCall(ProvisionNumberRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { @@ -114,10 +113,14 @@ private com.squareup.okhttp.Call createSubscriptionValidateBeforeCall(ProvisionN throw new ApiException("Missing the required parameter 'body' when calling createSubscription(Async)"); } - + com.squareup.okhttp.Call call = createSubscriptionCall(body, progressListener, progressRequestListener); return call; + + + + } /** @@ -189,12 +192,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don */ public com.squareup.okhttp.Call deleteSubscriptionCall(DeleteNumberRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; - + // create path and map variables String localVarPath = "/messages/provisioning/subscriptions"; List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); @@ -225,9 +227,9 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch } String[] localVarAuthNames = new String[] { "auth" }; - return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call deleteSubscriptionValidateBeforeCall(DeleteNumberRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { @@ -236,10 +238,14 @@ private com.squareup.okhttp.Call deleteSubscriptionValidateBeforeCall(DeleteNumb throw new ApiException("Missing the required parameter 'body' when calling deleteSubscription(Async)"); } - + com.squareup.okhttp.Call call = deleteSubscriptionCall(body, progressListener, progressRequestListener); return call; + + + + } /** @@ -306,12 +312,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don */ public com.squareup.okhttp.Call getSubscriptionCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/messages/provisioning/subscriptions"; List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); @@ -342,16 +347,20 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch } String[] localVarAuthNames = new String[] { "auth" }; - return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call getSubscriptionValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - + com.squareup.okhttp.Call call = getSubscriptionCall(progressListener, progressRequestListener); return call; + + + + } /** diff --git a/src/main/java/com/telstra/messaging/SendMmsRequest.java b/src/main/java/com/telstra/messaging/SendMmsRequest.java old mode 100644 new mode 100755 index 6c56f1b..775dd52 --- a/src/main/java/com/telstra/messaging/SendMmsRequest.java +++ b/src/main/java/com/telstra/messaging/SendMmsRequest.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -29,7 +29,7 @@ /** * SendMmsRequest */ -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-12T11:05:07.187+11:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-08T00:36:43.245Z") public class SendMmsRequest { @SerializedName("from") private String from = null; @@ -43,6 +43,9 @@ public class SendMmsRequest { @SerializedName("replyRequest") private Boolean replyRequest = null; + @SerializedName("notifyURL") + private String notifyURL = null; + @SerializedName("MMSContent") private List mmSContent = new ArrayList(); @@ -110,7 +113,7 @@ public SendMmsRequest replyRequest(Boolean replyRequest) { * @return replyRequest **/ @ApiModelProperty(required = true, value = "If set to true, the reply message functionality will be implemented and the to address will be ignored if present.") - public Boolean isReplyRequest() { + public Boolean getReplyRequest() { return replyRequest; } @@ -118,6 +121,24 @@ public void setReplyRequest(Boolean replyRequest) { this.replyRequest = replyRequest; } + public SendMmsRequest notifyURL(String notifyURL) { + this.notifyURL = notifyURL; + return this; + } + + /** + * Notify url + * @return notifyURL + **/ + @ApiModelProperty(value = "Notify url") + public String getNotifyURL() { + return notifyURL; + } + + public void setNotifyURL(String notifyURL) { + this.notifyURL = notifyURL; + } + public SendMmsRequest mmSContent(List mmSContent) { this.mmSContent = mmSContent; return this; @@ -155,12 +176,13 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.to, sendMmsRequest.to) && Objects.equals(this.subject, sendMmsRequest.subject) && Objects.equals(this.replyRequest, sendMmsRequest.replyRequest) && + Objects.equals(this.notifyURL, sendMmsRequest.notifyURL) && Objects.equals(this.mmSContent, sendMmsRequest.mmSContent); } @Override public int hashCode() { - return Objects.hash(from, to, subject, replyRequest, mmSContent); + return Objects.hash(from, to, subject, replyRequest, notifyURL, mmSContent); } @@ -173,6 +195,7 @@ public String toString() { sb.append(" to: ").append(toIndentedString(to)).append("\n"); sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); sb.append(" replyRequest: ").append(toIndentedString(replyRequest)).append("\n"); + sb.append(" notifyURL: ").append(toIndentedString(notifyURL)).append("\n"); sb.append(" mmSContent: ").append(toIndentedString(mmSContent)).append("\n"); sb.append("}"); return sb.toString(); @@ -188,6 +211,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } - + } diff --git a/src/main/java/com/telstra/messaging/SendMmsRequestMMSContent.java b/src/main/java/com/telstra/messaging/SendMmsRequestMMSContent.java deleted file mode 100644 index 87fa0f6..0000000 --- a/src/main/java/com/telstra/messaging/SendMmsRequestMMSContent.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Telstra Messaging API - * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. - * - * OpenAPI spec version: 2.2.4 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package com.telstra.messaging; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -/** - * SendMmsRequestMMSContent - */ -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-09T15:30:54.049+11:00") -public class SendMmsRequestMMSContent { - @SerializedName("type") - private String type = null; - - @SerializedName("filename") - private String filename = null; - - @SerializedName("payload") - private String payload = null; - - public SendMmsRequestMMSContent type(String type) { - this.type = type; - return this; - } - - /** - * The following types are supported audio/amr audio/aac audio/mp3 audio/mpeg3 audio/mpeg audio/mpg audio/wav audio/3gpp audio/mp4 image/gif image/jpeg image/jpg image/png image/bmp video/mpeg4 video/mp4 video/mpeg video/3gpp video/3gp video/h263 text/plain text/x-vCard text/x-vCalendar - * @return type - **/ - @ApiModelProperty(required = true, value = "The following types are supported audio/amr audio/aac audio/mp3 audio/mpeg3 audio/mpeg audio/mpg audio/wav audio/3gpp audio/mp4 image/gif image/jpeg image/jpg image/png image/bmp video/mpeg4 video/mp4 video/mpeg video/3gpp video/3gp video/h263 text/plain text/x-vCard text/x-vCalendar") - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public SendMmsRequestMMSContent filename(String filename) { - this.filename = filename; - return this; - } - - /** - * The file name to be associated with the content. Some devices will display this file name with a placeholder for the content. - * @return filename - **/ - @ApiModelProperty(required = true, value = "The file name to be associated with the content. Some devices will display this file name with a placeholder for the content.") - public String getFilename() { - return filename; - } - - public void setFilename(String filename) { - this.filename = filename; - } - - public SendMmsRequestMMSContent payload(String payload) { - this.payload = payload; - return this; - } - - /** - * - * @return payload - **/ - @ApiModelProperty(required = true, value = "") - public String getPayload() { - return payload; - } - - public void setPayload(String payload) { - this.payload = payload; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SendMmsRequestMMSContent sendMmsRequestMMSContent = (SendMmsRequestMMSContent) o; - return Objects.equals(this.type, sendMmsRequestMMSContent.type) && - Objects.equals(this.filename, sendMmsRequestMMSContent.filename) && - Objects.equals(this.payload, sendMmsRequestMMSContent.payload); - } - - @Override - public int hashCode() { - return Objects.hash(type, filename, payload); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SendMmsRequestMMSContent {\n"); - - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" filename: ").append(toIndentedString(filename)).append("\n"); - sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/com/telstra/messaging/SendSMSRequest.java b/src/main/java/com/telstra/messaging/SendSMSRequest.java old mode 100644 new mode 100755 index d412416..f2a4fa7 --- a/src/main/java/com/telstra/messaging/SendSMSRequest.java +++ b/src/main/java/com/telstra/messaging/SendSMSRequest.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -26,7 +26,7 @@ /** * SendSMSRequest */ -@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-02-12T11:05:07.187+11:00") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-08T00:36:43.245Z") public class SendSMSRequest { @SerializedName("to") private String to = null; @@ -167,7 +167,7 @@ public SendSMSRequest replyRequest(Boolean replyRequest) { * @return replyRequest **/ @ApiModelProperty(value = "If set to true, the reply message functionality will be implemented and the to address will be ignored if present. If false or not present, then normal message handling is implemented.") - public Boolean isReplyRequest() { + public Boolean getReplyRequest() { return replyRequest; } @@ -226,6 +226,6 @@ private String toIndentedString(java.lang.Object o) { } return o.toString().replace("\n", "\n "); } - + } diff --git a/src/main/java/com/telstra/messaging/Status.java b/src/main/java/com/telstra/messaging/Status.java old mode 100644 new mode 100755 index 9a771a1..866b033 --- a/src/main/java/com/telstra/messaging/Status.java +++ b/src/main/java/com/telstra/messaging/Status.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. diff --git a/src/test/java/com/telstra/messaging/AuthApiTest.java b/src/test/java/com/telstra/messaging/AuthApiTest.java deleted file mode 100644 index 40ac4a6..0000000 --- a/src/test/java/com/telstra/messaging/AuthApiTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Telstra Messaging API - * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. - * - * OpenAPI spec version: 2.2.4 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package com.telstra.messaging; - -import com.telstra.ApiException; -import com.telstra.messaging.AuthgeneratetokenpostResponse; -import org.junit.Test; -import org.junit.Ignore; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for AuthApi - */ -@Ignore -public class AuthApiTest { - - private final AuthApi api = new AuthApi(); - - - /** - * AuthGeneratetokenPost - * - * generate auth token - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void oauthTokenPostTest() throws ApiException { - String oAuthClientId = null; - String oAuthClientSecret = null; - AuthgeneratetokenpostResponse response = api.oauthTokenPost(oAuthClientId, oAuthClientSecret); - - // TODO: test validations - } - -} diff --git a/src/test/java/com/telstra/messaging/AuthenticationApiTest.java b/src/test/java/com/telstra/messaging/AuthenticationApiTest.java old mode 100644 new mode 100755 index df018ba..d3b6954 --- a/src/test/java/com/telstra/messaging/AuthenticationApiTest.java +++ b/src/test/java/com/telstra/messaging/AuthenticationApiTest.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. diff --git a/src/test/java/com/telstra/messaging/MessagingApiTest.java b/src/test/java/com/telstra/messaging/MessagingApiTest.java old mode 100644 new mode 100755 index 797de0e..2556259 --- a/src/test/java/com/telstra/messaging/MessagingApiTest.java +++ b/src/test/java/com/telstra/messaging/MessagingApiTest.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -47,7 +47,7 @@ public class MessagingApiTest { @Test public void getMMSStatusTest() throws ApiException { String messageid = null; - OutboundPollResponse response = api.getMMSStatus(messageid); + List response = api.getMMSStatus(messageid); // TODO: test validations } @@ -63,7 +63,7 @@ public void getMMSStatusTest() throws ApiException { @Test public void getSMSStatusTest() throws ApiException { String messageId = null; - OutboundPollResponse response = api.getSMSStatus(messageId); + List response = api.getSMSStatus(messageId); // TODO: test validations } @@ -78,7 +78,7 @@ public void getSMSStatusTest() throws ApiException { */ @Test public void retrieveSMSResponsesTest() throws ApiException { - List response = api.retrieveSMSResponses(); + InboundPollResponse response = api.retrieveSMSResponses(); // TODO: test validations } @@ -94,7 +94,7 @@ public void retrieveSMSResponsesTest() throws ApiException { @Test public void sendMMSTest() throws ApiException { SendMmsRequest body = null; - Object response = api.sendMMS(body); + MessageSentResponse response = api.sendMMS(body); // TODO: test validations } diff --git a/src/test/java/com/telstra/messaging/ProvisioningApiTest.java b/src/test/java/com/telstra/messaging/ProvisioningApiTest.java old mode 100644 new mode 100755 index 4fb9b7c..113363b --- a/src/test/java/com/telstra/messaging/ProvisioningApiTest.java +++ b/src/test/java/com/telstra/messaging/ProvisioningApiTest.java @@ -2,7 +2,7 @@ * Telstra Messaging API * The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. * - * OpenAPI spec version: 2.2.4 + * OpenAPI spec version: 2.2.5 * * * NOTE: This class is auto generated by the swagger code generator program. @@ -14,6 +14,8 @@ package com.telstra.messaging; import com.telstra.ApiException; +import com.telstra.messaging.DeleteNumberRequest; +import com.telstra.messaging.GetSubscriptionResponse; import com.telstra.messaging.ProvisionNumberRequest; import com.telstra.messaging.ProvisionNumberResponse; import org.junit.Test; @@ -43,9 +45,8 @@ public class ProvisioningApiTest { */ @Test public void createSubscriptionTest() throws ApiException { - String authorization = null; ProvisionNumberRequest body = null; - ProvisionNumberResponse response = api.createSubscription(authorization, body); + ProvisionNumberResponse response = api.createSubscription(body); // TODO: test validations } @@ -60,8 +61,8 @@ public void createSubscriptionTest() throws ApiException { */ @Test public void deleteSubscriptionTest() throws ApiException { - String authorization = null; - api.deleteSubscription(authorization); + DeleteNumberRequest body = null; + api.deleteSubscription(body); // TODO: test validations } @@ -76,8 +77,7 @@ public void deleteSubscriptionTest() throws ApiException { */ @Test public void getSubscriptionTest() throws ApiException { - String authorization = null; - List response = api.getSubscription(authorization); + GetSubscriptionResponse response = api.getSubscription(); // TODO: test validations }