Skip to content

Commit b7718a2

Browse files
committed
[Librarian] Regenerated @ 556cffc21d7318f27d71e40146d324df61aba54f 0d6654ebfab8c5a41c8454374cbb1c93d806bfae
1 parent 8fdf86b commit b7718a2

File tree

1,905 files changed

+106538
-129752
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,905 files changed

+106538
-129752
lines changed

src/main/java/com/twilio/rest/accounts/v1/AuthTokenPromotion.java

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,42 @@
1818
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
1919
import com.fasterxml.jackson.annotation.JsonProperty;
2020
import com.fasterxml.jackson.core.JsonParseException;
21+
import com.fasterxml.jackson.core.JsonProcessingException;
2122
import com.fasterxml.jackson.databind.JsonMappingException;
2223
import com.fasterxml.jackson.databind.ObjectMapper;
24+
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
2325
import com.twilio.base.Resource;
24-
import com.twilio.converter.DateConverter;
2526
import com.twilio.exception.ApiConnectionException;
2627
import com.twilio.exception.ApiException;
28+
import lombok.Getter;
29+
import lombok.ToString;
30+
2731
import java.io.IOException;
2832
import java.io.InputStream;
2933
import java.net.URI;
3034
import java.time.ZonedDateTime;
3135
import java.util.Objects;
32-
import lombok.ToString;
33-
import lombok.ToString;
3436

3537
@JsonIgnoreProperties(ignoreUnknown = true)
3638
@ToString
3739
public class AuthTokenPromotion extends Resource {
3840

39-
private static final long serialVersionUID = 77507843877589L;
4041

4142
public static AuthTokenPromotionUpdater updater() {
42-
return new AuthTokenPromotionUpdater();
43+
return new AuthTokenPromotionUpdater(
44+
45+
);
4346
}
4447

48+
4549
/**
4650
* Converts a JSON String into a AuthTokenPromotion object using the provided ObjectMapper.
4751
*
48-
* @param json Raw JSON String
52+
* @param json Raw JSON String
4953
* @param objectMapper Jackson ObjectMapper
5054
* @return AuthTokenPromotion object represented by the provided JSON
5155
*/
52-
public static AuthTokenPromotion fromJson(
53-
final String json,
54-
final ObjectMapper objectMapper
55-
) {
56+
public static AuthTokenPromotion fromJson(final String json, final ObjectMapper objectMapper) {
5657
// Convert all checked exceptions to Runtime
5758
try {
5859
return objectMapper.readValue(json, AuthTokenPromotion.class);
@@ -67,14 +68,11 @@ public static AuthTokenPromotion fromJson(
6768
* Converts a JSON InputStream into a AuthTokenPromotion object using the provided
6869
* ObjectMapper.
6970
*
70-
* @param json Raw JSON InputStream
71+
* @param json Raw JSON InputStream
7172
* @param objectMapper Jackson ObjectMapper
7273
* @return AuthTokenPromotion object represented by the provided JSON
7374
*/
74-
public static AuthTokenPromotion fromJson(
75-
final InputStream json,
76-
final ObjectMapper objectMapper
77-
) {
75+
public static AuthTokenPromotion fromJson(final InputStream json, final ObjectMapper objectMapper) {
7876
// Convert all checked exceptions to Runtime
7977
try {
8078
return objectMapper.readValue(json, AuthTokenPromotion.class);
@@ -85,47 +83,47 @@ public static AuthTokenPromotion fromJson(
8583
}
8684
}
8785

86+
public static String toJson(Object object, ObjectMapper mapper) {
87+
try {
88+
return mapper.writeValueAsString(object);
89+
} catch (final JsonMappingException e) {
90+
throw new ApiException(e.getMessage(), e);
91+
} catch (JsonProcessingException e) {
92+
throw new ApiException(e.getMessage(), e);
93+
} catch (final IOException e) {
94+
throw new ApiConnectionException(e.getMessage(), e);
95+
}
96+
}
97+
98+
99+
@Getter
88100
private final String accountSid;
101+
@Getter
89102
private final String authToken;
103+
@Getter
90104
private final ZonedDateTime dateCreated;
105+
@Getter
91106
private final ZonedDateTime dateUpdated;
107+
@Getter
92108
private final URI url;
93109

94110
@JsonCreator
95111
private AuthTokenPromotion(
96-
@JsonProperty("account_sid") final String accountSid,
97-
@JsonProperty("auth_token") final String authToken,
98-
@JsonProperty("date_created") final String dateCreated,
99-
@JsonProperty("date_updated") final String dateUpdated,
100-
@JsonProperty("url") final URI url
112+
@JsonProperty("account_sid") final String accountSid,
113+
@JsonProperty("auth_token") final String authToken,
114+
@JsonProperty("date_created")
115+
@JsonDeserialize(using = com.twilio.converter.ISO8601Deserializer.class) final ZonedDateTime dateCreated,
116+
@JsonProperty("date_updated")
117+
@JsonDeserialize(using = com.twilio.converter.ISO8601Deserializer.class) final ZonedDateTime dateUpdated,
118+
@JsonProperty("url") final URI url
101119
) {
102120
this.accountSid = accountSid;
103121
this.authToken = authToken;
104-
this.dateCreated = DateConverter.iso8601DateTimeFromString(dateCreated);
105-
this.dateUpdated = DateConverter.iso8601DateTimeFromString(dateUpdated);
122+
this.dateCreated = dateCreated;
123+
this.dateUpdated = dateUpdated;
106124
this.url = url;
107125
}
108126

109-
public final String getAccountSid() {
110-
return this.accountSid;
111-
}
112-
113-
public final String getAuthToken() {
114-
return this.authToken;
115-
}
116-
117-
public final ZonedDateTime getDateCreated() {
118-
return this.dateCreated;
119-
}
120-
121-
public final ZonedDateTime getDateUpdated() {
122-
return this.dateUpdated;
123-
}
124-
125-
public final URI getUrl() {
126-
return this.url;
127-
}
128-
129127
@Override
130128
public boolean equals(final Object o) {
131129
if (this == o) {
@@ -137,24 +135,26 @@ public boolean equals(final Object o) {
137135
}
138136

139137
AuthTokenPromotion other = (AuthTokenPromotion) o;
140-
141138
return (
142-
Objects.equals(accountSid, other.accountSid) &&
143-
Objects.equals(authToken, other.authToken) &&
144-
Objects.equals(dateCreated, other.dateCreated) &&
145-
Objects.equals(dateUpdated, other.dateUpdated) &&
146-
Objects.equals(url, other.url)
139+
Objects.equals(accountSid, other.accountSid) &&
140+
Objects.equals(authToken, other.authToken) &&
141+
Objects.equals(dateCreated, other.dateCreated) &&
142+
Objects.equals(dateUpdated, other.dateUpdated) &&
143+
Objects.equals(url, other.url)
147144
);
148145
}
149146

150147
@Override
151148
public int hashCode() {
152149
return Objects.hash(
153-
accountSid,
154-
authToken,
155-
dateCreated,
156-
dateUpdated,
157-
url
150+
accountSid,
151+
authToken,
152+
dateCreated,
153+
dateUpdated,
154+
url
158155
);
159156
}
157+
158+
160159
}
160+

src/main/java/com/twilio/rest/accounts/v1/AuthTokenPromotionUpdater.java

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
package com.twilio.rest.accounts.v1;
1616

1717
import com.twilio.base.Updater;
18-
import com.twilio.constant.EnumConstants;
1918
import com.twilio.exception.ApiConnectionException;
2019
import com.twilio.exception.ApiException;
2120
import com.twilio.exception.RestException;
@@ -27,40 +26,37 @@
2726

2827
public class AuthTokenPromotionUpdater extends Updater<AuthTokenPromotion> {
2928

30-
public AuthTokenPromotionUpdater() {}
29+
public AuthTokenPromotionUpdater() {
30+
}
31+
3132

3233
@Override
3334
public AuthTokenPromotion update(final TwilioRestClient client) {
35+
3436
String path = "/v1/AuthTokens/Promote";
3537

38+
3639
Request request = new Request(
37-
HttpMethod.POST,
38-
Domains.ACCOUNTS.toString(),
39-
path
40+
HttpMethod.POST,
41+
Domains.ACCOUNTS.toString(),
42+
path
4043
);
41-
request.setContentType(EnumConstants.ContentType.FORM_URLENCODED);
44+
4245
Response response = client.request(request);
46+
4347
if (response == null) {
44-
throw new ApiConnectionException(
45-
"AuthTokenPromotion update failed: Unable to connect to server"
46-
);
48+
throw new ApiConnectionException("AuthTokenPromotion update failed: Unable to connect to server");
4749
} else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) {
4850
RestException restException = RestException.fromJson(
49-
response.getStream(),
50-
client.getObjectMapper()
51+
response.getStream(),
52+
client.getObjectMapper()
5153
);
5254
if (restException == null) {
53-
throw new ApiException(
54-
"Server Error, no content",
55-
response.getStatusCode()
56-
);
55+
throw new ApiException("Server Error, no content", response.getStatusCode());
5756
}
5857
throw new ApiException(restException);
5958
}
6059

61-
return AuthTokenPromotion.fromJson(
62-
response.getStream(),
63-
client.getObjectMapper()
64-
);
60+
return AuthTokenPromotion.fromJson(response.getStream(), client.getObjectMapper());
6561
}
6662
}

src/main/java/com/twilio/rest/accounts/v1/BulkConsents.java

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,40 @@
1818
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
1919
import com.fasterxml.jackson.annotation.JsonProperty;
2020
import com.fasterxml.jackson.core.JsonParseException;
21+
import com.fasterxml.jackson.core.JsonProcessingException;
2122
import com.fasterxml.jackson.databind.JsonMappingException;
2223
import com.fasterxml.jackson.databind.ObjectMapper;
2324
import com.twilio.base.Resource;
2425
import com.twilio.exception.ApiConnectionException;
2526
import com.twilio.exception.ApiException;
27+
import lombok.Getter;
28+
import lombok.ToString;
29+
2630
import java.io.IOException;
2731
import java.io.InputStream;
2832
import java.util.List;
29-
import java.util.Map;
30-
import java.util.Map;
3133
import java.util.Objects;
32-
import lombok.ToString;
33-
import lombok.ToString;
3434

3535
@JsonIgnoreProperties(ignoreUnknown = true)
3636
@ToString
3737
public class BulkConsents extends Resource {
3838

39-
private static final long serialVersionUID = 126137950684284L;
4039

4140
public static BulkConsentsCreator creator(final List<Object> items) {
42-
return new BulkConsentsCreator(items);
41+
return new BulkConsentsCreator(
42+
items
43+
);
4344
}
4445

46+
4547
/**
4648
* Converts a JSON String into a BulkConsents object using the provided ObjectMapper.
4749
*
48-
* @param json Raw JSON String
50+
* @param json Raw JSON String
4951
* @param objectMapper Jackson ObjectMapper
5052
* @return BulkConsents object represented by the provided JSON
5153
*/
52-
public static BulkConsents fromJson(
53-
final String json,
54-
final ObjectMapper objectMapper
55-
) {
54+
public static BulkConsents fromJson(final String json, final ObjectMapper objectMapper) {
5655
// Convert all checked exceptions to Runtime
5756
try {
5857
return objectMapper.readValue(json, BulkConsents.class);
@@ -67,14 +66,11 @@ public static BulkConsents fromJson(
6766
* Converts a JSON InputStream into a BulkConsents object using the provided
6867
* ObjectMapper.
6968
*
70-
* @param json Raw JSON InputStream
69+
* @param json Raw JSON InputStream
7170
* @param objectMapper Jackson ObjectMapper
7271
* @return BulkConsents object represented by the provided JSON
7372
*/
74-
public static BulkConsents fromJson(
75-
final InputStream json,
76-
final ObjectMapper objectMapper
77-
) {
73+
public static BulkConsents fromJson(final InputStream json, final ObjectMapper objectMapper) {
7874
// Convert all checked exceptions to Runtime
7975
try {
8076
return objectMapper.readValue(json, BulkConsents.class);
@@ -85,19 +81,29 @@ public static BulkConsents fromJson(
8581
}
8682
}
8783

88-
private final Map<String, Object> items;
84+
public static String toJson(Object object, ObjectMapper mapper) {
85+
try {
86+
return mapper.writeValueAsString(object);
87+
} catch (final JsonMappingException e) {
88+
throw new ApiException(e.getMessage(), e);
89+
} catch (JsonProcessingException e) {
90+
throw new ApiException(e.getMessage(), e);
91+
} catch (final IOException e) {
92+
throw new ApiConnectionException(e.getMessage(), e);
93+
}
94+
}
95+
96+
97+
@Getter
98+
private final Object items;
8999

90100
@JsonCreator
91101
private BulkConsents(
92-
@JsonProperty("items") final Map<String, Object> items
102+
@JsonProperty("items") final Object items
93103
) {
94104
this.items = items;
95105
}
96106

97-
public final Map<String, Object> getItems() {
98-
return this.items;
99-
}
100-
101107
@Override
102108
public boolean equals(final Object o) {
103109
if (this == o) {
@@ -109,12 +115,18 @@ public boolean equals(final Object o) {
109115
}
110116

111117
BulkConsents other = (BulkConsents) o;
112-
113-
return Objects.equals(items, other.items);
118+
return (
119+
Objects.equals(items, other.items)
120+
);
114121
}
115122

116123
@Override
117124
public int hashCode() {
118-
return Objects.hash(items);
125+
return Objects.hash(
126+
items
127+
);
119128
}
129+
130+
120131
}
132+

0 commit comments

Comments
 (0)