Skip to content

Commit 8228f7a

Browse files
committed
[Librarian] Regenerated @ ca4a5892d2b6a6161860845fe1152af07920bc07 403073118470eabf87311669c7fea876d35ced04
1 parent be3009b commit 8228f7a

File tree

5 files changed

+50
-54
lines changed

5 files changed

+50
-54
lines changed

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
twilio-java changelog
22
=====================
33

4+
[2024-12-12] Version 10.6.5
5+
---------------------------
6+
**Library - Fix**
7+
- [PR #822](https://github.com/twilio/twilio-java/pull/822): Update org.json:json library to resolve high severity vulnerability. Thanks to [@allantodd](https://github.com/allantodd)!
8+
9+
410
[2024-12-05] Version 10.6.4
511
---------------------------
612
**Api**

src/main/java/com/twilio/rest/iam/v1/Key.java renamed to src/main/java/com/twilio/rest/iam/v1/NewApiKey.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,28 +36,28 @@
3636

3737
@JsonIgnoreProperties(ignoreUnknown = true)
3838
@ToString
39-
public class Key extends Resource {
39+
public class NewApiKey extends Resource {
4040

4141
private static final long serialVersionUID = 217181042856619L;
4242

43-
public static KeyCreator creator(final String accountSid) {
44-
return new KeyCreator(accountSid);
43+
public static NewApiKeyCreator creator(final String accountSid) {
44+
return new NewApiKeyCreator(accountSid);
4545
}
4646

4747
/**
48-
* Converts a JSON String into a Key object using the provided ObjectMapper.
48+
* Converts a JSON String into a NewApiKey object using the provided ObjectMapper.
4949
*
5050
* @param json Raw JSON String
5151
* @param objectMapper Jackson ObjectMapper
52-
* @return Key object represented by the provided JSON
52+
* @return NewApiKey object represented by the provided JSON
5353
*/
54-
public static Key fromJson(
54+
public static NewApiKey fromJson(
5555
final String json,
5656
final ObjectMapper objectMapper
5757
) {
5858
// Convert all checked exceptions to Runtime
5959
try {
60-
return objectMapper.readValue(json, Key.class);
60+
return objectMapper.readValue(json, NewApiKey.class);
6161
} catch (final JsonMappingException | JsonParseException e) {
6262
throw new ApiException(e.getMessage(), e);
6363
} catch (final IOException e) {
@@ -66,20 +66,20 @@ public static Key fromJson(
6666
}
6767

6868
/**
69-
* Converts a JSON InputStream into a Key object using the provided
69+
* Converts a JSON InputStream into a NewApiKey object using the provided
7070
* ObjectMapper.
7171
*
7272
* @param json Raw JSON InputStream
7373
* @param objectMapper Jackson ObjectMapper
74-
* @return Key object represented by the provided JSON
74+
* @return NewApiKey object represented by the provided JSON
7575
*/
76-
public static Key fromJson(
76+
public static NewApiKey fromJson(
7777
final InputStream json,
7878
final ObjectMapper objectMapper
7979
) {
8080
// Convert all checked exceptions to Runtime
8181
try {
82-
return objectMapper.readValue(json, Key.class);
82+
return objectMapper.readValue(json, NewApiKey.class);
8383
} catch (final JsonMappingException | JsonParseException e) {
8484
throw new ApiException(e.getMessage(), e);
8585
} catch (final IOException e) {
@@ -95,7 +95,7 @@ public static Key fromJson(
9595
private final Map<String, Object> policy;
9696

9797
@JsonCreator
98-
private Key(
98+
private NewApiKey(
9999
@JsonProperty("sid") final String sid,
100100
@JsonProperty("friendly_name") final String friendlyName,
101101
@JsonProperty("date_created") final String dateCreated,
@@ -145,7 +145,7 @@ public boolean equals(final Object o) {
145145
return false;
146146
}
147147

148-
Key other = (Key) o;
148+
NewApiKey other = (NewApiKey) o;
149149

150150
return (
151151
Objects.equals(sid, other.sid) &&

src/main/java/com/twilio/rest/iam/v1/KeyCreator.java renamed to src/main/java/com/twilio/rest/iam/v1/NewApiKeyCreator.java

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,39 +29,39 @@
2929
import java.util.Map;
3030
import java.util.Map;
3131

32-
public class KeyCreator extends Creator<Key> {
32+
public class NewApiKeyCreator extends Creator<NewApiKey> {
3333

3434
private String accountSid;
3535
private String friendlyName;
36-
private Key.Keytype keyType;
36+
private NewApiKey.Keytype keyType;
3737
private Map<String, Object> policy;
3838

39-
public KeyCreator(final String accountSid) {
39+
public NewApiKeyCreator(final String accountSid) {
4040
this.accountSid = accountSid;
4141
}
4242

43-
public KeyCreator setAccountSid(final String accountSid) {
43+
public NewApiKeyCreator setAccountSid(final String accountSid) {
4444
this.accountSid = accountSid;
4545
return this;
4646
}
4747

48-
public KeyCreator setFriendlyName(final String friendlyName) {
48+
public NewApiKeyCreator setFriendlyName(final String friendlyName) {
4949
this.friendlyName = friendlyName;
5050
return this;
5151
}
5252

53-
public KeyCreator setKeyType(final Key.Keytype keyType) {
53+
public NewApiKeyCreator setKeyType(final NewApiKey.Keytype keyType) {
5454
this.keyType = keyType;
5555
return this;
5656
}
5757

58-
public KeyCreator setPolicy(final Map<String, Object> policy) {
58+
public NewApiKeyCreator setPolicy(final Map<String, Object> policy) {
5959
this.policy = policy;
6060
return this;
6161
}
6262

6363
@Override
64-
public Key create(final TwilioRestClient client) {
64+
public NewApiKey create(final TwilioRestClient client) {
6565
String path = "/v1/Keys";
6666

6767
path =
@@ -77,7 +77,7 @@ public Key create(final TwilioRestClient client) {
7777
Response response = client.request(request);
7878
if (response == null) {
7979
throw new ApiConnectionException(
80-
"Key creation failed: Unable to connect to server"
80+
"NewApiKey creation failed: Unable to connect to server"
8181
);
8282
} else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) {
8383
RestException restException = RestException.fromJson(
@@ -93,7 +93,10 @@ public Key create(final TwilioRestClient client) {
9393
throw new ApiException(restException);
9494
}
9595

96-
return Key.fromJson(response.getStream(), client.getObjectMapper());
96+
return NewApiKey.fromJson(
97+
response.getStream(),
98+
client.getObjectMapper()
99+
);
97100
}
98101

99102
private void addPostParams(final Request request) {

src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationFetch.java renamed to src/main/java/com/twilio/rest/numbers/v1/Webhook.java

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,31 +35,28 @@
3535

3636
@JsonIgnoreProperties(ignoreUnknown = true)
3737
@ToString
38-
public class PortingWebhookConfigurationFetch extends Resource {
38+
public class Webhook extends Resource {
3939

4040
private static final long serialVersionUID = 270526030240961L;
4141

42-
public static PortingWebhookConfigurationFetchFetcher fetcher() {
43-
return new PortingWebhookConfigurationFetchFetcher();
42+
public static WebhookFetcher fetcher() {
43+
return new WebhookFetcher();
4444
}
4545

4646
/**
47-
* Converts a JSON String into a PortingWebhookConfigurationFetch object using the provided ObjectMapper.
47+
* Converts a JSON String into a Webhook object using the provided ObjectMapper.
4848
*
4949
* @param json Raw JSON String
5050
* @param objectMapper Jackson ObjectMapper
51-
* @return PortingWebhookConfigurationFetch object represented by the provided JSON
51+
* @return Webhook object represented by the provided JSON
5252
*/
53-
public static PortingWebhookConfigurationFetch fromJson(
53+
public static Webhook fromJson(
5454
final String json,
5555
final ObjectMapper objectMapper
5656
) {
5757
// Convert all checked exceptions to Runtime
5858
try {
59-
return objectMapper.readValue(
60-
json,
61-
PortingWebhookConfigurationFetch.class
62-
);
59+
return objectMapper.readValue(json, Webhook.class);
6360
} catch (final JsonMappingException | JsonParseException e) {
6461
throw new ApiException(e.getMessage(), e);
6562
} catch (final IOException e) {
@@ -68,23 +65,20 @@ public static PortingWebhookConfigurationFetch fromJson(
6865
}
6966

7067
/**
71-
* Converts a JSON InputStream into a PortingWebhookConfigurationFetch object using the provided
68+
* Converts a JSON InputStream into a Webhook object using the provided
7269
* ObjectMapper.
7370
*
7471
* @param json Raw JSON InputStream
7572
* @param objectMapper Jackson ObjectMapper
76-
* @return PortingWebhookConfigurationFetch object represented by the provided JSON
73+
* @return Webhook object represented by the provided JSON
7774
*/
78-
public static PortingWebhookConfigurationFetch fromJson(
75+
public static Webhook fromJson(
7976
final InputStream json,
8077
final ObjectMapper objectMapper
8178
) {
8279
// Convert all checked exceptions to Runtime
8380
try {
84-
return objectMapper.readValue(
85-
json,
86-
PortingWebhookConfigurationFetch.class
87-
);
81+
return objectMapper.readValue(json, Webhook.class);
8882
} catch (final JsonMappingException | JsonParseException e) {
8983
throw new ApiException(e.getMessage(), e);
9084
} catch (final IOException e) {
@@ -100,7 +94,7 @@ public static PortingWebhookConfigurationFetch fromJson(
10094
private final ZonedDateTime portOutTargetDateCreated;
10195

10296
@JsonCreator
103-
private PortingWebhookConfigurationFetch(
97+
private Webhook(
10498
@JsonProperty("url") final URI url,
10599
@JsonProperty("port_in_target_url") final URI portInTargetUrl,
106100
@JsonProperty("port_out_target_url") final URI portOutTargetUrl,
@@ -156,8 +150,7 @@ public boolean equals(final Object o) {
156150
return false;
157151
}
158152

159-
PortingWebhookConfigurationFetch other =
160-
(PortingWebhookConfigurationFetch) o;
153+
Webhook other = (Webhook) o;
161154

162155
return (
163156
Objects.equals(url, other.url) &&

src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationFetchFetcher.java renamed to src/main/java/com/twilio/rest/numbers/v1/WebhookFetcher.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,12 @@
2525
import com.twilio.http.TwilioRestClient;
2626
import com.twilio.rest.Domains;
2727

28-
public class PortingWebhookConfigurationFetchFetcher
29-
extends Fetcher<PortingWebhookConfigurationFetch> {
28+
public class WebhookFetcher extends Fetcher<Webhook> {
3029

31-
public PortingWebhookConfigurationFetchFetcher() {}
30+
public WebhookFetcher() {}
3231

3332
@Override
34-
public PortingWebhookConfigurationFetch fetch(
35-
final TwilioRestClient client
36-
) {
33+
public Webhook fetch(final TwilioRestClient client) {
3734
String path = "/v1/Porting/Configuration/Webhook";
3835

3936
Request request = new Request(
@@ -46,7 +43,7 @@ public PortingWebhookConfigurationFetch fetch(
4643

4744
if (response == null) {
4845
throw new ApiConnectionException(
49-
"PortingWebhookConfigurationFetch fetch failed: Unable to connect to server"
46+
"Webhook fetch failed: Unable to connect to server"
5047
);
5148
} else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) {
5249
RestException restException = RestException.fromJson(
@@ -62,9 +59,6 @@ public PortingWebhookConfigurationFetch fetch(
6259
throw new ApiException(restException);
6360
}
6461

65-
return PortingWebhookConfigurationFetch.fromJson(
66-
response.getStream(),
67-
client.getObjectMapper()
68-
);
62+
return Webhook.fromJson(response.getStream(), client.getObjectMapper());
6963
}
7064
}

0 commit comments

Comments
 (0)