Releases: vimeo/vimeo-networking-java
Release 2.0.0 Alpha 24
This is the first alpha version containing the new Kotlin DTOs. These new DTOs are accessible under the new package com.vimeo.networking2
. This allows consumers to reference both the old and new DTOs within code without being forced to refactor their code. VimeoClient
and supporting infrastructure remain unchanged and use of the new DTOs is not required. In fact, use of the new DTOs is explicitly opt in and as the re-write of VimeoClient
is ongoing, they are not completely supported for all requests. The only way to receive the new DTOs is to use a methods on VimeoClient
that support providing the Caller<Data_T>
interface. These methods include:
VimeoClient.getContent
VimeoClient.getContentSync
With these methods, providing a Caller
implementation from GetRequestCaller
will give the old Java DTOs, while providing a Caller
implementation from MoshiGetRequestCaller
will give the new Kotlin DTOs.
Kotlin DTO summary:
- Kotlin
data
classes - Interoperable with Java
- Deserialized using moshi instead of stag + gson
- Annotated with
@Internal
if a property or entire DTO can only used by Vimeo and won't be populated for external consumers.
Enums are also provided by the library in the com.vimeo.networking2.enums
package. These are accessible only using utility functions on a Kotlin DTO. This contrasts with the Java classes where the enums were fields in the class itself. Instead, the String
(or other) value that will be represented by an enum is directly available on the DTO, and a Kotlin extension property (Java utility method) maps the value in the field to its enum counterpart and defaults to an unknown value if the value was not recognized. This alleviates the problem where debugging became difficult when you saw an "unknown" enum value. It was difficult to determine if the consumer was just on an out of date version of the library that didn't support a new enum value or if no value was supplied or if the API was providing an erroneous value. The new enum
use looks like this now from Kotlin:
val userBadge = User().badge
val userBadgeTypeString: String = userBadge.rawType
val userBadgeTypeEnum: UserBadgeType = userBadge.type
The documentation on the raw string field will point to the extension function, and the extension function will properly point back to the raw backing field. From Java, things look much different, but it is idiomatic and follows an easy to remember pattern. For classes that have a field representing an enum
, the enum
can be extracted from the backing field by using the corresponding -Utils
class, like this:
final UserBadge userBadge = new User().getBadge();
final String userBadgeTypeString = userBadge.getRawType();
final UserBadgeType userBadgeTypeEnum = UserBadgeUtils.getType(userBadge);
In addition to the enum
utils provided, there are also a number of common interfaces that are provided to define functionality of certain DTOs. They are available in the com.vimeo.networking2.common
package and are:
Entity
: Exists in the legacy version of the library. An interface that defines a class which has an identity, where the unique identifier is provided by a property.Followable
: Also available in the legacy version of the library. This interface is an improved version of the old interface and now only defines that theMetadata
property on the implementing DTO has a collection of interactions namedFollowableInteractions
. TheFollowableInteractions
interface defines a class that has a property namedfollow
that is of the typeUpdateableInteraction
.Interaction
: Interactions have common properties and this interface defines them. Theoptions: List<String>
property can also be turned into aList<ApiOptionsType>
using the enums pattern described above.
Common extensions will also now be present in the library in the package com.vimeo.networking2.extensions
. Rather than overload the DTOs with a lot of helper functions, the new version of the library seeks to keep these helper functions separate using extension functions in Kotlin and utility classes in Java. This pattern is followed with respect to enums as described above, however those extensions are uniquely defined in the file containing the DTO. For other extensions, they live in the extensions
package.
FollowableExtensions.kt
containsFollowable.isFollowing
andFollowable.canFollow
Kotlin extension functions on theFollowable
type (implemented byChannel
,Category
,Group
, andUser
), which can be used from Java usingFollowableUtils.isFollowing(followable)
andFollowable.canFollow(followable)
.
Release 2.0.0 Alpha 23
Added password
as a Play
status
Release 2.0.0 Alpha 22
Added support for Albums
Release 2.0.0 Alpha 21
Added support for GCS approach to upload.
Release 2.0.0 Alpha 20
New receipt validation error value
Release 2.0.0 Alpha 19
New ChromeCast token on video privacy object.
Release 2.0.0 Alpha 18
Modify dependencies to resolve external build issues
Release 2.0.0 Alpha 17
- Added new sorting constants
duration
last_user_action_event_date
- Added more sorting constants
plays
likes
modified_time
comments
- Improved documentation around field filters
- Fixed bug where
VimeoError
was not being properly deserialized
Release 2.0.0 Alpha 16
- Added
total_cap_exceeded
status - Added
link_with_play_button
field to the Picture DTO. - Created a
LanguageHeaderInterceptor
to automatically add the Accept-Language header to HTTP requests made to the API - Exposing the raw error code
- Adding support for producer account
- Entity representation: created an interface for a common way to access unique identifier property of models
- Update Gradle dependency example
Version 1.1.2
Added link_with_play_button
field to the Picture
DTO.