Skip to content

Commit

Permalink
[Librarian] Regenerated @ d9b0f7b0297f064eec2f219b29fd4193559c54f3 40…
Browse files Browse the repository at this point in the history
…5f363a58346c6557d4194de16d9911b797e208
  • Loading branch information
twilio-dx committed Jan 13, 2025
1 parent 38394f5 commit d3f4f88
Show file tree
Hide file tree
Showing 8 changed files with 413 additions and 57 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
twilio-java changelog
=====================

[2025-01-13] Version 10.6.7
---------------------------
**Messaging**
- Adds validity period Default value in service resource documentation


[2025-01-09] Version 10.6.6
---------------------------
**Numbers**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,28 @@

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

private static final long serialVersionUID = 217181042856619L;

public static NewApiKeyCreator creator(final String accountSid) {
return new NewApiKeyCreator(accountSid);
public static KeyCreator creator(final String accountSid) {
return new KeyCreator(accountSid);
}

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

/**
* Converts a JSON InputStream into a NewApiKey object using the provided
* Converts a JSON InputStream into a Key object using the provided
* ObjectMapper.
*
* @param json Raw JSON InputStream
* @param objectMapper Jackson ObjectMapper
* @return NewApiKey object represented by the provided JSON
* @return Key object represented by the provided JSON
*/
public static NewApiKey fromJson(
public static Key fromJson(
final InputStream json,
final ObjectMapper objectMapper
) {
// Convert all checked exceptions to Runtime
try {
return objectMapper.readValue(json, NewApiKey.class);
return objectMapper.readValue(json, Key.class);
} catch (final JsonMappingException | JsonParseException e) {
throw new ApiException(e.getMessage(), e);
} catch (final IOException e) {
Expand All @@ -95,7 +95,7 @@ public static NewApiKey fromJson(
private final Map<String, Object> policy;

@JsonCreator
private NewApiKey(
private Key(
@JsonProperty("sid") final String sid,
@JsonProperty("friendly_name") final String friendlyName,
@JsonProperty("date_created") final String dateCreated,
Expand Down Expand Up @@ -145,7 +145,7 @@ public boolean equals(final Object o) {
return false;
}

NewApiKey other = (NewApiKey) o;
Key other = (Key) o;

return (
Objects.equals(sid, other.sid) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,39 +29,39 @@
import java.util.Map;
import java.util.Map;

public class NewApiKeyCreator extends Creator<NewApiKey> {
public class KeyCreator extends Creator<Key> {

private String accountSid;
private String friendlyName;
private NewApiKey.Keytype keyType;
private Key.Keytype keyType;
private Map<String, Object> policy;

public NewApiKeyCreator(final String accountSid) {
public KeyCreator(final String accountSid) {
this.accountSid = accountSid;
}

public NewApiKeyCreator setAccountSid(final String accountSid) {
public KeyCreator setAccountSid(final String accountSid) {
this.accountSid = accountSid;
return this;
}

public NewApiKeyCreator setFriendlyName(final String friendlyName) {
public KeyCreator setFriendlyName(final String friendlyName) {
this.friendlyName = friendlyName;
return this;
}

public NewApiKeyCreator setKeyType(final NewApiKey.Keytype keyType) {
public KeyCreator setKeyType(final Key.Keytype keyType) {
this.keyType = keyType;
return this;
}

public NewApiKeyCreator setPolicy(final Map<String, Object> policy) {
public KeyCreator setPolicy(final Map<String, Object> policy) {
this.policy = policy;
return this;
}

@Override
public NewApiKey create(final TwilioRestClient client) {
public Key create(final TwilioRestClient client) {
String path = "/v1/Keys";

path =
Expand All @@ -77,7 +77,7 @@ public NewApiKey create(final TwilioRestClient client) {
Response response = client.request(request);
if (response == null) {
throw new ApiConnectionException(
"NewApiKey creation failed: Unable to connect to server"
"Key creation failed: Unable to connect to server"
);
} else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) {
RestException restException = RestException.fromJson(
Expand All @@ -93,10 +93,7 @@ public NewApiKey create(final TwilioRestClient client) {
throw new ApiException(restException);
}

return NewApiKey.fromJson(
response.getStream(),
client.getObjectMapper()
);
return Key.fromJson(response.getStream(), client.getObjectMapper());
}

private void addPostParams(final Request request) {
Expand Down
210 changes: 210 additions & 0 deletions src/main/java/com/twilio/rest/marketplace/v1/ModuleData.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
/*
* This code was generated by
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
*
* Twilio - Marketplace
* 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.marketplace.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.exception.ApiConnectionException;
import com.twilio.exception.ApiException;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.util.List;
import java.util.Map;
import java.util.Map;
import java.util.Objects;
import lombok.ToString;
import lombok.ToString;

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

private static final long serialVersionUID = 132859226086963L;

public static ModuleDataCreator creator() {
return new ModuleDataCreator();
}

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

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

private final URI url;
private final String sid;
private final Map<String, Object> description;
private final Map<String, Object> support;
private final Map<String, Object> policies;
private final Map<String, Object> moduleInfo;
private final Map<String, Object> documentation;
private final Map<String, Object> configuration;
private final Map<String, Object> pricing;
private final List<Map<String, Object>> listings;

@JsonCreator
private ModuleData(
@JsonProperty("url") final URI url,
@JsonProperty("sid") final String sid,
@JsonProperty("description") final Map<String, Object> description,
@JsonProperty("support") final Map<String, Object> support,
@JsonProperty("policies") final Map<String, Object> policies,
@JsonProperty("module_info") final Map<String, Object> moduleInfo,
@JsonProperty("documentation") final Map<String, Object> documentation,
@JsonProperty("configuration") final Map<String, Object> configuration,
@JsonProperty("pricing") final Map<String, Object> pricing,
@JsonProperty("listings") final List<Map<String, Object>> listings
) {
this.url = url;
this.sid = sid;
this.description = description;
this.support = support;
this.policies = policies;
this.moduleInfo = moduleInfo;
this.documentation = documentation;
this.configuration = configuration;
this.pricing = pricing;
this.listings = listings;
}

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

public final String getSid() {
return this.sid;
}

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

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

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

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

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

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

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

public final List<Map<String, Object>> getListings() {
return this.listings;
}

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

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

ModuleData other = (ModuleData) o;

return (
Objects.equals(url, other.url) &&
Objects.equals(sid, other.sid) &&
Objects.equals(description, other.description) &&
Objects.equals(support, other.support) &&
Objects.equals(policies, other.policies) &&
Objects.equals(moduleInfo, other.moduleInfo) &&
Objects.equals(documentation, other.documentation) &&
Objects.equals(configuration, other.configuration) &&
Objects.equals(pricing, other.pricing) &&
Objects.equals(listings, other.listings)
);
}

@Override
public int hashCode() {
return Objects.hash(
url,
sid,
description,
support,
policies,
moduleInfo,
documentation,
configuration,
pricing,
listings
);
}
}
Loading

0 comments on commit d3f4f88

Please sign in to comment.