Skip to content

Commit

Permalink
[Librarian] Regenerated @ 5eb406c4977c9f6976e6053cb5b581056f541a59
Browse files Browse the repository at this point in the history
  • Loading branch information
twilio-dx committed Nov 6, 2023
1 parent 89d80b5 commit baeba21
Show file tree
Hide file tree
Showing 10 changed files with 679 additions and 2 deletions.
18 changes: 18 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
twilio-java changelog
=====================

[2023-11-06] Version 9.14.1
---------------------------
**Flex**
- Adding `provisioning_status` for Email Manager

**Intelligence**
- Add text-generation operator (for example conversation summary) results to existing OperatorResults collection.

**Messaging**
- Add DELETE support to Tollfree Verification resource

**Serverless**
- Add node18 as a valid Build runtime

**Verify**
- Update Verify TOTP maturity to GA.


[2023-10-19] Version 9.14.0
---------------------------
**Library - Chore**
Expand Down
151 changes: 151 additions & 0 deletions src/main/java/com/twilio/rest/flexapi/v1/ProvisioningStatus.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
/*
* This code was generated by
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
*
* Twilio - Flex
* This is the public Twilio REST API.
*
* NOTE: This class is auto generated by OpenAPI Generator.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

package com.twilio.rest.flexapi.v1;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.twilio.base.Resource;
import com.twilio.converter.Promoter;
import com.twilio.exception.ApiConnectionException;
import com.twilio.exception.ApiException;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.util.Objects;
import lombok.ToString;
import lombok.ToString;

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

private static final long serialVersionUID = 116877818354472L;

public static ProvisioningStatusFetcher fetcher() {
return new ProvisioningStatusFetcher();
}

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

/**
* Converts a JSON InputStream into a ProvisioningStatus object using the provided
* ObjectMapper.
*
* @param json Raw JSON InputStream
* @param objectMapper Jackson ObjectMapper
* @return ProvisioningStatus object represented by the provided JSON
*/
public static ProvisioningStatus fromJson(
final InputStream json,
final ObjectMapper objectMapper
) {
// Convert all checked exceptions to Runtime
try {
return objectMapper.readValue(json, ProvisioningStatus.class);
} catch (final JsonMappingException | JsonParseException e) {
throw new ApiException(e.getMessage(), e);
} catch (final IOException e) {
throw new ApiConnectionException(e.getMessage(), e);
}
}

public enum Status {
ACTIVE("active"),
IN_PROGRESS("in-progress"),
NOT_CONFIGURED("not-configured"),
FAILED("failed");

private final String value;

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

public String toString() {
return value;
}

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

private final ProvisioningStatus.Status status;
private final URI url;

@JsonCreator
private ProvisioningStatus(
@JsonProperty("status") final ProvisioningStatus.Status status,
@JsonProperty("url") final URI url
) {
this.status = status;
this.url = url;
}

public final ProvisioningStatus.Status getStatus() {
return this.status;
}

public final URI getUrl() {
return this.url;
}

@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}

if (o == null || getClass() != o.getClass()) {
return false;
}

ProvisioningStatus other = (ProvisioningStatus) o;

return (
Objects.equals(status, other.status) &&
Objects.equals(url, other.url)
);
}

@Override
public int hashCode() {
return Objects.hash(status, url);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
* This code was generated by
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
*
* Twilio - Flex
* This is the public Twilio REST API.
*
* NOTE: This class is auto generated by OpenAPI Generator.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

package com.twilio.rest.flexapi.v1;

import com.twilio.base.Fetcher;
import com.twilio.exception.ApiConnectionException;
import com.twilio.exception.ApiException;
import com.twilio.exception.RestException;
import com.twilio.http.HttpMethod;
import com.twilio.http.Request;
import com.twilio.http.Response;
import com.twilio.http.TwilioRestClient;
import com.twilio.rest.Domains;

public class ProvisioningStatusFetcher extends Fetcher<ProvisioningStatus> {

public ProvisioningStatusFetcher() {}

@Override
public ProvisioningStatus fetch(final TwilioRestClient client) {
String path = "/v1/account/provision/status";

Request request = new Request(
HttpMethod.GET,
Domains.FLEXAPI.toString(),
path
);
Response response = client.request(request);

if (response == null) {
throw new ApiConnectionException(
"ProvisioningStatus fetch failed: Unable to connect to server"
);
} else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) {
RestException restException = RestException.fromJson(
response.getStream(),
client.getObjectMapper()
);
if (restException == null) {
throw new ApiException(
"Server Error, no content",
response.getStatusCode()
);
}
throw new ApiException(restException);
}

return ProvisioningStatus.fromJson(
response.getStream(),
client.getObjectMapper()
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
@ToString
public class OperatorResult extends Resource {

private static final long serialVersionUID = 126254553573605L;
private static final long serialVersionUID = 197278046028453L;

public static OperatorResultFetcher fetcher(
final String pathTranscriptSid,
Expand Down Expand Up @@ -130,6 +130,7 @@ public static OperatorType forValue(final String value) {
private final BigDecimal predictedProbability;
private final Map<String, Object> labelProbabilities;
private final Map<String, Object> extractResults;
private final Map<String, Object> textGenerationResults;
private final String transcriptSid;
private final URI url;

Expand Down Expand Up @@ -159,6 +160,10 @@ private OperatorResult(
String,
Object
> extractResults,
@JsonProperty("text_generation_results") final Map<
String,
Object
> textGenerationResults,
@JsonProperty("transcript_sid") final String transcriptSid,
@JsonProperty("url") final URI url
) {
Expand All @@ -174,6 +179,7 @@ private OperatorResult(
this.predictedProbability = predictedProbability;
this.labelProbabilities = labelProbabilities;
this.extractResults = extractResults;
this.textGenerationResults = textGenerationResults;
this.transcriptSid = transcriptSid;
this.url = url;
}
Expand Down Expand Up @@ -226,6 +232,10 @@ public final Map<String, Object> getExtractResults() {
return this.extractResults;
}

public final Map<String, Object> getTextGenerationResults() {
return this.textGenerationResults;
}

public final String getTranscriptSid() {
return this.transcriptSid;
}
Expand Down Expand Up @@ -259,6 +269,10 @@ public boolean equals(final Object o) {
Objects.equals(predictedProbability, other.predictedProbability) &&
Objects.equals(labelProbabilities, other.labelProbabilities) &&
Objects.equals(extractResults, other.extractResults) &&
Objects.equals(
textGenerationResults,
other.textGenerationResults
) &&
Objects.equals(transcriptSid, other.transcriptSid) &&
Objects.equals(url, other.url)
);
Expand All @@ -279,6 +293,7 @@ public int hashCode() {
predictedProbability,
labelProbabilities,
extractResults,
textGenerationResults,
transcriptSid,
url
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ public static TollfreeVerificationCreator creator(
);
}

public static TollfreeVerificationDeleter deleter(final String pathSid) {
return new TollfreeVerificationDeleter(pathSid);
}

public static TollfreeVerificationFetcher fetcher(final String pathSid) {
return new TollfreeVerificationFetcher(pathSid);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* This code was generated by
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
*
* Twilio - Messaging
* This is the public Twilio REST API.
*
* NOTE: This class is auto generated by OpenAPI Generator.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

package com.twilio.rest.messaging.v1;

import com.twilio.base.Deleter;
import com.twilio.exception.ApiConnectionException;
import com.twilio.exception.ApiException;
import com.twilio.exception.RestException;
import com.twilio.http.HttpMethod;
import com.twilio.http.Request;
import com.twilio.http.Response;
import com.twilio.http.TwilioRestClient;
import com.twilio.rest.Domains;

public class TollfreeVerificationDeleter extends Deleter<TollfreeVerification> {

private String pathSid;

public TollfreeVerificationDeleter(final String pathSid) {
this.pathSid = pathSid;
}

@Override
public boolean delete(final TwilioRestClient client) {
String path = "/v1/Tollfree/Verifications/{Sid}";

path = path.replace("{" + "Sid" + "}", this.pathSid.toString());

Request request = new Request(
HttpMethod.DELETE,
Domains.MESSAGING.toString(),
path
);
Response response = client.request(request);

if (response == null) {
throw new ApiConnectionException(
"TollfreeVerification delete failed: Unable to connect to server"
);
} else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) {
RestException restException = RestException.fromJson(
response.getStream(),
client.getObjectMapper()
);
if (restException == null) {
throw new ApiException(
"Server Error, no content",
response.getStatusCode()
);
}
throw new ApiException(restException);
}
return response.getStatusCode() == 204;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ public enum Runtime {
NODE10("node10"),
NODE12("node12"),
NODE14("node14"),
NODE16("node16");
NODE16("node16"),
NODE18("node18");

private final String value;

Expand Down
Loading

0 comments on commit baeba21

Please sign in to comment.