Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: added null check accountSid #617

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/twilio-java/creator.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/twilio-java/deleter.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/twilio-java/fetcher.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/twilio-java/generate_uri.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/twilio-java/reader.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/twilio-java/updater.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading