Skip to content

Commit fe862a1

Browse files
committed
[Librarian] Regenerated @ ed54b4c8e0cb1a9c046256a32f0d793bc1999424 70b7e9f9f68469f076b7c43b68a828f609a29d7c
1 parent 00901a8 commit fe862a1

File tree

7 files changed

+536
-11
lines changed

7 files changed

+536
-11
lines changed

CHANGES.md

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

4+
[2025-12-17] Version 11.3.0
5+
---------------------------
6+
**Trunking**
7+
- Corrected the type used for phone number capabilities when accessed through a Trunk. **(breaking change)**
8+
- Corrected the type used for phone number capabilities when accessed through a Trunk. **(breaking change)**
9+
10+
**Trusthub**
11+
- Added new parameters in in toll-free initialize api payload.
12+
- Remove the invalid status transition to Draft from the examples
13+
- Change the value of email to a valid one in the examples.
14+
15+
416
[2025-12-03] Version 11.2.0
517
---------------------------
618
**Library - Chore**
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
/*
2+
* This code was generated by
3+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6+
*
7+
* Twilio - Messaging
8+
* This is the public Twilio REST API.
9+
*
10+
* NOTE: This class is auto generated by OpenAPI Generator.
11+
* https://openapi-generator.tech
12+
* Do not edit the class manually.
13+
*/
14+
15+
package com.twilio.rest.messaging.v2;
16+
17+
import com.fasterxml.jackson.annotation.JsonCreator;
18+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
import com.fasterxml.jackson.core.JsonParseException;
21+
import com.fasterxml.jackson.core.JsonParseException;
22+
import com.fasterxml.jackson.core.JsonProcessingException;
23+
import com.fasterxml.jackson.databind.JsonMappingException;
24+
import com.fasterxml.jackson.databind.ObjectMapper;
25+
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
26+
import com.twilio.base.Resource;
27+
import com.twilio.base.Resource;
28+
import com.twilio.exception.ApiConnectionException;
29+
import com.twilio.exception.ApiException;
30+
import com.twilio.type.*;
31+
import java.io.IOException;
32+
import java.io.IOException;
33+
import java.io.InputStream;
34+
import java.net.URI;
35+
import java.time.ZonedDateTime;
36+
import java.util.Objects;
37+
import lombok.Getter;
38+
import lombok.ToString;
39+
40+
@JsonIgnoreProperties(ignoreUnknown = true)
41+
@ToString
42+
public class DomainCerts extends Resource {
43+
44+
public static DomainCertsFetcher fetcher(final String pathDomainSid) {
45+
return new DomainCertsFetcher(pathDomainSid);
46+
}
47+
48+
/**
49+
* Converts a JSON String into a DomainCerts object using the provided ObjectMapper.
50+
*
51+
* @param json Raw JSON String
52+
* @param objectMapper Jackson ObjectMapper
53+
* @return DomainCerts object represented by the provided JSON
54+
*/
55+
public static DomainCerts fromJson(
56+
final String json,
57+
final ObjectMapper objectMapper
58+
) {
59+
// Convert all checked exceptions to Runtime
60+
try {
61+
return objectMapper.readValue(json, DomainCerts.class);
62+
} catch (final JsonMappingException | JsonParseException e) {
63+
throw new ApiException(e.getMessage(), e);
64+
} catch (final IOException e) {
65+
throw new ApiConnectionException(e.getMessage(), e);
66+
}
67+
}
68+
69+
/**
70+
* Converts a JSON InputStream into a DomainCerts object using the provided
71+
* ObjectMapper.
72+
*
73+
* @param json Raw JSON InputStream
74+
* @param objectMapper Jackson ObjectMapper
75+
* @return DomainCerts object represented by the provided JSON
76+
*/
77+
public static DomainCerts fromJson(
78+
final InputStream json,
79+
final ObjectMapper objectMapper
80+
) {
81+
// Convert all checked exceptions to Runtime
82+
try {
83+
return objectMapper.readValue(json, DomainCerts.class);
84+
} catch (final JsonMappingException | JsonParseException e) {
85+
throw new ApiException(e.getMessage(), e);
86+
} catch (final IOException e) {
87+
throw new ApiConnectionException(e.getMessage(), e);
88+
}
89+
}
90+
91+
public static String toJson(Object object, ObjectMapper mapper) {
92+
try {
93+
return mapper.writeValueAsString(object);
94+
} catch (final JsonMappingException e) {
95+
throw new ApiException(e.getMessage(), e);
96+
} catch (JsonProcessingException e) {
97+
throw new ApiException(e.getMessage(), e);
98+
} catch (final IOException e) {
99+
throw new ApiConnectionException(e.getMessage(), e);
100+
}
101+
}
102+
103+
@Getter
104+
private final Object certInValidation;
105+
106+
@Getter
107+
private final String certificateSid;
108+
109+
@Getter
110+
private final ZonedDateTime dateCreated;
111+
112+
@Getter
113+
private final ZonedDateTime dateExpires;
114+
115+
@Getter
116+
private final ZonedDateTime dateUpdated;
117+
118+
@Getter
119+
private final URI domainName;
120+
121+
@Getter
122+
private final String domainSid;
123+
124+
@Getter
125+
private final Boolean managed;
126+
127+
@Getter
128+
private final Boolean requesting;
129+
130+
@Getter
131+
private final URI url;
132+
133+
@JsonCreator
134+
private DomainCerts(
135+
@JsonProperty("cert_in_validation") final Object certInValidation,
136+
@JsonProperty("certificate_sid") final String certificateSid,
137+
@JsonProperty("date_created") @JsonDeserialize(
138+
using = com.twilio.converter.ISO8601Deserializer.class
139+
) final ZonedDateTime dateCreated,
140+
@JsonProperty("date_expires") @JsonDeserialize(
141+
using = com.twilio.converter.ISO8601Deserializer.class
142+
) final ZonedDateTime dateExpires,
143+
@JsonProperty("date_updated") @JsonDeserialize(
144+
using = com.twilio.converter.ISO8601Deserializer.class
145+
) final ZonedDateTime dateUpdated,
146+
@JsonProperty("domain_name") final URI domainName,
147+
@JsonProperty("domain_sid") final String domainSid,
148+
@JsonProperty("managed") final Boolean managed,
149+
@JsonProperty("requesting") final Boolean requesting,
150+
@JsonProperty("url") final URI url
151+
) {
152+
this.certInValidation = certInValidation;
153+
this.certificateSid = certificateSid;
154+
this.dateCreated = dateCreated;
155+
this.dateExpires = dateExpires;
156+
this.dateUpdated = dateUpdated;
157+
this.domainName = domainName;
158+
this.domainSid = domainSid;
159+
this.managed = managed;
160+
this.requesting = requesting;
161+
this.url = url;
162+
}
163+
164+
@Override
165+
public boolean equals(final Object o) {
166+
if (this == o) {
167+
return true;
168+
}
169+
170+
if (o == null || getClass() != o.getClass()) {
171+
return false;
172+
}
173+
174+
DomainCerts other = (DomainCerts) o;
175+
return (
176+
Objects.equals(certInValidation, other.certInValidation) &&
177+
Objects.equals(certificateSid, other.certificateSid) &&
178+
Objects.equals(dateCreated, other.dateCreated) &&
179+
Objects.equals(dateExpires, other.dateExpires) &&
180+
Objects.equals(dateUpdated, other.dateUpdated) &&
181+
Objects.equals(domainName, other.domainName) &&
182+
Objects.equals(domainSid, other.domainSid) &&
183+
Objects.equals(managed, other.managed) &&
184+
Objects.equals(requesting, other.requesting) &&
185+
Objects.equals(url, other.url)
186+
);
187+
}
188+
189+
@Override
190+
public int hashCode() {
191+
return Objects.hash(
192+
certInValidation,
193+
certificateSid,
194+
dateCreated,
195+
dateExpires,
196+
dateUpdated,
197+
domainName,
198+
domainSid,
199+
managed,
200+
requesting,
201+
url
202+
);
203+
}
204+
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*
2+
* This code was generated by
3+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6+
*
7+
* Twilio - Messaging
8+
* This is the public Twilio REST API.
9+
*
10+
* NOTE: This class is auto generated by OpenAPI Generator.
11+
* https://openapi-generator.tech
12+
* Do not edit the class manually.
13+
*/
14+
15+
package com.twilio.rest.messaging.v2;
16+
17+
import com.twilio.base.Fetcher;
18+
import com.twilio.exception.ApiConnectionException;
19+
import com.twilio.exception.ApiException;
20+
import com.twilio.exception.RestException;
21+
import com.twilio.http.HttpMethod;
22+
import com.twilio.http.Request;
23+
import com.twilio.http.Response;
24+
import com.twilio.http.TwilioRestClient;
25+
import com.twilio.rest.Domains;
26+
import com.twilio.type.*;
27+
28+
public class DomainCertsFetcher extends Fetcher<DomainCerts> {
29+
30+
private String pathDomainSid;
31+
32+
public DomainCertsFetcher(final String pathDomainSid) {
33+
this.pathDomainSid = pathDomainSid;
34+
}
35+
36+
@Override
37+
public DomainCerts fetch(final TwilioRestClient client) {
38+
String path = "/v2/LinkShortening/Domains/{DomainSid}/Certificate";
39+
40+
path =
41+
path.replace(
42+
"{" + "DomainSid" + "}",
43+
this.pathDomainSid.toString()
44+
);
45+
46+
Request request = new Request(
47+
HttpMethod.GET,
48+
Domains.MESSAGING.toString(),
49+
path
50+
);
51+
52+
Response response = client.request(request);
53+
54+
if (response == null) {
55+
throw new ApiConnectionException(
56+
"DomainCerts fetch failed: Unable to connect to server"
57+
);
58+
} else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) {
59+
RestException restException = RestException.fromJson(
60+
response.getStream(),
61+
client.getObjectMapper()
62+
);
63+
if (restException == null) {
64+
throw new ApiException(
65+
"Server Error, no content",
66+
response.getStatusCode()
67+
);
68+
}
69+
throw new ApiException(restException);
70+
}
71+
return DomainCerts.fromJson(
72+
response.getStream(),
73+
client.getObjectMapper()
74+
);
75+
}
76+
}

src/main/java/com/twilio/rest/numbers/v1/PortingAllPortInReader.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,15 @@
2828
import com.twilio.http.TwilioRestClient;
2929
import com.twilio.rest.Domains;
3030
import com.twilio.type.*;
31-
import java.time.ZonedDateTime;
3231

3332
public class PortingAllPortInReader extends Reader<PortingAllPortIn> {
3433

3534
private String token;
3635
private Integer size;
3736
private String portInRequestSid;
3837
private String portInRequestStatus;
39-
private ZonedDateTime createdBefore;
40-
private ZonedDateTime createdAfter;
38+
private String createdBefore;
39+
private String createdAfter;
4140

4241
public PortingAllPortInReader() {}
4342

@@ -65,16 +64,12 @@ public PortingAllPortInReader setPortInRequestStatus(
6564
return this;
6665
}
6766

68-
public PortingAllPortInReader setCreatedBefore(
69-
final ZonedDateTime createdBefore
70-
) {
67+
public PortingAllPortInReader setCreatedBefore(final String createdBefore) {
7168
this.createdBefore = createdBefore;
7269
return this;
7370
}
7471

75-
public PortingAllPortInReader setCreatedAfter(
76-
final ZonedDateTime createdAfter
77-
) {
72+
public PortingAllPortInReader setCreatedAfter(final String createdAfter) {
7873
this.createdAfter = createdAfter;
7974
return this;
8075
}

src/main/java/com/twilio/rest/trunking/v1/trunk/PhoneNumber.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import com.twilio.exception.ApiException;
3131
import com.twilio.http.HttpMethod;
3232
import com.twilio.type.*;
33+
import com.twilio.type.PhoneNumberCapabilities;
3334
import java.io.IOException;
3435
import java.io.IOException;
3536
import java.io.InputStream;
@@ -159,7 +160,7 @@ public static String toJson(Object object, ObjectMapper mapper) {
159160
private final Boolean beta;
160161

161162
@Getter
162-
private final Map<String, String> capabilities;
163+
private final PhoneNumberCapabilities capabilities;
163164

164165
@Getter
165166
private final ZonedDateTime dateCreated;
@@ -232,7 +233,9 @@ private PhoneNumber(
232233
) final PhoneNumber.AddressRequirement addressRequirements,
233234
@JsonProperty("api_version") final String apiVersion,
234235
@JsonProperty("beta") final Boolean beta,
235-
@JsonProperty("capabilities") final Map<String, String> capabilities,
236+
@JsonProperty(
237+
"capabilities"
238+
) final PhoneNumberCapabilities capabilities,
236239
@JsonProperty("date_created") @JsonDeserialize(
237240
using = com.twilio.converter.ISO8601Deserializer.class
238241
) final ZonedDateTime dateCreated,

src/main/java/com/twilio/rest/trusthub/v1/ComplianceTollfreeInquiries.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,29 @@ public static ComplianceTollfreeInquiriesCreator creator(
5050
);
5151
}
5252

53+
public enum BusinessType {
54+
PRIVATE_PROFIT("PRIVATE_PROFIT"),
55+
PUBLIC_PROFIT("PUBLIC_PROFIT"),
56+
NON_PROFIT("NON_PROFIT"),
57+
SOLE_PROPRIETOR("SOLE_PROPRIETOR"),
58+
GOVERNMENT("GOVERNMENT");
59+
60+
private final String value;
61+
62+
private BusinessType(final String value) {
63+
this.value = value;
64+
}
65+
66+
public String toString() {
67+
return value;
68+
}
69+
70+
@JsonCreator
71+
public static BusinessType forValue(final String value) {
72+
return Promoter.enumFromString(value, BusinessType.values());
73+
}
74+
}
75+
5376
public enum OptInType {
5477
VERBAL("VERBAL"),
5578
WEB_FORM("WEB_FORM"),

0 commit comments

Comments
 (0)