diff --git a/examples/java/src/main/java/com/twilio/rest/api/v2010/AccountCreator.java b/examples/java/src/main/java/com/twilio/rest/api/v2010/AccountCreator.java index c4793a5e2..2e25ea6da 100644 --- a/examples/java/src/main/java/com/twilio/rest/api/v2010/AccountCreator.java +++ b/examples/java/src/main/java/com/twilio/rest/api/v2010/AccountCreator.java @@ -21,6 +21,7 @@ import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response; diff --git a/examples/java/src/main/java/com/twilio/rest/api/v2010/AccountDeleter.java b/examples/java/src/main/java/com/twilio/rest/api/v2010/AccountDeleter.java index 7f83d6681..612020a35 100644 --- a/examples/java/src/main/java/com/twilio/rest/api/v2010/AccountDeleter.java +++ b/examples/java/src/main/java/com/twilio/rest/api/v2010/AccountDeleter.java @@ -20,6 +20,7 @@ import com.twilio.exception.ApiConnectionException; import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.converter.Converter; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; @@ -61,6 +62,9 @@ public boolean delete(final TwilioRestClient client) { String path = "/2010-04-01/Accounts/{Sid}.json"; this.pathSid = this.pathSid == null ? client.getAccountSid() : this.pathSid; + if (this.pathSid == null) { + throw new InvalidRequestException("pathSid can not be null"); + } path = path.replace("{"+"Sid"+"}", this.pathSid.toString()); Request request = new Request( diff --git a/examples/java/src/main/java/com/twilio/rest/api/v2010/AccountFetcher.java b/examples/java/src/main/java/com/twilio/rest/api/v2010/AccountFetcher.java index 74241f27d..8888509d6 100644 --- a/examples/java/src/main/java/com/twilio/rest/api/v2010/AccountFetcher.java +++ b/examples/java/src/main/java/com/twilio/rest/api/v2010/AccountFetcher.java @@ -21,6 +21,7 @@ import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response; @@ -62,6 +63,9 @@ public Account fetch(final TwilioRestClient client) { String path = "/2010-04-01/Accounts/{Sid}.json"; this.pathSid = this.pathSid == null ? client.getAccountSid() : this.pathSid; + if (this.pathSid == null) { + throw new InvalidRequestException("pathSid can not be null"); + } path = path.replace("{"+"Sid"+"}", this.pathSid.toString()); Request request = new Request( diff --git a/examples/java/src/main/java/com/twilio/rest/api/v2010/AccountReader.java b/examples/java/src/main/java/com/twilio/rest/api/v2010/AccountReader.java index 01c7c8c5a..cbc0b8345 100644 --- a/examples/java/src/main/java/com/twilio/rest/api/v2010/AccountReader.java +++ b/examples/java/src/main/java/com/twilio/rest/api/v2010/AccountReader.java @@ -21,6 +21,7 @@ import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response; diff --git a/examples/java/src/main/java/com/twilio/rest/api/v2010/AccountUpdater.java b/examples/java/src/main/java/com/twilio/rest/api/v2010/AccountUpdater.java index 01bc06773..608edac37 100644 --- a/examples/java/src/main/java/com/twilio/rest/api/v2010/AccountUpdater.java +++ b/examples/java/src/main/java/com/twilio/rest/api/v2010/AccountUpdater.java @@ -21,6 +21,7 @@ import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response; @@ -75,6 +76,9 @@ public Account update(final TwilioRestClient client){ String path = "/2010-04-01/Accounts/{Sid}.json"; this.pathSid = this.pathSid == null ? client.getAccountSid() : this.pathSid; + if (this.pathSid == null) { + throw new InvalidRequestException("pathSid can not be null"); + } path = path.replace("{"+"Sid"+"}", this.pathSid.toString()); path = path.replace("{"+"Status"+"}", this.status.toString()); diff --git a/examples/java/src/main/java/com/twilio/rest/api/v2010/account/CallCreator.java b/examples/java/src/main/java/com/twilio/rest/api/v2010/account/CallCreator.java index 6a6c70523..6d5ad78d4 100644 --- a/examples/java/src/main/java/com/twilio/rest/api/v2010/account/CallCreator.java +++ b/examples/java/src/main/java/com/twilio/rest/api/v2010/account/CallCreator.java @@ -21,6 +21,7 @@ import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response; @@ -102,6 +103,9 @@ public Call create(final TwilioRestClient client){ String path = "/2010-04-01/Accounts/{AccountSid}/Calls.json"; this.pathAccountSid = this.pathAccountSid == null ? client.getAccountSid() : this.pathAccountSid; + if (this.pathAccountSid == null) { + throw new InvalidRequestException("pathAccountSid can not be null"); + } path = path.replace("{"+"AccountSid"+"}", this.pathAccountSid.toString()); path = path.replace("{"+"RequiredStringProperty"+"}", this.requiredStringProperty.toString()); path = path.replace("{"+"TestMethod"+"}", this.testMethod.toString()); diff --git a/examples/java/src/main/java/com/twilio/rest/api/v2010/account/CallDeleter.java b/examples/java/src/main/java/com/twilio/rest/api/v2010/account/CallDeleter.java index ff149c0be..cfa717724 100644 --- a/examples/java/src/main/java/com/twilio/rest/api/v2010/account/CallDeleter.java +++ b/examples/java/src/main/java/com/twilio/rest/api/v2010/account/CallDeleter.java @@ -20,6 +20,7 @@ import com.twilio.exception.ApiConnectionException; import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.converter.Converter; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; @@ -64,6 +65,9 @@ public boolean delete(final TwilioRestClient client) { String path = "/2010-04-01/Accounts/{AccountSid}/Calls/{TestInteger}.json"; this.pathAccountSid = this.pathAccountSid == null ? client.getAccountSid() : this.pathAccountSid; + if (this.pathAccountSid == null) { + throw new InvalidRequestException("pathAccountSid can not be null"); + } path = path.replace("{"+"AccountSid"+"}", this.pathAccountSid.toString()); path = path.replace("{"+"TestInteger"+"}", this.pathTestInteger.toString()); diff --git a/examples/java/src/main/java/com/twilio/rest/api/v2010/account/CallFetcher.java b/examples/java/src/main/java/com/twilio/rest/api/v2010/account/CallFetcher.java index ef9dbf245..ed1877611 100644 --- a/examples/java/src/main/java/com/twilio/rest/api/v2010/account/CallFetcher.java +++ b/examples/java/src/main/java/com/twilio/rest/api/v2010/account/CallFetcher.java @@ -21,6 +21,7 @@ import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response; @@ -65,6 +66,9 @@ public Call fetch(final TwilioRestClient client) { String path = "/2010-04-01/Accounts/{AccountSid}/Calls/{TestInteger}.json"; this.pathAccountSid = this.pathAccountSid == null ? client.getAccountSid() : this.pathAccountSid; + if (this.pathAccountSid == null) { + throw new InvalidRequestException("pathAccountSid can not be null"); + } path = path.replace("{"+"AccountSid"+"}", this.pathAccountSid.toString()); path = path.replace("{"+"TestInteger"+"}", this.pathTestInteger.toString()); diff --git a/examples/java/src/main/java/com/twilio/rest/api/v2010/account/call/FeedbackCallSummaryUpdater.java b/examples/java/src/main/java/com/twilio/rest/api/v2010/account/call/FeedbackCallSummaryUpdater.java index dd84baa09..e19ad2728 100644 --- a/examples/java/src/main/java/com/twilio/rest/api/v2010/account/call/FeedbackCallSummaryUpdater.java +++ b/examples/java/src/main/java/com/twilio/rest/api/v2010/account/call/FeedbackCallSummaryUpdater.java @@ -21,6 +21,7 @@ import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response; @@ -85,6 +86,9 @@ public FeedbackCallSummary update(final TwilioRestClient client){ String path = "/2010-04-01/Accounts/{AccountSid}/Calls/Feedback/Summary/{Sid}.json"; this.pathAccountSid = this.pathAccountSid == null ? client.getAccountSid() : this.pathAccountSid; + if (this.pathAccountSid == null) { + throw new InvalidRequestException("pathAccountSid can not be null"); + } path = path.replace("{"+"AccountSid"+"}", this.pathAccountSid.toString()); path = path.replace("{"+"Sid"+"}", this.pathSid.toString()); path = path.replace("{"+"EndDate"+"}", this.endDate.toString()); diff --git a/examples/java/src/main/java/com/twilio/rest/flexapi/v1/CallUpdater.java b/examples/java/src/main/java/com/twilio/rest/flexapi/v1/CallUpdater.java index 0b7890712..1533d5f7e 100644 --- a/examples/java/src/main/java/com/twilio/rest/flexapi/v1/CallUpdater.java +++ b/examples/java/src/main/java/com/twilio/rest/flexapi/v1/CallUpdater.java @@ -21,6 +21,7 @@ import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response; diff --git a/examples/java/src/main/java/com/twilio/rest/flexapi/v1/credential/AwsDeleter.java b/examples/java/src/main/java/com/twilio/rest/flexapi/v1/credential/AwsDeleter.java index 773fbe4ea..1265a480f 100644 --- a/examples/java/src/main/java/com/twilio/rest/flexapi/v1/credential/AwsDeleter.java +++ b/examples/java/src/main/java/com/twilio/rest/flexapi/v1/credential/AwsDeleter.java @@ -20,6 +20,7 @@ import com.twilio.exception.ApiConnectionException; import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.converter.Converter; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; diff --git a/examples/java/src/main/java/com/twilio/rest/flexapi/v1/credential/AwsFetcher.java b/examples/java/src/main/java/com/twilio/rest/flexapi/v1/credential/AwsFetcher.java index 60b26432e..a8038eaee 100644 --- a/examples/java/src/main/java/com/twilio/rest/flexapi/v1/credential/AwsFetcher.java +++ b/examples/java/src/main/java/com/twilio/rest/flexapi/v1/credential/AwsFetcher.java @@ -21,6 +21,7 @@ import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response; diff --git a/examples/java/src/main/java/com/twilio/rest/flexapi/v1/credential/AwsReader.java b/examples/java/src/main/java/com/twilio/rest/flexapi/v1/credential/AwsReader.java index 1f31f250f..0f0cec927 100644 --- a/examples/java/src/main/java/com/twilio/rest/flexapi/v1/credential/AwsReader.java +++ b/examples/java/src/main/java/com/twilio/rest/flexapi/v1/credential/AwsReader.java @@ -21,6 +21,7 @@ import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response; diff --git a/examples/java/src/main/java/com/twilio/rest/flexapi/v1/credential/AwsUpdater.java b/examples/java/src/main/java/com/twilio/rest/flexapi/v1/credential/AwsUpdater.java index 82c1dbc0d..4f4e745ec 100644 --- a/examples/java/src/main/java/com/twilio/rest/flexapi/v1/credential/AwsUpdater.java +++ b/examples/java/src/main/java/com/twilio/rest/flexapi/v1/credential/AwsUpdater.java @@ -21,6 +21,7 @@ import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response; diff --git a/examples/java/src/main/java/com/twilio/rest/flexapi/v1/credential/NewCredentialsCreator.java b/examples/java/src/main/java/com/twilio/rest/flexapi/v1/credential/NewCredentialsCreator.java index 2acabd640..66612c6ab 100644 --- a/examples/java/src/main/java/com/twilio/rest/flexapi/v1/credential/NewCredentialsCreator.java +++ b/examples/java/src/main/java/com/twilio/rest/flexapi/v1/credential/NewCredentialsCreator.java @@ -21,6 +21,7 @@ import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response; diff --git a/examples/java/src/main/java/com/twilio/rest/flexapi/v1/credential/aws/HistoryFetcher.java b/examples/java/src/main/java/com/twilio/rest/flexapi/v1/credential/aws/HistoryFetcher.java index da34ba156..0669ee1d9 100644 --- a/examples/java/src/main/java/com/twilio/rest/flexapi/v1/credential/aws/HistoryFetcher.java +++ b/examples/java/src/main/java/com/twilio/rest/flexapi/v1/credential/aws/HistoryFetcher.java @@ -21,6 +21,7 @@ import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response; diff --git a/examples/java/src/main/java/com/twilio/rest/previewiam/organizations/UserCreator.java b/examples/java/src/main/java/com/twilio/rest/previewiam/organizations/UserCreator.java index 30ba8054f..ef17f8e47 100644 --- a/examples/java/src/main/java/com/twilio/rest/previewiam/organizations/UserCreator.java +++ b/examples/java/src/main/java/com/twilio/rest/previewiam/organizations/UserCreator.java @@ -21,6 +21,7 @@ import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response; diff --git a/examples/java/src/main/java/com/twilio/rest/previewiam/organizations/UserDeleter.java b/examples/java/src/main/java/com/twilio/rest/previewiam/organizations/UserDeleter.java index 261caefb2..d3aeb38a1 100644 --- a/examples/java/src/main/java/com/twilio/rest/previewiam/organizations/UserDeleter.java +++ b/examples/java/src/main/java/com/twilio/rest/previewiam/organizations/UserDeleter.java @@ -20,6 +20,7 @@ import com.twilio.exception.ApiConnectionException; import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.converter.Converter; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; diff --git a/examples/java/src/main/java/com/twilio/rest/previewiam/organizations/UserFetcher.java b/examples/java/src/main/java/com/twilio/rest/previewiam/organizations/UserFetcher.java index afeab006a..efa0c7960 100644 --- a/examples/java/src/main/java/com/twilio/rest/previewiam/organizations/UserFetcher.java +++ b/examples/java/src/main/java/com/twilio/rest/previewiam/organizations/UserFetcher.java @@ -21,6 +21,7 @@ import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response; diff --git a/examples/java/src/main/java/com/twilio/rest/previewiam/organizations/UserReader.java b/examples/java/src/main/java/com/twilio/rest/previewiam/organizations/UserReader.java index c99291016..6ce99b79f 100644 --- a/examples/java/src/main/java/com/twilio/rest/previewiam/organizations/UserReader.java +++ b/examples/java/src/main/java/com/twilio/rest/previewiam/organizations/UserReader.java @@ -21,6 +21,7 @@ import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response; diff --git a/examples/java/src/main/java/com/twilio/rest/previewiam/organizations/UserUpdater.java b/examples/java/src/main/java/com/twilio/rest/previewiam/organizations/UserUpdater.java index f56013776..aff1794b4 100644 --- a/examples/java/src/main/java/com/twilio/rest/previewiam/organizations/UserUpdater.java +++ b/examples/java/src/main/java/com/twilio/rest/previewiam/organizations/UserUpdater.java @@ -21,6 +21,7 @@ import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response; diff --git a/examples/java/src/main/java/com/twilio/rest/previewiam/v1/TokenCreator.java b/examples/java/src/main/java/com/twilio/rest/previewiam/v1/TokenCreator.java index 39be29372..74549be90 100644 --- a/examples/java/src/main/java/com/twilio/rest/previewiam/v1/TokenCreator.java +++ b/examples/java/src/main/java/com/twilio/rest/previewiam/v1/TokenCreator.java @@ -21,6 +21,7 @@ import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response; diff --git a/examples/java/src/main/java/com/twilio/rest/versionless/deployedDevices/FleetCreator.java b/examples/java/src/main/java/com/twilio/rest/versionless/deployedDevices/FleetCreator.java index 5bf8a973d..49f9d1132 100644 --- a/examples/java/src/main/java/com/twilio/rest/versionless/deployedDevices/FleetCreator.java +++ b/examples/java/src/main/java/com/twilio/rest/versionless/deployedDevices/FleetCreator.java @@ -21,6 +21,7 @@ import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response; diff --git a/examples/java/src/main/java/com/twilio/rest/versionless/deployedDevices/FleetFetcher.java b/examples/java/src/main/java/com/twilio/rest/versionless/deployedDevices/FleetFetcher.java index 87af1ec75..a31f3c957 100644 --- a/examples/java/src/main/java/com/twilio/rest/versionless/deployedDevices/FleetFetcher.java +++ b/examples/java/src/main/java/com/twilio/rest/versionless/deployedDevices/FleetFetcher.java @@ -21,6 +21,7 @@ import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response; diff --git a/examples/java/src/main/java/com/twilio/rest/versionless/understand/AssistantReader.java b/examples/java/src/main/java/com/twilio/rest/versionless/understand/AssistantReader.java index a500e7a50..ce6567d0b 100644 --- a/examples/java/src/main/java/com/twilio/rest/versionless/understand/AssistantReader.java +++ b/examples/java/src/main/java/com/twilio/rest/versionless/understand/AssistantReader.java @@ -21,6 +21,7 @@ import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response; diff --git a/src/main/resources/twilio-java/creator.mustache b/src/main/resources/twilio-java/creator.mustache index 1c19dac2e..9d11c87b0 100644 --- a/src/main/resources/twilio-java/creator.mustache +++ b/src/main/resources/twilio-java/creator.mustache @@ -9,6 +9,7 @@ import com.twilio.exception.ApiConnectionException; import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response; diff --git a/src/main/resources/twilio-java/deleter.mustache b/src/main/resources/twilio-java/deleter.mustache index 082c5df14..bb0d59e4e 100644 --- a/src/main/resources/twilio-java/deleter.mustache +++ b/src/main/resources/twilio-java/deleter.mustache @@ -8,6 +8,7 @@ import com.twilio.constant.EnumConstants; import com.twilio.exception.ApiConnectionException; import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.converter.Converter; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; diff --git a/src/main/resources/twilio-java/fetcher.mustache b/src/main/resources/twilio-java/fetcher.mustache index 34be9003b..787700725 100644 --- a/src/main/resources/twilio-java/fetcher.mustache +++ b/src/main/resources/twilio-java/fetcher.mustache @@ -9,6 +9,7 @@ import com.twilio.exception.ApiConnectionException; import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response; diff --git a/src/main/resources/twilio-java/generate_uri.mustache b/src/main/resources/twilio-java/generate_uri.mustache index 6ff4664d9..3a406f278 100644 --- a/src/main/resources/twilio-java/generate_uri.mustache +++ b/src/main/resources/twilio-java/generate_uri.mustache @@ -8,6 +8,9 @@ {{#allParams}} {{#vendorExtensions.x-is-account-sid}} this.{{paramName}} = this.{{paramName}} == null ? client.getAccountSid() : this.{{paramName}}; + if (this.{{paramName}} == null) { + throw new InvalidRequestException("{{paramName}} can not be null"); + } path = path.replace("{"+"{{baseName}}"+"}", this.{{paramName}}.toString()); {{/vendorExtensions.x-is-account-sid}} {{/allParams}} diff --git a/src/main/resources/twilio-java/reader.mustache b/src/main/resources/twilio-java/reader.mustache index 0297987bd..4fe255716 100644 --- a/src/main/resources/twilio-java/reader.mustache +++ b/src/main/resources/twilio-java/reader.mustache @@ -9,6 +9,7 @@ import com.twilio.exception.ApiConnectionException; import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response; diff --git a/src/main/resources/twilio-java/updater.mustache b/src/main/resources/twilio-java/updater.mustache index d14fd7661..55f223a2a 100644 --- a/src/main/resources/twilio-java/updater.mustache +++ b/src/main/resources/twilio-java/updater.mustache @@ -9,6 +9,7 @@ import com.twilio.exception.ApiConnectionException; import com.twilio.converter.PrefixedCollapsibleMap; import com.twilio.converter.Converter; import com.twilio.exception.ApiException; +import com.twilio.exception.InvalidRequestException; import com.twilio.exception.RestException; import com.twilio.http.HttpMethod; import com.twilio.http.Response;