Skip to content

Commit f5d5b14

Browse files
committed
Rename Recording to RoomRecording
1 parent fd8a441 commit f5d5b14

File tree

6 files changed

+111
-82
lines changed

6 files changed

+111
-82
lines changed

CHANGES.md

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

4+
[2017-05-19] Version 7.11.0
5+
--------------------------
6+
- Rename `Recording` to `RoomRecording` in Twilio Video
7+
48
[2017-05-19] Version 7.10.0
59
--------------------------
610
- Add video.twilio.com

UPGRADE.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,31 @@
33
_After `7.4.0` all `MINOR` and `MAJOR` version bumps will have upgrade notes
44
posted here._
55

6+
7+
[2017-05-24] 7.10.x to 7.11.x
8+
---------------------------
9+
10+
### CHANGED - Rename `Recording` to `RoomRecording` in TwilioVideo
11+
12+
#### Affected Resources
13+
- `src/main/java/com/twilio/rest/video/v1/room/Recording.java`
14+
- `src/main/java/com/twilio/rest/video/v1/room/RecordingFetcher.java`
15+
- `src/main/java/com/twilio/rest/video/v1/room/RecordingReader.java`
16+
- `src/test/java/com/twilio/rest/video/v1/room/RecordingTest.java`
17+
18+
```java
19+
// 7.10.x
20+
Recording.fetcher();
21+
Recording.reader();
22+
```
23+
24+
```java
25+
// 7.11.x
26+
RoomRecording.fetcher();
27+
RoomRecording.reader();
28+
```
29+
30+
631
[2017-05-19] 7.9.x to 7.10.x
732
---------------------------
833

src/main/java/com/twilio/rest/video/v1/room/Recording.java renamed to src/main/java/com/twilio/rest/video/v1/room/RoomRecording.java

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import java.util.Objects;
3636

3737
@JsonIgnoreProperties(ignoreUnknown = true)
38-
public class Recording extends Resource {
38+
public class RoomRecording extends Resource {
3939
private static final long serialVersionUID = 258585563555163L;
4040

4141
public enum Status {
@@ -144,39 +144,39 @@ public static Codec forValue(final String value) {
144144
}
145145

146146
/**
147-
* Create a RecordingFetcher to execute fetch.
147+
* Create a RoomRecordingFetcher to execute fetch.
148148
*
149149
* @param pathRoomSid The room_sid
150150
* @param pathSid The sid
151-
* @return RecordingFetcher capable of executing the fetch
151+
* @return RoomRecordingFetcher capable of executing the fetch
152152
*/
153-
public static RecordingFetcher fetcher(final String pathRoomSid,
154-
final String pathSid) {
155-
return new RecordingFetcher(pathRoomSid, pathSid);
153+
public static RoomRecordingFetcher fetcher(final String pathRoomSid,
154+
final String pathSid) {
155+
return new RoomRecordingFetcher(pathRoomSid, pathSid);
156156
}
157157

158158
/**
159-
* Create a RecordingReader to execute read.
159+
* Create a RoomRecordingReader to execute read.
160160
*
161161
* @param pathRoomSid The room_sid
162-
* @return RecordingReader capable of executing the read
162+
* @return RoomRecordingReader capable of executing the read
163163
*/
164-
public static RecordingReader reader(final String pathRoomSid) {
165-
return new RecordingReader(pathRoomSid);
164+
public static RoomRecordingReader reader(final String pathRoomSid) {
165+
return new RoomRecordingReader(pathRoomSid);
166166
}
167167

168168
/**
169-
* Converts a JSON String into a Recording object using the provided
169+
* Converts a JSON String into a RoomRecording object using the provided
170170
* ObjectMapper.
171171
*
172172
* @param json Raw JSON String
173173
* @param objectMapper Jackson ObjectMapper
174-
* @return Recording object represented by the provided JSON
174+
* @return RoomRecording object represented by the provided JSON
175175
*/
176-
public static Recording fromJson(final String json, final ObjectMapper objectMapper) {
176+
public static RoomRecording fromJson(final String json, final ObjectMapper objectMapper) {
177177
// Convert all checked exceptions to Runtime
178178
try {
179-
return objectMapper.readValue(json, Recording.class);
179+
return objectMapper.readValue(json, RoomRecording.class);
180180
} catch (final JsonMappingException | JsonParseException e) {
181181
throw new ApiException(e.getMessage(), e);
182182
} catch (final IOException e) {
@@ -185,17 +185,17 @@ public static Recording fromJson(final String json, final ObjectMapper objectMap
185185
}
186186

187187
/**
188-
* Converts a JSON InputStream into a Recording object using the provided
188+
* Converts a JSON InputStream into a RoomRecording object using the provided
189189
* ObjectMapper.
190190
*
191191
* @param json Raw JSON InputStream
192192
* @param objectMapper Jackson ObjectMapper
193-
* @return Recording object represented by the provided JSON
193+
* @return RoomRecording object represented by the provided JSON
194194
*/
195-
public static Recording fromJson(final InputStream json, final ObjectMapper objectMapper) {
195+
public static RoomRecording fromJson(final InputStream json, final ObjectMapper objectMapper) {
196196
// Convert all checked exceptions to Runtime
197197
try {
198-
return objectMapper.readValue(json, Recording.class);
198+
return objectMapper.readValue(json, RoomRecording.class);
199199
} catch (final JsonMappingException | JsonParseException e) {
200200
throw new ApiException(e.getMessage(), e);
201201
} catch (final IOException e) {
@@ -204,49 +204,49 @@ public static Recording fromJson(final InputStream json, final ObjectMapper obje
204204
}
205205

206206
private final String accountSid;
207-
private final Recording.Status status;
207+
private final RoomRecording.Status status;
208208
private final DateTime dateCreated;
209209
private final String sid;
210210
private final String sourceSid;
211211
private final Integer size;
212-
private final Recording.Type type;
212+
private final RoomRecording.Type type;
213213
private final Integer duration;
214-
private final Recording.Format containerFormat;
215-
private final Recording.Codec codec;
214+
private final RoomRecording.Format containerFormat;
215+
private final RoomRecording.Codec codec;
216216
private final Map<String, Object> groupingSids;
217217
private final String roomSid;
218218
private final URI url;
219219
private final Map<String, String> links;
220220

221221
@JsonCreator
222-
private Recording(@JsonProperty("account_sid")
223-
final String accountSid,
224-
@JsonProperty("status")
225-
final Recording.Status status,
226-
@JsonProperty("date_created")
227-
final String dateCreated,
228-
@JsonProperty("sid")
229-
final String sid,
230-
@JsonProperty("source_sid")
231-
final String sourceSid,
232-
@JsonProperty("size")
233-
final Integer size,
234-
@JsonProperty("type")
235-
final Recording.Type type,
236-
@JsonProperty("duration")
237-
final Integer duration,
238-
@JsonProperty("container_format")
239-
final Recording.Format containerFormat,
240-
@JsonProperty("codec")
241-
final Recording.Codec codec,
242-
@JsonProperty("grouping_sids")
243-
final Map<String, Object> groupingSids,
244-
@JsonProperty("room_sid")
245-
final String roomSid,
246-
@JsonProperty("url")
247-
final URI url,
248-
@JsonProperty("links")
249-
final Map<String, String> links) {
222+
private RoomRecording(@JsonProperty("account_sid")
223+
final String accountSid,
224+
@JsonProperty("status")
225+
final RoomRecording.Status status,
226+
@JsonProperty("date_created")
227+
final String dateCreated,
228+
@JsonProperty("sid")
229+
final String sid,
230+
@JsonProperty("source_sid")
231+
final String sourceSid,
232+
@JsonProperty("size")
233+
final Integer size,
234+
@JsonProperty("type")
235+
final RoomRecording.Type type,
236+
@JsonProperty("duration")
237+
final Integer duration,
238+
@JsonProperty("container_format")
239+
final RoomRecording.Format containerFormat,
240+
@JsonProperty("codec")
241+
final RoomRecording.Codec codec,
242+
@JsonProperty("grouping_sids")
243+
final Map<String, Object> groupingSids,
244+
@JsonProperty("room_sid")
245+
final String roomSid,
246+
@JsonProperty("url")
247+
final URI url,
248+
@JsonProperty("links")
249+
final Map<String, String> links) {
250250
this.accountSid = accountSid;
251251
this.status = status;
252252
this.dateCreated = DateConverter.iso8601DateTimeFromString(dateCreated);
@@ -277,7 +277,7 @@ public final String getAccountSid() {
277277
*
278278
* @return The status
279279
*/
280-
public final Recording.Status getStatus() {
280+
public final RoomRecording.Status getStatus() {
281281
return this.status;
282282
}
283283

@@ -322,7 +322,7 @@ public final Integer getSize() {
322322
*
323323
* @return The type
324324
*/
325-
public final Recording.Type getType() {
325+
public final RoomRecording.Type getType() {
326326
return this.type;
327327
}
328328

@@ -340,7 +340,7 @@ public final Integer getDuration() {
340340
*
341341
* @return The container_format
342342
*/
343-
public final Recording.Format getContainerFormat() {
343+
public final RoomRecording.Format getContainerFormat() {
344344
return this.containerFormat;
345345
}
346346

@@ -349,7 +349,7 @@ public final Recording.Format getContainerFormat() {
349349
*
350350
* @return The codec
351351
*/
352-
public final Recording.Codec getCodec() {
352+
public final RoomRecording.Codec getCodec() {
353353
return this.codec;
354354
}
355355

@@ -399,7 +399,7 @@ public boolean equals(final Object o) {
399399
return false;
400400
}
401401

402-
Recording other = (Recording) o;
402+
RoomRecording other = (RoomRecording) o;
403403

404404
return Objects.equals(accountSid, other.accountSid) &&
405405
Objects.equals(status, other.status) &&

src/main/java/com/twilio/rest/video/v1/room/RecordingFetcher.java renamed to src/main/java/com/twilio/rest/video/v1/room/RoomRecordingFetcher.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@
1717
import com.twilio.http.TwilioRestClient;
1818
import com.twilio.rest.Domains;
1919

20-
public class RecordingFetcher extends Fetcher<Recording> {
20+
public class RoomRecordingFetcher extends Fetcher<RoomRecording> {
2121
private final String pathRoomSid;
2222
private final String pathSid;
2323

2424
/**
25-
* Construct a new RecordingFetcher.
25+
* Construct a new RoomRecordingFetcher.
2626
*
2727
* @param pathRoomSid The room_sid
2828
* @param pathSid The sid
2929
*/
30-
public RecordingFetcher(final String pathRoomSid,
31-
final String pathSid) {
30+
public RoomRecordingFetcher(final String pathRoomSid,
31+
final String pathSid) {
3232
this.pathRoomSid = pathRoomSid;
3333
this.pathSid = pathSid;
3434
}
@@ -37,11 +37,11 @@ public RecordingFetcher(final String pathRoomSid,
3737
* Make the request to the Twilio API to perform the fetch.
3838
*
3939
* @param client TwilioRestClient with which to make the request
40-
* @return Fetched Recording
40+
* @return Fetched RoomRecording
4141
*/
4242
@Override
4343
@SuppressWarnings("checkstyle:linelength")
44-
public Recording fetch(final TwilioRestClient client) {
44+
public RoomRecording fetch(final TwilioRestClient client) {
4545
Request request = new Request(
4646
HttpMethod.GET,
4747
Domains.VIDEO.toString(),
@@ -52,7 +52,7 @@ public Recording fetch(final TwilioRestClient client) {
5252
Response response = client.request(request);
5353

5454
if (response == null) {
55-
throw new ApiConnectionException("Recording fetch failed: Unable to connect to server");
55+
throw new ApiConnectionException("RoomRecording fetch failed: Unable to connect to server");
5656
} else if (!TwilioRestClient.SUCCESS.apply(response.getStatusCode())) {
5757
RestException restException = RestException.fromJson(response.getStream(), client.getObjectMapper());
5858
if (restException == null) {
@@ -68,6 +68,6 @@ public Recording fetch(final TwilioRestClient client) {
6868
);
6969
}
7070

71-
return Recording.fromJson(response.getStream(), client.getObjectMapper());
71+
return RoomRecording.fromJson(response.getStream(), client.getObjectMapper());
7272
}
7373
}

src/main/java/com/twilio/rest/video/v1/room/RecordingReader.java renamed to src/main/java/com/twilio/rest/video/v1/room/RoomRecordingReader.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,38 +19,38 @@
1919
import com.twilio.http.TwilioRestClient;
2020
import com.twilio.rest.Domains;
2121

22-
public class RecordingReader extends Reader<Recording> {
22+
public class RoomRecordingReader extends Reader<RoomRecording> {
2323
private final String pathRoomSid;
2424

2525
/**
26-
* Construct a new RecordingReader.
26+
* Construct a new RoomRecordingReader.
2727
*
2828
* @param pathRoomSid The room_sid
2929
*/
30-
public RecordingReader(final String pathRoomSid) {
30+
public RoomRecordingReader(final String pathRoomSid) {
3131
this.pathRoomSid = pathRoomSid;
3232
}
3333

3434
/**
3535
* Make the request to the Twilio API to perform the read.
3636
*
3737
* @param client TwilioRestClient with which to make the request
38-
* @return Recording ResourceSet
38+
* @return RoomRecording ResourceSet
3939
*/
4040
@Override
41-
public ResourceSet<Recording> read(final TwilioRestClient client) {
41+
public ResourceSet<RoomRecording> read(final TwilioRestClient client) {
4242
return new ResourceSet<>(this, client, firstPage(client));
4343
}
4444

4545
/**
4646
* Make the request to the Twilio API to perform the read.
4747
*
4848
* @param client TwilioRestClient with which to make the request
49-
* @return Recording ResourceSet
49+
* @return RoomRecording ResourceSet
5050
*/
5151
@Override
5252
@SuppressWarnings("checkstyle:linelength")
53-
public Page<Recording> firstPage(final TwilioRestClient client) {
53+
public Page<RoomRecording> firstPage(final TwilioRestClient client) {
5454
Request request = new Request(
5555
HttpMethod.GET,
5656
Domains.VIDEO.toString(),
@@ -70,8 +70,8 @@ public Page<Recording> firstPage(final TwilioRestClient client) {
7070
* @return Next Page
7171
*/
7272
@Override
73-
public Page<Recording> nextPage(final Page<Recording> page,
74-
final TwilioRestClient client) {
73+
public Page<RoomRecording> nextPage(final Page<RoomRecording> page,
74+
final TwilioRestClient client) {
7575
Request request = new Request(
7676
HttpMethod.GET,
7777
page.getNextPageUrl(
@@ -83,17 +83,17 @@ public Page<Recording> nextPage(final Page<Recording> page,
8383
}
8484

8585
/**
86-
* Generate a Page of Recording Resources for a given request.
86+
* Generate a Page of RoomRecording Resources for a given request.
8787
*
8888
* @param client TwilioRestClient with which to make the request
8989
* @param request Request to generate a page for
9090
* @return Page for the Request
9191
*/
92-
private Page<Recording> pageForRequest(final TwilioRestClient client, final Request request) {
92+
private Page<RoomRecording> pageForRequest(final TwilioRestClient client, final Request request) {
9393
Response response = client.request(request);
9494

9595
if (response == null) {
96-
throw new ApiConnectionException("Recording read failed: Unable to connect to server");
96+
throw new ApiConnectionException("RoomRecording read failed: Unable to connect to server");
9797
} else if (!TwilioRestClient.SUCCESS.apply(response.getStatusCode())) {
9898
RestException restException = RestException.fromJson(response.getStream(), client.getObjectMapper());
9999
if (restException == null) {
@@ -112,7 +112,7 @@ private Page<Recording> pageForRequest(final TwilioRestClient client, final Requ
112112
return Page.fromJson(
113113
"recordings",
114114
response.getContent(),
115-
Recording.class,
115+
RoomRecording.class,
116116
client.getObjectMapper()
117117
);
118118
}

0 commit comments

Comments
 (0)