Skip to content

Commit 17d2886

Browse files
committed
preview
1 parent 9712ae4 commit 17d2886

File tree

3,852 files changed

+491161
-175198
lines changed

Some content is hidden

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

3,852 files changed

+491161
-175198
lines changed
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
/*
2+
* This code was generated by
3+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6+
*
7+
* Twilio - Accounts
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.accounts.v1;
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.databind.JsonMappingException;
21+
import com.fasterxml.jackson.databind.ObjectMapper;
22+
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
23+
24+
import com.twilio.exception.ApiConnectionException;
25+
import com.twilio.exception.ApiException;
26+
import lombok.Getter;
27+
import lombok.ToString;
28+
29+
import java.io.InputStream;
30+
import java.net.URI;
31+
import java.time.ZonedDateTime;
32+
import com.twilio.type.*;
33+
import java.util.Objects;
34+
import com.twilio.base.Resource;
35+
import java.io.IOException;
36+
import com.fasterxml.jackson.core.JsonParseException;
37+
import com.fasterxml.jackson.core.JsonProcessingException;
38+
39+
import com.twilio.base.Resource;
40+
import java.io.IOException;
41+
import com.fasterxml.jackson.core.JsonParseException;
42+
43+
@JsonIgnoreProperties(ignoreUnknown = true)
44+
@ToString
45+
public class AuthTokenPromotion extends Resource {
46+
47+
48+
49+
50+
51+
52+
53+
54+
public static AuthTokenPromotionUpdater updater() {
55+
return new AuthTokenPromotionUpdater(
56+
57+
);
58+
}
59+
60+
61+
62+
63+
64+
/**
65+
* Converts a JSON String into a AuthTokenPromotion object using the provided ObjectMapper.
66+
*
67+
* @param json Raw JSON String
68+
* @param objectMapper Jackson ObjectMapper
69+
* @return AuthTokenPromotion object represented by the provided JSON
70+
*/
71+
public static AuthTokenPromotion fromJson(final String json, final ObjectMapper objectMapper) {
72+
// Convert all checked exceptions to Runtime
73+
try {
74+
return objectMapper.readValue(json, AuthTokenPromotion.class);
75+
} catch (final JsonMappingException | JsonParseException e) {
76+
throw new ApiException(e.getMessage(), e);
77+
} catch (final IOException e) {
78+
throw new ApiConnectionException(e.getMessage(), e);
79+
}
80+
}
81+
82+
/**
83+
* Converts a JSON InputStream into a AuthTokenPromotion object using the provided
84+
* ObjectMapper.
85+
*
86+
* @param json Raw JSON InputStream
87+
* @param objectMapper Jackson ObjectMapper
88+
* @return AuthTokenPromotion object represented by the provided JSON
89+
*/
90+
public static AuthTokenPromotion fromJson(final InputStream json, final ObjectMapper objectMapper) {
91+
// Convert all checked exceptions to Runtime
92+
try {
93+
return objectMapper.readValue(json, AuthTokenPromotion.class);
94+
} catch (final JsonMappingException | JsonParseException e) {
95+
throw new ApiException(e.getMessage(), e);
96+
} catch (final IOException e) {
97+
throw new ApiConnectionException(e.getMessage(), e);
98+
}
99+
}
100+
101+
public static String toJson(Object object, ObjectMapper mapper) {
102+
try {
103+
return mapper.writeValueAsString(object);
104+
} catch (final JsonMappingException e) {
105+
throw new ApiException(e.getMessage(), e);
106+
} catch (JsonProcessingException e) {
107+
throw new ApiException(e.getMessage(), e);
108+
} catch (final IOException e) {
109+
throw new ApiConnectionException(e.getMessage(), e);
110+
}
111+
}
112+
113+
114+
@Getter
115+
private final String accountSid;
116+
@Getter
117+
private final String authToken;
118+
@Getter
119+
private final ZonedDateTime dateCreated;
120+
@Getter
121+
private final ZonedDateTime dateUpdated;
122+
@Getter
123+
private final URI url;
124+
125+
@JsonCreator
126+
private AuthTokenPromotion(
127+
@JsonProperty("account_sid")
128+
final String accountSid,
129+
@JsonProperty("auth_token")
130+
final String authToken,
131+
@JsonProperty("date_created")
132+
@JsonDeserialize(using = com.twilio.converter.ISO8601Deserializer.class)
133+
final ZonedDateTime dateCreated,
134+
@JsonProperty("date_updated")
135+
@JsonDeserialize(using = com.twilio.converter.ISO8601Deserializer.class)
136+
final ZonedDateTime dateUpdated,
137+
@JsonProperty("url")
138+
final URI url
139+
){
140+
this.accountSid = accountSid;
141+
this.authToken = authToken;
142+
this.dateCreated = dateCreated;
143+
this.dateUpdated = dateUpdated;
144+
this.url = url;
145+
}
146+
147+
@Override
148+
public boolean equals(final Object o) {
149+
if (this == o) {
150+
return true;
151+
}
152+
153+
if (o == null || getClass() != o.getClass()) {
154+
return false;
155+
}
156+
157+
AuthTokenPromotion other = (AuthTokenPromotion) o;
158+
return (
159+
Objects.equals(accountSid, other.accountSid) &&
160+
Objects.equals(authToken, other.authToken) &&
161+
Objects.equals(dateCreated, other.dateCreated) &&
162+
Objects.equals(dateUpdated, other.dateUpdated) &&
163+
Objects.equals(url, other.url)
164+
);
165+
}
166+
167+
@Override
168+
public int hashCode() {
169+
return Objects.hash(
170+
accountSid,
171+
authToken,
172+
dateCreated,
173+
dateUpdated,
174+
url
175+
);
176+
}
177+
178+
179+
180+
}
181+
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
* This code was generated by
3+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6+
*
7+
* Twilio - Accounts
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.accounts.v1;
16+
17+
import com.twilio.base.Updater;
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+
27+
import com.twilio.type.*;
28+
29+
30+
public class AuthTokenPromotionUpdater extends Updater<AuthTokenPromotion> {
31+
32+
public AuthTokenPromotionUpdater() {
33+
}
34+
35+
36+
@Override
37+
public AuthTokenPromotion update(final TwilioRestClient client) {
38+
39+
String path = "/v1/AuthTokens/Promote";
40+
41+
42+
43+
Request request = new Request(
44+
HttpMethod.POST,
45+
Domains.ACCOUNTS.toString(),
46+
path
47+
);
48+
49+
Response response = client.request(request);
50+
51+
if (response == null) {
52+
throw new ApiConnectionException("AuthTokenPromotion update failed: Unable to connect to server");
53+
} else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) {
54+
RestException restException = RestException.fromJson(
55+
response.getStream(),
56+
client.getObjectMapper()
57+
);
58+
if (restException == null) {
59+
throw new ApiException("Server Error, no content", response.getStatusCode());
60+
}
61+
throw new ApiException(restException);
62+
}
63+
64+
return AuthTokenPromotion.fromJson(response.getStream(), client.getObjectMapper());
65+
}
66+
}

rest/accounts/v1/BulkConsents.java

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
/*
2+
* This code was generated by
3+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6+
*
7+
* Twilio - Accounts
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.accounts.v1;
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.databind.JsonMappingException;
21+
import com.fasterxml.jackson.databind.ObjectMapper;
22+
23+
import com.twilio.exception.ApiConnectionException;
24+
import com.twilio.exception.ApiException;
25+
import lombok.Getter;
26+
import lombok.ToString;
27+
28+
import java.io.InputStream;
29+
import java.util.List;
30+
import com.twilio.type.*;
31+
import java.util.Objects;
32+
import com.twilio.base.Resource;
33+
import java.io.IOException;
34+
import com.fasterxml.jackson.core.JsonParseException;
35+
import com.fasterxml.jackson.core.JsonProcessingException;
36+
37+
import com.twilio.base.Resource;
38+
import java.io.IOException;
39+
import com.fasterxml.jackson.core.JsonParseException;
40+
41+
@JsonIgnoreProperties(ignoreUnknown = true)
42+
@ToString
43+
public class BulkConsents extends Resource {
44+
45+
46+
47+
public static BulkConsentsCreator creator(final List<Object> items) {
48+
return new BulkConsentsCreator(
49+
items
50+
);
51+
}
52+
53+
54+
55+
56+
57+
58+
59+
60+
61+
62+
/**
63+
* Converts a JSON String into a BulkConsents object using the provided ObjectMapper.
64+
*
65+
* @param json Raw JSON String
66+
* @param objectMapper Jackson ObjectMapper
67+
* @return BulkConsents object represented by the provided JSON
68+
*/
69+
public static BulkConsents fromJson(final String json, final ObjectMapper objectMapper) {
70+
// Convert all checked exceptions to Runtime
71+
try {
72+
return objectMapper.readValue(json, BulkConsents.class);
73+
} catch (final JsonMappingException | JsonParseException e) {
74+
throw new ApiException(e.getMessage(), e);
75+
} catch (final IOException e) {
76+
throw new ApiConnectionException(e.getMessage(), e);
77+
}
78+
}
79+
80+
/**
81+
* Converts a JSON InputStream into a BulkConsents object using the provided
82+
* ObjectMapper.
83+
*
84+
* @param json Raw JSON InputStream
85+
* @param objectMapper Jackson ObjectMapper
86+
* @return BulkConsents object represented by the provided JSON
87+
*/
88+
public static BulkConsents fromJson(final InputStream json, final ObjectMapper objectMapper) {
89+
// Convert all checked exceptions to Runtime
90+
try {
91+
return objectMapper.readValue(json, BulkConsents.class);
92+
} catch (final JsonMappingException | JsonParseException e) {
93+
throw new ApiException(e.getMessage(), e);
94+
} catch (final IOException e) {
95+
throw new ApiConnectionException(e.getMessage(), e);
96+
}
97+
}
98+
99+
public static String toJson(Object object, ObjectMapper mapper) {
100+
try {
101+
return mapper.writeValueAsString(object);
102+
} catch (final JsonMappingException e) {
103+
throw new ApiException(e.getMessage(), e);
104+
} catch (JsonProcessingException e) {
105+
throw new ApiException(e.getMessage(), e);
106+
} catch (final IOException e) {
107+
throw new ApiConnectionException(e.getMessage(), e);
108+
}
109+
}
110+
111+
112+
@Getter
113+
private final Object items;
114+
115+
@JsonCreator
116+
private BulkConsents(
117+
@JsonProperty("items")
118+
final Object items
119+
){
120+
this.items = items;
121+
}
122+
123+
@Override
124+
public boolean equals(final Object o) {
125+
if (this == o) {
126+
return true;
127+
}
128+
129+
if (o == null || getClass() != o.getClass()) {
130+
return false;
131+
}
132+
133+
BulkConsents other = (BulkConsents) o;
134+
return (
135+
Objects.equals(items, other.items)
136+
);
137+
}
138+
139+
@Override
140+
public int hashCode() {
141+
return Objects.hash(
142+
items
143+
);
144+
}
145+
146+
147+
148+
}
149+

0 commit comments

Comments
 (0)