Skip to content

Commit

Permalink
[Librarian] Regenerated @ 45fa5159053e1c1f62f6d613f3b67a9239b43a5f 25…
Browse files Browse the repository at this point in the history
…51818144b7f525e66740ded45831b930db82b8
  • Loading branch information
twilio-dx committed Dec 5, 2024
1 parent 92de799 commit 7de4216
Show file tree
Hide file tree
Showing 21 changed files with 2,275 additions and 32 deletions.
16 changes: 16 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
twilio-java changelog
=====================

[2024-12-05] Version 10.6.4
---------------------------
**Api**
- Add optional parameter `intelligence_service` to `transcription`
- Updated `phone_number_sid` to be populated for sip trunking terminating calls.

**Numbers**
- Add Update Hosted Number Order V2 API endpoint
- Update Port in docs

**Twiml**
- Add optional parameter `intelligence_service` to `<Transcription>`
- Add support for new `<ConversationRelay>` and `<Assistant>` noun
- Add `events` attribute to `<Dial>` verb


[2024-11-15] Version 10.6.3
---------------------------
**Api**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class TranscriptionCreator extends Creator<Transcription> {
private String speechModel;
private String hints;
private Boolean enableAutomaticPunctuation;
private String intelligenceService;

public TranscriptionCreator(final String pathCallSid) {
this.pathCallSid = pathCallSid;
Expand Down Expand Up @@ -145,6 +146,13 @@ public TranscriptionCreator setEnableAutomaticPunctuation(
return this;
}

public TranscriptionCreator setIntelligenceService(
final String intelligenceService
) {
this.intelligenceService = intelligenceService;
return this;
}

@Override
public Transcription create(final TwilioRestClient client) {
String path =
Expand Down Expand Up @@ -242,5 +250,8 @@ private void addPostParams(final Request request) {
enableAutomaticPunctuation.toString()
);
}
if (intelligenceService != null) {
request.addPostParam("IntelligenceService", intelligenceService);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,31 @@

@JsonIgnoreProperties(ignoreUnknown = true)
@ToString
public class Webhook extends Resource {
public class PortingWebhookConfigurationFetch extends Resource {

private static final long serialVersionUID = 270526030240961L;

public static WebhookFetcher fetcher() {
return new WebhookFetcher();
public static PortingWebhookConfigurationFetchFetcher fetcher() {
return new PortingWebhookConfigurationFetchFetcher();
}

/**
* Converts a JSON String into a Webhook object using the provided ObjectMapper.
* Converts a JSON String into a PortingWebhookConfigurationFetch object using the provided ObjectMapper.
*
* @param json Raw JSON String
* @param objectMapper Jackson ObjectMapper
* @return Webhook object represented by the provided JSON
* @return PortingWebhookConfigurationFetch object represented by the provided JSON
*/
public static Webhook fromJson(
public static PortingWebhookConfigurationFetch fromJson(
final String json,
final ObjectMapper objectMapper
) {
// Convert all checked exceptions to Runtime
try {
return objectMapper.readValue(json, Webhook.class);
return objectMapper.readValue(
json,
PortingWebhookConfigurationFetch.class
);
} catch (final JsonMappingException | JsonParseException e) {
throw new ApiException(e.getMessage(), e);
} catch (final IOException e) {
Expand All @@ -65,20 +68,23 @@ public static Webhook fromJson(
}

/**
* Converts a JSON InputStream into a Webhook object using the provided
* Converts a JSON InputStream into a PortingWebhookConfigurationFetch object using the provided
* ObjectMapper.
*
* @param json Raw JSON InputStream
* @param objectMapper Jackson ObjectMapper
* @return Webhook object represented by the provided JSON
* @return PortingWebhookConfigurationFetch object represented by the provided JSON
*/
public static Webhook fromJson(
public static PortingWebhookConfigurationFetch fromJson(
final InputStream json,
final ObjectMapper objectMapper
) {
// Convert all checked exceptions to Runtime
try {
return objectMapper.readValue(json, Webhook.class);
return objectMapper.readValue(
json,
PortingWebhookConfigurationFetch.class
);
} catch (final JsonMappingException | JsonParseException e) {
throw new ApiException(e.getMessage(), e);
} catch (final IOException e) {
Expand All @@ -94,7 +100,7 @@ public static Webhook fromJson(
private final ZonedDateTime portOutTargetDateCreated;

@JsonCreator
private Webhook(
private PortingWebhookConfigurationFetch(
@JsonProperty("url") final URI url,
@JsonProperty("port_in_target_url") final URI portInTargetUrl,
@JsonProperty("port_out_target_url") final URI portOutTargetUrl,
Expand Down Expand Up @@ -150,7 +156,8 @@ public boolean equals(final Object o) {
return false;
}

Webhook other = (Webhook) o;
PortingWebhookConfigurationFetch other =
(PortingWebhookConfigurationFetch) o;

return (
Objects.equals(url, other.url) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@
import com.twilio.http.TwilioRestClient;
import com.twilio.rest.Domains;

public class WebhookFetcher extends Fetcher<Webhook> {
public class PortingWebhookConfigurationFetchFetcher
extends Fetcher<PortingWebhookConfigurationFetch> {

public WebhookFetcher() {}
public PortingWebhookConfigurationFetchFetcher() {}

@Override
public Webhook fetch(final TwilioRestClient client) {
public PortingWebhookConfigurationFetch fetch(
final TwilioRestClient client
) {
String path = "/v1/Porting/Configuration/Webhook";

Request request = new Request(
Expand All @@ -43,7 +46,7 @@ public Webhook fetch(final TwilioRestClient client) {

if (response == null) {
throw new ApiConnectionException(
"Webhook fetch failed: Unable to connect to server"
"PortingWebhookConfigurationFetch fetch failed: Unable to connect to server"
);
} else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) {
RestException restException = RestException.fromJson(
Expand All @@ -59,6 +62,9 @@ public Webhook fetch(final TwilioRestClient client) {
throw new ApiException(restException);
}

return Webhook.fromJson(response.getStream(), client.getObjectMapper());
return PortingWebhookConfigurationFetch.fromJson(
response.getStream(),
client.getObjectMapper()
);
}
}
105 changes: 101 additions & 4 deletions src/main/java/com/twilio/rest/numbers/v2/HostedNumberOrder.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
@ToString
public class HostedNumberOrder extends Resource {

private static final long serialVersionUID = 181489495524580L;
private static final long serialVersionUID = 99296181753609L;

public static HostedNumberOrderCreator creator(
final com.twilio.type.PhoneNumber phoneNumber,
Expand Down Expand Up @@ -67,6 +67,13 @@ public static HostedNumberOrderReader reader() {
return new HostedNumberOrderReader();
}

public static HostedNumberOrderUpdater updater(
final String pathSid,
final HostedNumberOrder.Status status
) {
return new HostedNumberOrderUpdater(pathSid, status);
}

/**
* Converts a JSON String into a HostedNumberOrder object using the provided ObjectMapper.
*
Expand Down Expand Up @@ -129,6 +136,12 @@ public static HostedNumberOrder fromJson(
private final com.twilio.type.PhoneNumber contactPhoneNumber;
private final String bulkHostingRequestSid;
private final String nextStep;
private final Integer verificationAttempts;
private final List<String> verificationCallSids;
private final Integer verificationCallDelay;
private final String verificationCallExtension;
private final String verificationCode;
private final HostedNumberOrder.VerificationType verificationType;

@JsonCreator
private HostedNumberOrder(
Expand Down Expand Up @@ -160,7 +173,23 @@ private HostedNumberOrder(
@JsonProperty(
"bulk_hosting_request_sid"
) final String bulkHostingRequestSid,
@JsonProperty("next_step") final String nextStep
@JsonProperty("next_step") final String nextStep,
@JsonProperty(
"verification_attempts"
) final Integer verificationAttempts,
@JsonProperty("verification_call_sids") final List<
String
> verificationCallSids,
@JsonProperty(
"verification_call_delay"
) final Integer verificationCallDelay,
@JsonProperty(
"verification_call_extension"
) final String verificationCallExtension,
@JsonProperty("verification_code") final String verificationCode,
@JsonProperty(
"verification_type"
) final HostedNumberOrder.VerificationType verificationType
) {
this.sid = sid;
this.accountSid = accountSid;
Expand All @@ -181,6 +210,12 @@ private HostedNumberOrder(
this.contactPhoneNumber = contactPhoneNumber;
this.bulkHostingRequestSid = bulkHostingRequestSid;
this.nextStep = nextStep;
this.verificationAttempts = verificationAttempts;
this.verificationCallSids = verificationCallSids;
this.verificationCallDelay = verificationCallDelay;
this.verificationCallExtension = verificationCallExtension;
this.verificationCode = verificationCode;
this.verificationType = verificationType;
}

public final String getSid() {
Expand Down Expand Up @@ -259,6 +294,30 @@ public final String getNextStep() {
return this.nextStep;
}

public final Integer getVerificationAttempts() {
return this.verificationAttempts;
}

public final List<String> getVerificationCallSids() {
return this.verificationCallSids;
}

public final Integer getVerificationCallDelay() {
return this.verificationCallDelay;
}

public final String getVerificationCallExtension() {
return this.verificationCallExtension;
}

public final String getVerificationCode() {
return this.verificationCode;
}

public final HostedNumberOrder.VerificationType getVerificationType() {
return this.verificationType;
}

@Override
public boolean equals(final Object o) {
if (this == o) {
Expand Down Expand Up @@ -296,7 +355,19 @@ public boolean equals(final Object o) {
bulkHostingRequestSid,
other.bulkHostingRequestSid
) &&
Objects.equals(nextStep, other.nextStep)
Objects.equals(nextStep, other.nextStep) &&
Objects.equals(verificationAttempts, other.verificationAttempts) &&
Objects.equals(verificationCallSids, other.verificationCallSids) &&
Objects.equals(
verificationCallDelay,
other.verificationCallDelay
) &&
Objects.equals(
verificationCallExtension,
other.verificationCallExtension
) &&
Objects.equals(verificationCode, other.verificationCode) &&
Objects.equals(verificationType, other.verificationType)
);
}

Expand All @@ -321,12 +392,19 @@ public int hashCode() {
contactTitle,
contactPhoneNumber,
bulkHostingRequestSid,
nextStep
nextStep,
verificationAttempts,
verificationCallSids,
verificationCallDelay,
verificationCallExtension,
verificationCode,
verificationType
);
}

public enum Status {
RECEIVED("received"),
PENDING_VERIFICATION("pending-verification"),
VERIFIED("verified"),
PENDING_LOA("pending-loa"),
CARRIER_PROCESSING("carrier-processing"),
Expand All @@ -349,4 +427,23 @@ public static Status forValue(final String value) {
return Promoter.enumFromString(value, Status.values());
}
}

public enum VerificationType {
PHONE_CALL("phone-call");

private final String value;

private VerificationType(final String value) {
this.value = value;
}

public String toString() {
return value;
}

@JsonCreator
public static VerificationType forValue(final String value) {
return Promoter.enumFromString(value, VerificationType.values());
}
}
}
Loading

0 comments on commit 7de4216

Please sign in to comment.