├── .githooks ├── README.md └── pre-commit ├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── shipit.yml │ └── test.yml ├── .gitignore ├── .gitmodules ├── .idea └── codeStyles │ ├── Project.xml │ └── codeStyleConfig.xml ├── CHANGELOG.md ├── Dangerfile ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── README.md ├── api-core ├── build.gradle ├── detekt_baseline.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── vimeo │ │ └── networking2 │ │ ├── ApiConstants.kt │ │ ├── GrantType.kt │ │ ├── ResponseOrigin.kt │ │ ├── ScopeType.kt │ │ ├── Scopes.kt │ │ ├── VimeoCallback.kt │ │ ├── VimeoRequest.kt │ │ ├── VimeoResponse.kt │ │ ├── account │ │ ├── AccountStore.kt │ │ ├── CachingAccountStore.kt │ │ └── InMemoryAccountStore.kt │ │ ├── config │ │ ├── AuthenticationMethod.kt │ │ ├── RetrofitServicesCache.kt │ │ ├── RetrofitSetupModule.kt │ │ ├── VimeoApiConfiguration.kt │ │ └── VimeoApiConfigurationExtensions.kt │ │ ├── extensions │ │ ├── VimeoCallbackExtensions.kt │ │ └── VimeoResponseExtensions.kt │ │ ├── internal │ │ ├── ErrorHandlingCallAdapter.kt │ │ ├── ErrorHandlingCallAdapterFactory.kt │ │ ├── ErrorHandlingUnitCallAdapter.kt │ │ ├── LocalVimeoCallAdapter.kt │ │ ├── ResponseExtensions.kt │ │ ├── VimeoCall.kt │ │ ├── VimeoCallAdapter.kt │ │ ├── VimeoCallEmptyResponseAdapter.kt │ │ ├── adapters │ │ │ ├── Iso8601NoMillisAdapter.kt │ │ │ ├── RichTextStringJsonAdapter.kt │ │ │ ├── SafeObjectAdapter.kt │ │ │ └── TimeAdapter.kt │ │ ├── interceptor │ │ │ ├── AcceptHeaderInterceptor.kt │ │ │ ├── CacheControlHeaderInterceptor.kt │ │ │ ├── HostValidationInterceptor.kt │ │ │ ├── LanguageHeaderInterceptor.kt │ │ │ └── UserAgentHeaderInterceptor.kt │ │ └── params │ │ │ ├── ApiParameter.kt │ │ │ ├── IntValueJsonAdapter.kt │ │ │ ├── IntValueJsonAdapterFactory.kt │ │ │ ├── SafeObjectJsonAdapterFactory.kt │ │ │ ├── ScopesConverter.kt │ │ │ ├── StringValueConverter.kt │ │ │ ├── StringValueJsonAdapter.kt │ │ │ ├── StringValueJsonAdapterFactory.kt │ │ │ └── VimeoParametersConverterFactory.kt │ │ └── logging │ │ ├── DefaultLogDelegate.kt │ │ ├── LogDelegate.kt │ │ └── VimeoLogger.kt │ └── test │ └── java │ └── com │ └── vimeo │ └── networking2 │ └── internal │ └── interceptor │ ├── SafeObjectAdapterTest.kt │ └── UserAgentHeaderInterceptorTest.kt ├── auth ├── README.md ├── build.gradle ├── detekt_baseline.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── vimeo │ │ └── networking2 │ │ ├── Authenticator.kt │ │ └── internal │ │ ├── AccountStoringVimeoCallback.kt │ │ ├── AuthService.kt │ │ ├── AuthUtils.kt │ │ ├── AuthenticatorImpl.kt │ │ ├── MutableAuthenticatorDelegate.kt │ │ └── NoOpAuthenticatorImpl.kt │ └── test │ └── java │ └── com │ └── vimeo │ └── networking2 │ └── internal │ ├── AuthenticatorImplTest.kt │ ├── MutableAuthenticatorDelegateTest.kt │ └── NoOpAuthenticatorImplTest.kt ├── build.gradle ├── detekt.yml ├── detekt_configuration.gradle ├── example ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── vimeo │ │ └── example │ │ ├── MainActivity.kt │ │ └── Validator.kt │ └── res │ ├── drawable-v24 │ └── ic_launcher_foreground.xml │ ├── drawable │ └── ic_launcher_background.xml │ ├── layout │ └── activity_main.xml │ ├── mipmap-anydpi-v26 │ ├── ic_launcher.xml │ └── ic_launcher_round.xml │ ├── mipmap-hdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ └── values │ ├── colors.xml │ ├── strings.xml │ └── styles.xml ├── fastlane ├── Appfile ├── Fastfile ├── Pluginfile └── README.md ├── gradle.properties ├── gradle ├── libs.versions.toml └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── jitpack.yml ├── model-generator ├── README.md ├── detekt_baseline.xml ├── integrations │ ├── models-input │ │ ├── .gitignore │ │ ├── build.gradle │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── vimeo │ │ │ └── networking2 │ │ │ ├── annotation │ │ │ ├── AnnotatedAnnotation.kt │ │ │ ├── BasicAnnotation.kt │ │ │ ├── InternalAnnotation.kt │ │ │ ├── ParametersAnnotation.kt │ │ │ └── PrivateAnnotation.kt │ │ │ ├── data │ │ │ ├── AnnotatedDataClass.kt │ │ │ ├── BasicDataClass.kt │ │ │ ├── DefaultValuesDataClass.kt │ │ │ ├── FunctionDataClass.kt │ │ │ ├── InternalDataClass.kt │ │ │ ├── MultipleSupersDataClass.kt │ │ │ ├── ParameterizedDataClass.kt │ │ │ ├── ParameterizedSuperDataClass.kt │ │ │ ├── PrivateDataClass.kt │ │ │ ├── PropertyDataClass.kt │ │ │ └── SecondaryConstructorDataClass.kt │ │ │ ├── enums │ │ │ ├── AnnotatedEnum.kt │ │ │ ├── BasicEnum.kt │ │ │ ├── DefaultValueEnum.kt │ │ │ ├── InternalEnum.kt │ │ │ ├── ParameterizedSuperEnum.kt │ │ │ ├── PrivateEnum.kt │ │ │ ├── SuperEnum.kt │ │ │ └── ValueContainingEnum.kt │ │ │ ├── functions │ │ │ ├── AnnotatedFunctionContainer.kt │ │ │ ├── BasicFunctionContainer.kt │ │ │ ├── ExtensionFunctionContainer.kt │ │ │ ├── GenericFunctionContainer.kt │ │ │ ├── InlineFunctionContainer.kt │ │ │ ├── InternalFunctionContainer.kt │ │ │ ├── PrivateFunctionContainer.kt │ │ │ └── ReifiedFunctionContainer.kt │ │ │ ├── interfaces │ │ │ ├── AnnotatedInterface.kt │ │ │ ├── BasicInterface.kt │ │ │ ├── DefaultMethodInterface.kt │ │ │ ├── FunctionInterface.kt │ │ │ ├── InternalInterface.kt │ │ │ ├── MultipleSupersInterface.kt │ │ │ ├── ParameterizedInterface.kt │ │ │ ├── ParameterizedSuperInterface.kt │ │ │ └── PrivateInterface.kt │ │ │ └── properties │ │ │ ├── AnnotatedPropertyContainer.kt │ │ │ ├── BasicPropertyContainer.kt │ │ │ ├── ExtensionPropertyContainer.kt │ │ │ ├── InlinePropertyContainer.kt │ │ │ ├── InternalPropertyContainer.kt │ │ │ └── PrivatePropertyContainer.kt │ └── models-output │ │ ├── .gitignore │ │ ├── build.gradle │ │ └── src │ │ └── test │ │ └── java │ │ └── com │ │ └── vimeo │ │ └── networking2 │ │ ├── AnnotationModelTest.kt │ │ ├── DataClassModelsTest.kt │ │ ├── EnumModelsTest.kt │ │ ├── FunctionTests.kt │ │ ├── InterfaceModelsTest.kt │ │ ├── PropertiesTest.kt │ │ └── TestExtensions.kt └── plugin │ ├── .gitignore │ ├── build.gradle │ ├── detekt_baseline.xml │ ├── settings.gradle │ └── src │ └── main │ └── java │ └── com │ └── vimeo │ └── modelgenerator │ ├── GenerateModelsExtension.kt │ ├── GenerateModelsPlugin.kt │ ├── ModelFactory.kt │ ├── PsiToPoetHelpers.kt │ ├── extensions │ ├── KotlinPoetExtensions.kt │ └── PsiExtensions.kt │ ├── tasks │ └── GenerateModelsTask.kt │ └── visitor │ ├── ModifyVisitor.kt │ ├── ParcelableClassVisitor.kt │ ├── ParcelableInterfaceVisitor.kt │ ├── SerializableClassVisitor.kt │ └── SerializableInterfaceVisitor.kt ├── models-annotations ├── .gitignore ├── build.gradle └── src │ └── main │ └── java │ └── com │ └── vimeo │ └── networking2 │ └── annotations │ ├── Iso8601NoMillis.kt │ ├── RichTextString.kt │ ├── SafeObject.kt │ └── Time.kt ├── models-parcelable ├── .gitignore ├── build.gradle ├── consumer-rules.pro ├── proguard-rules.pro └── src │ ├── main │ └── AndroidManifest.xml │ └── test │ └── java │ └── com │ └── vimeo │ └── networking2 │ └── ModelTest.kt ├── models-serializable ├── .gitignore ├── build.gradle └── src │ └── test │ └── java │ └── com │ └── vimeo │ └── networking2 │ └── ModelTest.kt ├── models ├── build.gradle ├── detekt_baseline.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── vimeo │ │ └── networking2 │ │ ├── AbstractComment.kt │ │ ├── AccessGrant.kt │ │ ├── AccessTokenProvider.kt │ │ ├── AddSubfolderInteraction.kt │ │ ├── Album.kt │ │ ├── AlbumConnections.kt │ │ ├── AlbumEmbed.kt │ │ ├── AlbumInteractions.kt │ │ ├── AlbumList.kt │ │ ├── AlbumPrivacy.kt │ │ ├── ApiConfiguration.kt │ │ ├── ApiError.kt │ │ ├── App.kt │ │ ├── AppConfiguration.kt │ │ ├── BasicConnection.kt │ │ ├── BasicInteraction.kt │ │ ├── Billing.kt │ │ ├── BuyInteraction.kt │ │ ├── Capabilities.kt │ │ ├── Category.kt │ │ ├── CategoryConnections.kt │ │ ├── CategoryInteractions.kt │ │ ├── CategoryList.kt │ │ ├── Channel.kt │ │ ├── ChannelConnections.kt │ │ ├── ChannelFollowInteraction.kt │ │ ├── ChannelInteractions.kt │ │ ├── ChannelList.kt │ │ ├── Chapter.kt │ │ ├── ChapterList.kt │ │ ├── CinemaConnections.kt │ │ ├── Comment.kt │ │ ├── CommentConnections.kt │ │ ├── CommentList.kt │ │ ├── ConnectedApp.kt │ │ ├── ConnectedAppInteraction.kt │ │ ├── ConnectedAppList.kt │ │ ├── ConnectedScopes.kt │ │ ├── Coordinates.kt │ │ ├── Credit.kt │ │ ├── CustomDomains.kt │ │ ├── DashVideoFile.kt │ │ ├── DefaultConnection.kt │ │ ├── Document.kt │ │ ├── DownloadableVideoFile.kt │ │ ├── Drm.kt │ │ ├── EditSession.kt │ │ ├── Email.kt │ │ ├── EmbedButtons.kt │ │ ├── EmbedTitle.kt │ │ ├── FacebookConfiguration.kt │ │ ├── FacetOption.kt │ │ ├── FeaturedContent.kt │ │ ├── FeaturesConfiguration.kt │ │ ├── FeedItem.kt │ │ ├── FeedItemConnections.kt │ │ ├── FeedList.kt │ │ ├── FileTransferPage.kt │ │ ├── Folder.kt │ │ ├── FolderAncestorConnection.kt │ │ ├── FolderConnections.kt │ │ ├── FolderInteractions.kt │ │ ├── FolderList.kt │ │ ├── FolderPrivacy.kt │ │ ├── FollowInteraction.kt │ │ ├── Gcs.kt │ │ ├── Group.kt │ │ ├── GroupConnections.kt │ │ ├── GroupFollowInteraction.kt │ │ ├── GroupInteractions.kt │ │ ├── GroupPrivacy.kt │ │ ├── HlsVideoFile.kt │ │ ├── InvalidParameter.kt │ │ ├── Lifetime.kt │ │ ├── LikeInteraction.kt │ │ ├── Live.kt │ │ ├── LiveChat.kt │ │ ├── LiveChatConfiguration.kt │ │ ├── LiveConfiguration.kt │ │ ├── LiveEvent.kt │ │ ├── LiveEventConnections.kt │ │ ├── LiveEventCustomLogo.kt │ │ ├── LiveEventEmbed.kt │ │ ├── LiveEventEmbedProperties.kt │ │ ├── LiveEventInteractions.kt │ │ ├── LiveEventList.kt │ │ ├── LiveEventLogoInfo.kt │ │ ├── LiveHeartbeat.kt │ │ ├── LiveHeartbeatConfiguration.kt │ │ ├── LiveQuota.kt │ │ ├── LiveStats.kt │ │ ├── LiveStatsViewers.kt │ │ ├── LiveStreamsQuota.kt │ │ ├── LiveTime.kt │ │ ├── LiveVideoConnection.kt │ │ ├── Membership.kt │ │ ├── Metadata.kt │ │ ├── MetadataConnections.kt │ │ ├── MetadataInteractions.kt │ │ ├── Note.kt │ │ ├── NoteList.kt │ │ ├── NoteStatus.kt │ │ ├── Notification.kt │ │ ├── NotificationConnection.kt │ │ ├── NotificationList.kt │ │ ├── NotificationSubscriptions.kt │ │ ├── NotificationTypeCount.kt │ │ ├── Paging.kt │ │ ├── Periodic.kt │ │ ├── PermissionActions.kt │ │ ├── PermissionPolicy.kt │ │ ├── PermissionPolicyList.kt │ │ ├── Picture.kt │ │ ├── PictureCollection.kt │ │ ├── PinCodeInfo.kt │ │ ├── PlatformConstraint.kt │ │ ├── Play.kt │ │ ├── PlayProgress.kt │ │ ├── Preferences.kt │ │ ├── Privacy.kt │ │ ├── Product.kt │ │ ├── ProductInteractions.kt │ │ ├── ProductList.kt │ │ ├── ProgrammedCinemaItem.kt │ │ ├── ProgrammedCinemaItemList.kt │ │ ├── ProgressiveVideoFile.kt │ │ ├── ProjectItem.kt │ │ ├── ProjectItemList.kt │ │ ├── ProjectItemMeta.kt │ │ ├── Publish.kt │ │ ├── PublishJob.kt │ │ ├── PublishJobAttempts.kt │ │ ├── PublishJobBlockers.kt │ │ ├── PublishJobConnection.kt │ │ ├── PublishJobConstraints.kt │ │ ├── PublishJobDestination.kt │ │ ├── PublishJobDestinations.kt │ │ ├── PublishOptionItem.kt │ │ ├── PurchaseInteraction.kt │ │ ├── PurchaseOnDemandInteraction.kt │ │ ├── Quota.kt │ │ ├── Recommendation.kt │ │ ├── RecommendationList.kt │ │ ├── RentInteraction.kt │ │ ├── ReportInteraction.kt │ │ ├── ReviewPage.kt │ │ ├── SearchFacet.kt │ │ ├── SearchFacetCollection.kt │ │ ├── SearchResult.kt │ │ ├── SearchResultList.kt │ │ ├── Season.kt │ │ ├── SeasonConnections.kt │ │ ├── SeasonInteractions.kt │ │ ├── SeasonList.kt │ │ ├── Space.kt │ │ ├── Spatial.kt │ │ ├── SsoConnection.kt │ │ ├── SsoConnectionInteractions.kt │ │ ├── SsoDomain.kt │ │ ├── StreamPrivacy.kt │ │ ├── Subscription.kt │ │ ├── SubscriptionInteraction.kt │ │ ├── SubscriptionRenewal.kt │ │ ├── SubscriptionTrial.kt │ │ ├── Subscriptions.kt │ │ ├── SurveyQuestion.kt │ │ ├── SurveyResponseChoice.kt │ │ ├── Tag.kt │ │ ├── Team.kt │ │ ├── TeamBranding.kt │ │ ├── TeamEntity.kt │ │ ├── TeamEntityDisplayOptions.kt │ │ ├── TeamGroup.kt │ │ ├── TeamGroupConnections.kt │ │ ├── TeamList.kt │ │ ├── TeamMembersConnection.kt │ │ ├── TeamMembership.kt │ │ ├── TeamMembershipConnections.kt │ │ ├── TeamMembershipList.kt │ │ ├── TeamOwnerConnection.kt │ │ ├── TeamPermission.kt │ │ ├── TeamPermissionCurrentPermissions.kt │ │ ├── TeamPermissionInteraction.kt │ │ ├── TeamPermissionList.kt │ │ ├── TeamToken.kt │ │ ├── TextTrack.kt │ │ ├── TextTrackList.kt │ │ ├── Transcode.kt │ │ ├── TrialEligibility.kt │ │ ├── TvodItem.kt │ │ ├── TvodItemConnections.kt │ │ ├── TvodItemList.kt │ │ ├── Upload.kt │ │ ├── UploadQuota.kt │ │ ├── User.kt │ │ ├── UserBadge.kt │ │ ├── UserConnections.kt │ │ ├── UserInteractions.kt │ │ ├── UserList.kt │ │ ├── UserSegmentSurvey.kt │ │ ├── UserSegmentSurveyList.kt │ │ ├── Video.kt │ │ ├── VideoBadge.kt │ │ ├── VideoBadges.kt │ │ ├── VideoConnections.kt │ │ ├── VideoContainer.kt │ │ ├── VideoContext.kt │ │ ├── VideoEmbed.kt │ │ ├── VideoInteractions.kt │ │ ├── VideoList.kt │ │ ├── VideoLog.kt │ │ ├── VideoSeasonConnection.kt │ │ ├── VideoSourceFile.kt │ │ ├── VideoStats.kt │ │ ├── VideoStatus.kt │ │ ├── VideosPreference.kt │ │ ├── VideosTvodItemConnection.kt │ │ ├── VimeoAccount.kt │ │ ├── WatchLaterInteraction.kt │ │ ├── WatchedInteraction.kt │ │ ├── Webinar.kt │ │ ├── Website.kt │ │ ├── annotations │ │ └── Internal.kt │ │ ├── common │ │ ├── Connection.kt │ │ ├── Entity.kt │ │ ├── Followable.kt │ │ ├── FollowableInteractions.kt │ │ ├── Interaction.kt │ │ ├── LoggingVideoFile.kt │ │ ├── Page.kt │ │ ├── Pageable.kt │ │ ├── StorageQuota.kt │ │ ├── UpdatableInteraction.kt │ │ └── VideoFile.kt │ │ ├── enums │ │ ├── AccountType.kt │ │ ├── AlbumLayoutType.kt │ │ ├── AlbumThemeType.kt │ │ ├── AlbumViewPrivacyType.kt │ │ ├── ApiOptionsType.kt │ │ ├── ApproachType.kt │ │ ├── AttributionType.kt │ │ ├── BillingPeriodType.kt │ │ ├── BillingStatusType.kt │ │ ├── BlockerType.kt │ │ ├── CommentPrivacyType.kt │ │ ├── CommentType.kt │ │ ├── ConnectedAppType.kt │ │ ├── ContentFilterType.kt │ │ ├── DownloadType.kt │ │ ├── EditSessionStatusType.kt │ │ ├── EmbedPrivacyType.kt │ │ ├── EnumExtensions.kt │ │ ├── ErrorCodeType.kt │ │ ├── FolderViewPrivacyType.kt │ │ ├── FollowType.kt │ │ ├── GroupForumsPrivacyType.kt │ │ ├── GroupPrivacyType.kt │ │ ├── LicenseType.kt │ │ ├── LiveQuotaStatusType.kt │ │ ├── LiveStatusType.kt │ │ ├── NotificationType.kt │ │ ├── PictureType.kt │ │ ├── PlaylistSortType.kt │ │ ├── ProgrammedContentItemType.kt │ │ ├── ProjectItemType.kt │ │ ├── PublishStatusType.kt │ │ ├── PurchaseStatusType.kt │ │ ├── RecommendationType.kt │ │ ├── ScheduleType.kt │ │ ├── SearchType.kt │ │ ├── SeasonType.kt │ │ ├── SlackLanguagePreferenceType.kt │ │ ├── SlackUserPreferenceType.kt │ │ ├── SortType.kt │ │ ├── SpatialProjectionType.kt │ │ ├── StereoFormatType.kt │ │ ├── StreamAccessType.kt │ │ ├── SurveyQuestionType.kt │ │ ├── TeamEntityType.kt │ │ ├── TeamInviteStatusType.kt │ │ ├── TeamRoleType.kt │ │ ├── TextTrackType.kt │ │ ├── TranscodeStatusType.kt │ │ ├── TrialStatusType.kt │ │ ├── TvodItemType.kt │ │ ├── UploadQuotaPeriodType.kt │ │ ├── UploadQuotaUnitType.kt │ │ ├── UploadSpaceType.kt │ │ ├── UploadStatusType.kt │ │ ├── UserBadgeType.kt │ │ ├── VideoActionType.kt │ │ ├── VideoBadgeType.kt │ │ ├── VideoPlayStatusType.kt │ │ ├── VideoQualityType.kt │ │ ├── VideoSourceType.kt │ │ ├── VideoStateType.kt │ │ ├── VideoStatusType.kt │ │ ├── ViewPrivacyType.kt │ │ └── Weekday.kt │ │ ├── extensions │ │ └── FollowableExtensions.kt │ │ ├── internal │ │ └── AuthParam.kt │ │ ├── params │ │ ├── AddVideoToAlbum.kt │ │ ├── AddVideoToAlbumContainer.kt │ │ ├── BatchPublishToSocialMedia.kt │ │ ├── DeleteTeamPermissionParams.kt │ │ ├── GrantFolderPermissionForUser.kt │ │ ├── ModifyVideoInAlbumsSpecs.kt │ │ ├── ModifyVideosInAlbumSpecs.kt │ │ ├── PublishToFacebookPost.kt │ │ ├── PublishToLinkedInPost.kt │ │ ├── PublishToTwitterPost.kt │ │ ├── PublishToYouTubePost.kt │ │ ├── PublishToYouTubePrivacyType.kt │ │ ├── RemoveVideoFromAlbum.kt │ │ ├── RemoveVideoFromAlbumContainer.kt │ │ ├── ReplaceTeamPermissionParams.kt │ │ ├── Schedule.kt │ │ ├── SearchDateType.kt │ │ ├── SearchDurationType.kt │ │ ├── SearchFacetType.kt │ │ ├── SearchFilterType.kt │ │ ├── SearchSortDirectionType.kt │ │ └── SearchSortType.kt │ │ └── richtext │ │ ├── Mention.kt │ │ ├── MentionAttrs.kt │ │ ├── RichText.kt │ │ ├── RichTextContainer.kt │ │ ├── RichTextType.kt │ │ ├── Text.kt │ │ └── UnknownRichTextNode.kt │ └── test │ └── java │ └── com │ └── vimeo │ └── networking2 │ ├── ModelsTest.kt │ └── enums │ └── EnumsTest.kt ├── publish.gradle ├── publish_android.gradle ├── request ├── .gitignore ├── build.gradle ├── detekt_baseline.xml └── src │ └── main │ └── java │ └── com │ └── vimeo │ └── networking2 │ ├── VimeoApiClient.kt │ ├── VimeoService.kt │ └── internal │ ├── MutableVimeoApiClientDelegate.kt │ └── VimeoApiClientImpl.kt ├── settings.gradle └── vimeo-networking ├── build.gradle └── detekt_baseline.xml /.githooks/README.md: -------------------------------------------------------------------------------- 1 | # Vimeo-Android Git Hooks 2 | 3 | ## Enabling 4 | 5 | To enable these hooks, run: 6 | 7 | ```bash 8 | git config core.hooksPath .githooks 9 | ``` 10 | 11 | ## Notes 12 | 13 | To make commits without the pre-commit hooks running, use the `-n` (`--no-verify`) flag. 14 | 15 | eg: 16 | ```bash 17 | git commit -n -m "my commit" 18 | ``` 19 | 20 | -------------------------------------------------------------------------------- /.githooks/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # git pre-commit hooks 3 | 4 | # 5 | # Run "detekt" on each commit. Only show output if there is a failure. 6 | # 7 | echo "Running detekt check..." 8 | OUTPUT="/tmp/detekt-$(date +%s)" 9 | ./gradlew detekt > $OUTPUT 10 | EXIT_CODE=$? 11 | if [ $EXIT_CODE -ne 0 ]; then 12 | cat $OUTPUT 13 | rm $OUTPUT 14 | echo "***********************************************" 15 | echo " Detekt failed " 16 | echo " Please fix the above issues before committing " 17 | echo "***********************************************" 18 | exit $EXIT_CODE 19 | fi 20 | rm $OUTPUT 21 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | To [contribute](https://guides.github.com/activities/contributing-to-open-source/) to this project: 2 | 3 | 1. Fork the repo. 4 | 2. Branch off of the default branch and make your changes. 5 | 3. Validate changes by running `gradle test` and ensure that there are no lint warnings by running `gradle detekt`. 6 | 4. Run `gradle detektFormat` to make sure the code is properly formatted. 7 | 5. Pull request back to the default branch, we'll review as soon as we can. 8 | 6. Let us know if you have questions along the way. 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # Summary 2 | A brief but thorough description of the issue. 3 | 4 | ## Reproduction Steps 5 | Detailed steps to reproduce the issue. 6 | 7 | ## Expected Behavior 8 | What do you expect to happen as a result of the reproduction steps? 9 | 10 | ## Actual Behavior 11 | What currently happens as a result of the reproduction steps? 12 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # Summary 2 | A summary of the changes. If applicable, include a link to the issue that this closes. 3 | 4 | ## Description 5 | A brief but thorough description of the changes. 6 | 7 | ## How to Test 8 | Detailed list of what to test and how to test it. 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | */build 2 | build/ 3 | *.iml 4 | *.apk 5 | bin/ 6 | captures/* 7 | gen/ 8 | *.dex 9 | .gradle 10 | /local.properties 11 | .idea/* 12 | /.idea/workspace.xml 13 | /.idea/libraries 14 | .DS_Store 15 | values.xml 16 | 17 | # Code style should be shared 18 | !/.idea/codeStyles 19 | 20 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 21 | fastlane/report.xml 22 | fastlane/Preview.html 23 | fastlane/screenshots 24 | fastlane/test_output 25 | /model-generator/integrations/models-output/ 26 | /models-parcelable/src/main/java/com/vimeo/networking2/ 27 | /models-serializable/src/main/java/com/vimeo/networking2/ 28 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimeo/vimeo-networking-java/e4f31d4fa144756d576101b3a82120657e9e8a51/.gitmodules -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /Dangerfile: -------------------------------------------------------------------------------- 1 | # Print reports for each test result 2 | Dir.glob('vimeo-networking/build/test-results/test/*.xml') do |result| 3 | junit.parse result 4 | junit.report 5 | end -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | gem 'fastlane', '2.129.0' 3 | gem 'danger-junit', '0.7.2' 4 | plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') 5 | eval(File.read(plugins_path), binding) if File.exist?(plugins_path) 6 | -------------------------------------------------------------------------------- /api-core/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java-library' 2 | apply plugin: 'kotlin' 3 | apply from: '../publish.gradle' 4 | 5 | dependencies { 6 | compileOnly project(':models-annotations') 7 | compileOnly project(':models') 8 | 9 | // Retrofit 10 | api libs.retrofit 11 | implementation libs.retrofit.moshi.converter 12 | 13 | // Moshi Adapters 14 | implementation libs.moshi.adapters 15 | 16 | // Okio used by Moshi 17 | implementation libs.okio 18 | 19 | // Test dependencies 20 | testImplementation project(':models-annotations') 21 | testImplementation libs.junit 22 | testImplementation libs.moshi.kotlin 23 | } 24 | 25 | compileKotlin { 26 | kotlinOptions { 27 | jvmTarget = JavaVersion.VERSION_11 28 | } 29 | } 30 | 31 | sourceCompatibility = JavaVersion.VERSION_11 32 | targetCompatibility = JavaVersion.VERSION_11 33 | -------------------------------------------------------------------------------- /api-core/detekt_baseline.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /api-core/src/main/java/com/vimeo/networking2/extensions/VimeoCallbackExtensions.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.extensions 2 | 3 | import com.vimeo.networking2.VimeoCallback 4 | import com.vimeo.networking2.VimeoResponse 5 | 6 | /** 7 | * Transforms callback of type [T] to callback of type [R]. 8 | * @param transformer maps value of type [R] to value of type [T]. 9 | */ 10 | fun VimeoCallback.transform(transformer: (R) -> T): VimeoCallback { 11 | val original = this 12 | return object : VimeoCallback { 13 | override fun onSuccess(response: VimeoResponse.Success) { 14 | original.onSuccess(response.transform(transformer)) 15 | } 16 | 17 | override fun onError(error: VimeoResponse.Error) { 18 | original.onError(error) 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api-core/src/main/java/com/vimeo/networking2/extensions/VimeoResponseExtensions.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.extensions 2 | 3 | import com.vimeo.networking2.VimeoResponse 4 | 5 | /** 6 | * Transforms success response of type [T] to success response of type [R]. 7 | * @param transformer maps value of type [T] to value of type [R]. 8 | */ 9 | fun VimeoResponse.Success.transform(transformer: (T) -> R): VimeoResponse.Success = 10 | VimeoResponse.Success( 11 | transformer(data), 12 | responseOrigin, 13 | httpStatusCode, 14 | ) 15 | -------------------------------------------------------------------------------- /api-core/src/main/java/com/vimeo/networking2/internal/params/IntValueJsonAdapterFactory.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.internal.params 2 | 3 | import com.squareup.moshi.JsonAdapter 4 | import com.squareup.moshi.Moshi 5 | import com.vimeo.networking2.enums.IntValue 6 | import com.vimeo.networking2.enums.Weekday 7 | import java.lang.reflect.Type 8 | 9 | /** 10 | * A [JsonAdapter.Factory] that knows when how to serialize a sub-type of [IntValue]. 11 | */ 12 | class IntValueJsonAdapterFactory : JsonAdapter.Factory { 13 | override fun create(type: Type, annotations: MutableSet, moshi: Moshi): JsonAdapter<*>? = 14 | if (type is Class<*> && IntValue::class.java.isAssignableFrom(type)) { 15 | if (Weekday::class.java.isAssignableFrom(type)) { 16 | IntValueJsonAdapter { value -> Weekday.values().first { it.value == value } } 17 | } else { 18 | IntValueJsonAdapter.NON_READING 19 | } 20 | } else { 21 | null 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api-core/src/main/java/com/vimeo/networking2/internal/params/SafeObjectJsonAdapterFactory.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.internal.params 2 | 3 | import com.squareup.moshi.JsonAdapter 4 | import com.squareup.moshi.Moshi 5 | import com.squareup.moshi.Types 6 | import com.vimeo.networking2.annotations.SafeObject 7 | import com.vimeo.networking2.internal.adapters.SafeObjectAdapter 8 | import java.lang.reflect.Type 9 | 10 | /** 11 | * A [JsonAdapter.Factory] that knows when how to serialize a empty list or object to object type. 12 | */ 13 | class SafeObjectJsonAdapterFactory : JsonAdapter.Factory { 14 | override fun create(type: Type, annotations: MutableSet, moshi: Moshi): JsonAdapter<*>? { 15 | return if (Types.nextAnnotations(annotations, SafeObject::class.java) != null) { 16 | val elementAdapter = moshi.adapter(type) 17 | SafeObjectAdapter(elementAdapter) 18 | } else { 19 | null 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /auth/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java-library' 2 | apply plugin: 'kotlin' 3 | apply from: '../publish.gradle' 4 | 5 | dependencies { 6 | api project(':api-core') 7 | compileOnly project(':models') 8 | 9 | // Test dependencies 10 | testImplementation project(':models') 11 | testImplementation libs.junit 12 | testImplementation libs.mockito 13 | testImplementation libs.mockito.inline 14 | } 15 | 16 | compileKotlin { 17 | kotlinOptions { 18 | jvmTarget = JavaVersion.VERSION_11 19 | } 20 | } 21 | 22 | sourceCompatibility = JavaVersion.VERSION_11 23 | targetCompatibility = JavaVersion.VERSION_11 24 | -------------------------------------------------------------------------------- /auth/detekt_baseline.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /auth/src/test/java/com/vimeo/networking2/internal/NoOpAuthenticatorImplTest.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.internal 2 | 3 | import com.vimeo.networking2.VimeoCallback 4 | import com.vimeo.networking2.account.AccountStore 5 | import com.vimeo.networking2.vimeoCallback 6 | import org.junit.Assert.* 7 | 8 | import org.junit.Test 9 | import org.mockito.Mockito.mock 10 | import org.mockito.kotlin.verifyNoInteractions 11 | 12 | class NoOpAuthenticatorImplTest { 13 | 14 | private val callback: VimeoCallback = vimeoCallback(onSuccess = {}, onError = {}) 15 | private val accountStore = mock(AccountStore::class.java) 16 | 17 | private val authenticator = NoOpAuthenticatorImpl(accountStore) 18 | 19 | @Test(expected = IllegalStateException::class) 20 | fun `logOut throws error`() { 21 | authenticator.logOut(callback) 22 | } 23 | 24 | @Test 25 | fun `logOutLocally does nothing`() { 26 | authenticator.logOutLocally() 27 | verifyNoInteractions(accountStore) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /detekt_configuration.gradle: -------------------------------------------------------------------------------- 1 | detekt { 2 | toolVersion = "1.18.1" 3 | input = files("$projectDir/src/main/java") 4 | config = files("$rootDir/detekt.yml") 5 | baseline = file("$projectDir/detekt_baseline.xml") 6 | failFast = true 7 | parallel = true 8 | } 9 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /example/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | 4 | android { 5 | compileSdkVersion 31 6 | 7 | defaultConfig { 8 | applicationId "com.vimeo.example" 9 | minSdkVersion 23 10 | targetSdkVersion 31 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | 15 | buildTypes { 16 | debug { 17 | minifyEnabled false 18 | } 19 | } 20 | compileOptions { 21 | sourceCompatibility JavaVersion.VERSION_11 22 | targetCompatibility JavaVersion.VERSION_11 23 | } 24 | buildFeatures { 25 | viewBinding true 26 | } 27 | } 28 | 29 | dependencies { 30 | implementation project(':models-parcelable') 31 | implementation project(':vimeo-networking') 32 | 33 | implementation libs.androidx.appcompat 34 | implementation libs.androidx.constraint 35 | } 36 | -------------------------------------------------------------------------------- /example/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /example/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /example/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /example/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimeo/vimeo-networking-java/e4f31d4fa144756d576101b3a82120657e9e8a51/example/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimeo/vimeo-networking-java/e4f31d4fa144756d576101b3a82120657e9e8a51/example/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimeo/vimeo-networking-java/e4f31d4fa144756d576101b3a82120657e9e8a51/example/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimeo/vimeo-networking-java/e4f31d4fa144756d576101b3a82120657e9e8a51/example/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimeo/vimeo-networking-java/e4f31d4fa144756d576101b3a82120657e9e8a51/example/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimeo/vimeo-networking-java/e4f31d4fa144756d576101b3a82120657e9e8a51/example/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimeo/vimeo-networking-java/e4f31d4fa144756d576101b3a82120657e9e8a51/example/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimeo/vimeo-networking-java/e4f31d4fa144756d576101b3a82120657e9e8a51/example/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimeo/vimeo-networking-java/e4f31d4fa144756d576101b3a82120657e9e8a51/example/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimeo/vimeo-networking-java/e4f31d4fa144756d576101b3a82120657e9e8a51/example/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /example/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Vimeo Networking Example 3 | 4 | -------------------------------------------------------------------------------- /example/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /fastlane/Appfile: -------------------------------------------------------------------------------- 1 | json_key_file "" # Path to the json secret file - Follow https://github.com/fastlane/supply#setup to get one 2 | package_name "com.vimeo.example" 3 | -------------------------------------------------------------------------------- /fastlane/Pluginfile: -------------------------------------------------------------------------------- 1 | # Autogenerated by fastlane 2 | # 3 | # Ensure this file is checked in to source control! 4 | 5 | gem 'fastlane-plugin-pretty_junit' 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimeo/vimeo-networking-java/e4f31d4fa144756d576101b3a82120657e9e8a51/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Apr 11 14:29:44 EDT 2022 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /jitpack.yml: -------------------------------------------------------------------------------- 1 | jdk: 2 | - openjdk11 -------------------------------------------------------------------------------- /model-generator/detekt_baseline.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /model-generator/integrations/models-input/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /model-generator/integrations/models-input/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java-library' 2 | apply plugin: 'kotlin' 3 | apply plugin: 'com.google.devtools.ksp' 4 | 5 | 6 | dependencies { 7 | implementation libs.moshi 8 | ksp libs.moshi.codegen 9 | } 10 | 11 | sourceCompatibility = JavaVersion.VERSION_11 12 | targetCompatibility = JavaVersion.VERSION_11 13 | -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/annotation/AnnotatedAnnotation.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.annotation 2 | 3 | @Target(AnnotationTarget.CLASS, AnnotationTarget.PROPERTY) 4 | @Retention(AnnotationRetention.RUNTIME) 5 | @MustBeDocumented 6 | annotation class AnnotatedAnnotation -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/annotation/BasicAnnotation.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.annotation 2 | 3 | annotation class BasicAnnotation -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/annotation/InternalAnnotation.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.annotation 2 | 3 | internal annotation class InternalAnnotation -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/annotation/ParametersAnnotation.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.annotation 2 | 3 | annotation class ParametersAnnotation(val target: String) -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/annotation/PrivateAnnotation.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.annotation 2 | 3 | private annotation class PrivateAnnotation -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/data/AnnotatedDataClass.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.data 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | @JsonClass(generateAdapter = true) 7 | data class AnnotatedDataClass( 8 | @Json(name = "foo") 9 | val foo: String 10 | ) -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/data/BasicDataClass.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.data 2 | 3 | data class BasicDataClass( 4 | val foo: String, 5 | val bar: Long 6 | ) -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/data/DefaultValuesDataClass.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.data 2 | 3 | data class DefaultValuesDataClass( 4 | val foo: String = "foo", 5 | val bar: Long = 100 6 | ) -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/data/FunctionDataClass.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.data 2 | 3 | data class FunctionDataClass(val foo: String) { 4 | 5 | fun doSomething(): String = foo 6 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/data/InternalDataClass.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.data 2 | 3 | internal data class InternalDataClass(private val foo: String) -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/data/MultipleSupersDataClass.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.data 2 | 3 | data class MultipleSupersDataClass(override val foo: String) : Foo, Bar, Baz 4 | 5 | private interface Foo { 6 | val foo: String 7 | } 8 | 9 | private interface Bar 10 | 11 | private interface Baz -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/data/ParameterizedDataClass.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.data 2 | 3 | import java.util.Date 4 | 5 | data class ParameterizedDataClass( 6 | val first: FIRST_TYPE, 7 | val second: SECOND_TYPE, 8 | val third: THIRD_TYPE, 9 | val date: Date? = null 10 | ) -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/data/ParameterizedSuperDataClass.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.data 2 | 3 | 4 | data class ParameterizedSuperDataClass(override val foo: String): MyFoo 5 | 6 | private interface MyFoo { 7 | val foo: TYPE 8 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/data/PrivateDataClass.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.data 2 | 3 | private data class PrivateDataClass(val foo: String) -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/data/PropertyDataClass.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.data 2 | 3 | data class PropertyDataClass(val foo: String, val bar: Long) { 4 | val baz: String = "$foo $bar" 5 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/data/SecondaryConstructorDataClass.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.data 2 | 3 | import java.util.Date 4 | 5 | data class SecondaryConstructorDataClass(val foo: String, val date: Date) { 6 | constructor(date: Date) : this("foo", date) 7 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/enums/AnnotatedEnum.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.enums 2 | 3 | @Deprecated("Use other Enum") 4 | enum class AnnotatedEnum { 5 | @Deprecated("Use BAR") 6 | FOO, 7 | BAR 8 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/enums/BasicEnum.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.enums 2 | 3 | enum class BasicEnum { FOO, BAR } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/enums/DefaultValueEnum.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.enums 2 | 3 | enum class DefaultValueEnum(val value: String = "value") { FOO, BAR } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/enums/InternalEnum.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.enums 2 | 3 | internal enum class InternalEnum { FOO, BAR } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/enums/ParameterizedSuperEnum.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.enums 2 | 3 | enum class ParameterizedSuperEnum(override val value: String): Container { 4 | FOO("foo"), 5 | BAR("bar") 6 | } 7 | 8 | interface Container{ 9 | val value: TYPE 10 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/enums/PrivateEnum.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.enums 2 | 3 | private enum class PrivateEnum { FOO, BAR } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/enums/SuperEnum.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.enums 2 | 3 | enum class SuperEnum(override val foo: Long) : FooContainer, Foo, Bar { 4 | FOO(100L), 5 | BAR(10L) 6 | } 7 | 8 | 9 | interface FooContainer { 10 | val foo: Long 11 | } 12 | 13 | interface Foo 14 | interface Bar -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/enums/ValueContainingEnum.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.enums 2 | 3 | enum class ValueContainingEnum(val foo: String) { 4 | FOO("foo"), 5 | BAR("bar") 6 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/functions/AnnotatedFunctionContainer.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.functions 2 | 3 | class AnnotatedFunctionContainer { 4 | 5 | @Deprecated("Use something else") 6 | fun doSomething() { 7 | println("Hello World") 8 | } 9 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/functions/BasicFunctionContainer.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.functions 2 | 3 | class BasicFunctionContainer { 4 | fun basicFunction(): String = "Hello World" 5 | } 6 | -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/functions/ExtensionFunctionContainer.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.functions 2 | 3 | 4 | class ExtensionFunctionContainer { 5 | fun String.doSomething(): String = this.doSomething() 6 | } 7 | 8 | -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/functions/GenericFunctionContainer.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.functions 2 | 3 | 4 | class GenericFunctionContainer { 5 | fun doSomething(value: T): String = "foo" 6 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/functions/InlineFunctionContainer.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.functions 2 | 3 | 4 | class InlineFunctionContainer { 5 | inline fun inlineFunction(onClick: () -> Unit) { 6 | onClick() 7 | } 8 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/functions/InternalFunctionContainer.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.functions 2 | 3 | class InternalFunctionContainer { 4 | internal fun internalFunction(): String = "Hello World" 5 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/functions/PrivateFunctionContainer.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.functions 2 | 3 | class PrivateFunctionContainer { 4 | private fun privateFunction(): String = "Hello World" 5 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/functions/ReifiedFunctionContainer.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.functions 2 | 3 | 4 | class ReifiedFunctionContainer { 5 | // Cast to String to avoid issues with platform types 6 | inline fun reifiedFunction(): String = T::class.java.simpleName as String 7 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/interfaces/AnnotatedInterface.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.interfaces 2 | 3 | @Deprecated("This is no longer used") 4 | interface AnnotatedInterface -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/interfaces/BasicInterface.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.interfaces 2 | 3 | interface BasicInterface { 4 | val foo: String 5 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/interfaces/DefaultMethodInterface.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.interfaces 2 | 3 | interface DefaultMethodInterface { 4 | 5 | fun doSomething(): String = "Foo" 6 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/interfaces/FunctionInterface.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.interfaces 2 | 3 | interface FunctionInterface { 4 | 5 | fun doSomething(foo: String) 6 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/interfaces/InternalInterface.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.interfaces 2 | 3 | internal interface InternalInterface { 4 | val foo: String 5 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/interfaces/MultipleSupersInterface.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.interfaces 2 | 3 | interface MultipleSupersInterface: Foo, Bar, Baz 4 | 5 | 6 | interface Foo 7 | interface Bar 8 | interface Baz -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/interfaces/ParameterizedInterface.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.interfaces 2 | 3 | interface ParameterizedInterface { 4 | val foo: List 5 | val bar: SECOND_TYPE 6 | val baz: Map 7 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/interfaces/ParameterizedSuperInterface.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.interfaces 2 | 3 | interface ParameterizedSuperInterface: MyFoo 4 | 5 | 6 | interface MyFoo -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/interfaces/PrivateInterface.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.interfaces 2 | 3 | private interface PrivateInterface { 4 | val foo: String 5 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/properties/AnnotatedPropertyContainer.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.properties 2 | 3 | class AnnotatedPropertyContainer { 4 | @Deprecated("Use bar instead") 5 | val foo: String = "foo" 6 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/properties/BasicPropertyContainer.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.properties 2 | 3 | class BasicPropertyContainer { 4 | val foo: String = "foo" 5 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/properties/ExtensionPropertyContainer.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.properties 2 | 3 | class ExtensionPropertyContainer { 4 | val String.doSomething: String 5 | get() = this.toString() 6 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/properties/InlinePropertyContainer.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.properties 2 | 3 | class InlinePropertyContainer { 4 | 5 | val foo: String 6 | // Avoid platform types by casting to String 7 | inline get() = this::class.java.simpleName as String 8 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/properties/InternalPropertyContainer.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.properties 2 | 3 | class InternalPropertyContainer { 4 | internal val foo: String = "foo" 5 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-input/src/main/java/com/vimeo/networking2/properties/PrivatePropertyContainer.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.properties 2 | 3 | class PrivatePropertyContainer { 4 | private val foo: String = "foo" 5 | } -------------------------------------------------------------------------------- /model-generator/integrations/models-output/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /model-generator/integrations/models-output/build.gradle: -------------------------------------------------------------------------------- 1 | import com.vimeo.modelgenerator.ModelType 2 | 3 | plugins { 4 | id 'java-library' 5 | id 'kotlin' 6 | id 'com.google.devtools.ksp' 7 | id 'model.generator' 8 | } 9 | 10 | generated { 11 | inputPath = "model-generator/integrations/models-input/src/main/java/com/vimeo/networking2" 12 | typeGenerated = ModelType.SERIALIZABLE 13 | } 14 | 15 | dependencies { 16 | implementation libs.moshi 17 | ksp libs.moshi.codegen 18 | 19 | testImplementation libs.junit 20 | testImplementation libs.kotlin.reflect 21 | testImplementation libs.assertj 22 | testImplementation libs.classgraph 23 | testImplementation libs.podam 24 | } 25 | 26 | sourceCompatibility = JavaVersion.VERSION_11 27 | targetCompatibility = JavaVersion.VERSION_11 28 | -------------------------------------------------------------------------------- /model-generator/integrations/models-output/src/test/java/com/vimeo/networking2/TestExtensions.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import kotlin.reflect.KClass 4 | 5 | /** 6 | * Finds the the corresponding class to the given [simpleName] 7 | */ 8 | fun List>.findModel(simpleName: String): KClass<*>? = 9 | this.firstOrNull { it.simpleName == simpleName } -------------------------------------------------------------------------------- /model-generator/plugin/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /model-generator/plugin/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | alias(libs.plugins.kotlin) 3 | alias(libs.plugins.detekt) 4 | id 'java-gradle-plugin' 5 | } 6 | 7 | dependencies { 8 | implementation libs.kotlin.gradle.plugin.api 9 | implementation libs.kotlin.compiler.embeddable 10 | implementation libs.kotlin.android.extensions 11 | 12 | implementation libs.kotlinpoet 13 | implementation libs.moshi.kotlin 14 | } 15 | 16 | sourceCompatibility = JavaVersion.VERSION_11 17 | targetCompatibility = JavaVersion.VERSION_11 18 | 19 | gradlePlugin { 20 | plugins { 21 | create('com.vimeo.modelgenerator.GenerateModelsPlugin') { 22 | id = 'model.generator' 23 | implementationClass = 'com.vimeo.modelgenerator.GenerateModelsPlugin' 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /model-generator/plugin/detekt_baseline.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /model-generator/plugin/settings.gradle: -------------------------------------------------------------------------------- 1 | dependencyResolutionManagement { 2 | versionCatalogs { 3 | libs { 4 | from(files("../../gradle/libs.versions.toml")) 5 | } 6 | } 7 | repositories { 8 | mavenCentral() 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /model-generator/plugin/src/main/java/com/vimeo/modelgenerator/GenerateModelsExtension.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.modelgenerator 2 | 3 | import org.gradle.api.Project 4 | 5 | /** 6 | * Extension object that is used to configure the [GenerateModelsPlugin]. 7 | */ 8 | open class GenerateModelsExtension(private val project: Project) { 9 | 10 | /** 11 | * A file path to the base models that will be use to generate new models. 12 | */ 13 | open var inputPath: String? = null 14 | 15 | /** 16 | * The specific type of models that will be generated. 17 | */ 18 | open var typeGenerated: ModelType? = null 19 | } 20 | 21 | /** 22 | * The supported types of models that can be generated. 23 | */ 24 | enum class ModelType { 25 | 26 | /** 27 | * Generates models that support [java.io.Serializable]. 28 | */ 29 | SERIALIZABLE, 30 | 31 | /** 32 | * Generates models that support [android.os.Parcelable]. 33 | */ 34 | PARCELABLE 35 | } 36 | -------------------------------------------------------------------------------- /model-generator/plugin/src/main/java/com/vimeo/modelgenerator/visitor/ModifyVisitor.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.modelgenerator.visitor 2 | 3 | import com.squareup.kotlinpoet.TypeSpec 4 | import org.jetbrains.kotlin.psi.KtClass 5 | 6 | /** 7 | * A base interface for the Visitor pattern for modifying a [TypeSpec.Builder]. 8 | * 9 | * Classes that implement this can use it to add specific behavior to the [TypeSpec.Builder]. 10 | */ 11 | interface ModifyVisitor { 12 | 13 | /** 14 | * A function to make changes to a given [TypeSpec.Builder]. 15 | * 16 | * @param builder a [TypeSpec.Builder] that can be modified and returned. 17 | * @param clazz a [KtClass] that can be used to pull extra information for the [TypeSpec.Builder]. 18 | * @param packageName the package of the given [KtClass], 19 | */ 20 | fun modify(builder: TypeSpec.Builder, clazz: KtClass, packageName: String): TypeSpec.Builder 21 | } -------------------------------------------------------------------------------- /model-generator/plugin/src/main/java/com/vimeo/modelgenerator/visitor/ParcelableInterfaceVisitor.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.modelgenerator.visitor 2 | 3 | import com.squareup.kotlinpoet.TypeSpec 4 | import org.jetbrains.kotlin.psi.KtClass 5 | 6 | 7 | /** 8 | * [ModifyVisitor] for [android.os.Parcelable] code additions. 9 | * 10 | * This adds [android.os.Parcelable] as a super to interfaces. 11 | */ 12 | class ParcelableInterfaceVisitor : ModifyVisitor { 13 | 14 | override fun modify( 15 | builder: TypeSpec.Builder, 16 | clazz: KtClass, 17 | packageName: String 18 | ): TypeSpec.Builder = builder.addSuperinterface(ParcelableClassVisitor.PARCELABLE) 19 | } -------------------------------------------------------------------------------- /model-generator/plugin/src/main/java/com/vimeo/modelgenerator/visitor/SerializableInterfaceVisitor.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.modelgenerator.visitor 2 | 3 | import com.squareup.kotlinpoet.TypeSpec 4 | import org.jetbrains.kotlin.psi.KtClass 5 | import java.io.Serializable 6 | 7 | /** 8 | * No-op visitor that doesn't modify Interfaces when [com.vimeo.modelgenerator.ModelType.SERIALIZABLE] 9 | * is selected. 10 | */ 11 | class SerializableInterfaceVisitor: ModifyVisitor { 12 | 13 | override fun modify( 14 | builder: TypeSpec.Builder, 15 | clazz: KtClass, 16 | packageName: String 17 | ): TypeSpec.Builder = builder.addSuperinterface(Serializable::class) 18 | } 19 | -------------------------------------------------------------------------------- /models-annotations/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /models-annotations/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'kotlin' 2 | apply plugin: 'com.google.devtools.ksp' 3 | apply from: '../publish.gradle' 4 | 5 | dependencies { 6 | // Moshi 7 | ksp libs.moshi.codegen 8 | implementation libs.moshi 9 | 10 | // Test dependencies 11 | testImplementation libs.junit 12 | testImplementation libs.kotlin.reflect 13 | } 14 | 15 | compileKotlin { 16 | kotlinOptions { 17 | jvmTarget = JavaVersion.VERSION_11 18 | } 19 | } 20 | 21 | sourceCompatibility = JavaVersion.VERSION_11 22 | targetCompatibility = JavaVersion.VERSION_11 23 | -------------------------------------------------------------------------------- /models-annotations/src/main/java/com/vimeo/networking2/annotations/Iso8601NoMillis.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.annotations 2 | 3 | import com.squareup.moshi.JsonQualifier 4 | 5 | @Retention(AnnotationRetention.RUNTIME) 6 | @JsonQualifier 7 | annotation class Iso8601NoMillis 8 | -------------------------------------------------------------------------------- /models-annotations/src/main/java/com/vimeo/networking2/annotations/RichTextString.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.annotations 2 | 3 | import com.squareup.moshi.JsonQualifier 4 | 5 | @Retention(AnnotationRetention.RUNTIME) 6 | @JsonQualifier 7 | annotation class RichTextString 8 | -------------------------------------------------------------------------------- /models-annotations/src/main/java/com/vimeo/networking2/annotations/SafeObject.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.annotations 2 | 3 | import com.squareup.moshi.JsonQualifier 4 | 5 | @Retention 6 | @JsonQualifier 7 | annotation class SafeObject 8 | -------------------------------------------------------------------------------- /models-annotations/src/main/java/com/vimeo/networking2/annotations/Time.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2.annotations 2 | 3 | import com.squareup.moshi.JsonQualifier 4 | 5 | @Retention(AnnotationRetention.RUNTIME) 6 | @JsonQualifier 7 | annotation class Time 8 | -------------------------------------------------------------------------------- /models-parcelable/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /models-parcelable/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vimeo/vimeo-networking-java/e4f31d4fa144756d576101b3a82120657e9e8a51/models-parcelable/consumer-rules.pro -------------------------------------------------------------------------------- /models-parcelable/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /models-parcelable/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /models-serializable/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /models-serializable/build.gradle: -------------------------------------------------------------------------------- 1 | import com.vimeo.modelgenerator.ModelType 2 | 3 | plugins { 4 | id 'kotlin' 5 | id 'com.google.devtools.ksp' 6 | id 'model.generator' 7 | } 8 | 9 | apply from: '../publish.gradle' 10 | 11 | generated { 12 | inputPath = 'models/src/main/java/com/vimeo/networking2' 13 | typeGenerated = ModelType.SERIALIZABLE 14 | } 15 | 16 | dependencies { 17 | implementation project(':models-annotations') 18 | 19 | implementation libs.moshi 20 | ksp libs.moshi.codegen 21 | 22 | testImplementation libs.junit 23 | testImplementation libs.assertj 24 | testImplementation libs.classgraph 25 | testImplementation libs.podam 26 | testImplementation libs.robolectric 27 | } 28 | 29 | sourceCompatibility = JavaVersion.VERSION_11 30 | targetCompatibility = JavaVersion.VERSION_11 31 | -------------------------------------------------------------------------------- /models/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'kotlin' 2 | apply plugin: 'com.google.devtools.ksp' 3 | apply from: '../publish.gradle' 4 | 5 | dependencies { 6 | implementation project(':models-annotations') 7 | 8 | // Okio used by Moshi 9 | implementation libs.okio 10 | 11 | // Moshi 12 | ksp libs.moshi.codegen 13 | implementation libs.moshi 14 | 15 | // Test dependencies 16 | testImplementation libs.junit 17 | testImplementation libs.kotlin.reflect 18 | } 19 | 20 | compileKotlin { 21 | kotlinOptions { 22 | jvmTarget = JavaVersion.VERSION_11 23 | } 24 | } 25 | 26 | sourceCompatibility = JavaVersion.VERSION_11 27 | targetCompatibility = JavaVersion.VERSION_11 28 | -------------------------------------------------------------------------------- /models/detekt_baseline.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/AbstractComment.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.vimeo.networking2.common.Entity 4 | import java.util.Date 5 | 6 | /** 7 | * Sealed interface for comment/note entities. 8 | */ 9 | sealed interface AbstractComment : Entity { 10 | 11 | /** 12 | * The URI of this comment. 13 | */ 14 | val uri: String? 15 | 16 | /** 17 | * The time in ISO 8601 format when the comment was posted. 18 | */ 19 | val createdOn: Date? 20 | 21 | /** 22 | * The resource key string for the comment. 23 | */ 24 | val resourceKey: String? 25 | 26 | /** 27 | * The content of the comment. 28 | */ 29 | val text: String? 30 | 31 | /** 32 | * The user who posted the comment. 33 | */ 34 | val user: User? 35 | 36 | override val identifier: String? get() = resourceKey 37 | } 38 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/AccessGrant.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * The access granted to a team member in a folder. 8 | * 9 | * @param folder The folder with the largest scope to which the user has been granted access. 10 | * @param permissionPolicy The permissions that have been 11 | */ 12 | @JsonClass(generateAdapter = true) 13 | data class AccessGrant( 14 | @Json(name = "folder") 15 | val folder: Folder? = null, 16 | 17 | @Json(name = "permission_policy") 18 | val permissionPolicy: PermissionPolicy? = null 19 | ) 20 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/AccessTokenProvider.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | /** 4 | * All type of authentication flows will provide an access token. 5 | */ 6 | interface AccessTokenProvider { 7 | 8 | /** 9 | * Access token for making requests. 10 | */ 11 | val accessToken: String 12 | } 13 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/AlbumConnections.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * All connections for a album. 8 | * 9 | * @param videos Connection to get all the videos in a album. 10 | * @param availableVideos Connection to get all the logged-in user's available videos that can be added to an album. 11 | */ 12 | @JsonClass(generateAdapter = true) 13 | data class AlbumConnections( 14 | 15 | @Json(name = "videos") 16 | val videos: BasicConnection? = null, 17 | 18 | @Json(name = "available_videos") 19 | val availableVideos: BasicConnection? = null 20 | ) 21 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/AlbumEmbed.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.enums.AlbumViewPrivacyType 6 | 7 | /** 8 | * Embed data for a album. 9 | * 10 | * @param html The responsive HTML code to embed the playlist on a website. This is present only when 11 | * [AlbumPrivacy.viewPrivacyType] is not [AlbumViewPrivacyType.PASSWORD] and when the album has embeddable clips. 12 | */ 13 | @JsonClass(generateAdapter = true) 14 | data class AlbumEmbed( 15 | 16 | @Json(name = "html") 17 | val html: String? = null 18 | ) 19 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/AlbumList.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Pageable 6 | 7 | /** 8 | * List of albums that could be paged. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class AlbumList( 12 | 13 | @Json(name = "total") 14 | override val total: Int? = null, 15 | 16 | @Json(name = "page") 17 | override val page: Int? = null, 18 | 19 | @Json(name = "per_page") 20 | override val perPage: Int? = null, 21 | 22 | @Json(name = "paging") 23 | override val paging: Paging? = null, 24 | 25 | @Json(name = "data") 26 | override val data: List? = null, 27 | 28 | @Json(name = "filtered_total") 29 | override val filteredTotal: Int? = null 30 | ) : Pageable 31 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/AlbumPrivacy.kt: -------------------------------------------------------------------------------- 1 | @file:JvmName("AlbumPrivacyUtils") 2 | 3 | package com.vimeo.networking2 4 | 5 | import com.squareup.moshi.Json 6 | import com.squareup.moshi.JsonClass 7 | import com.vimeo.networking2.enums.AlbumViewPrivacyType 8 | import com.vimeo.networking2.enums.asEnum 9 | 10 | /** 11 | * The privacy set for an album. 12 | * 13 | * @param password The privacy-enabled password to see this album. Present only when privacy.view is password. 14 | * @param viewPrivacy Who can view the album. See [AlbumPrivacy.viewPrivacyType]. 15 | */ 16 | @JsonClass(generateAdapter = true) 17 | data class AlbumPrivacy( 18 | 19 | @Json(name = "password") 20 | val password: String? = null, 21 | 22 | @Json(name = "view") 23 | val viewPrivacy: String? = null 24 | ) 25 | 26 | /** 27 | * @see AlbumPrivacy.viewPrivacy 28 | * @see AlbumViewPrivacyType 29 | */ 30 | val AlbumPrivacy.viewPrivacyType: AlbumViewPrivacyType 31 | get() = viewPrivacy.asEnum(AlbumViewPrivacyType.UNKNOWN) 32 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/ApiConfiguration.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * API Configuration data. 8 | * 9 | * @param host URL to access the API. 10 | */ 11 | @JsonClass(generateAdapter = true) 12 | data class ApiConfiguration( 13 | 14 | @Json(name = "host") 15 | val host: String? = null 16 | ) 17 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/App.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * The app information. 8 | * 9 | * @param uri an app uri. 10 | * @param name an app name. 11 | */ 12 | @JsonClass(generateAdapter = true) 13 | data class App( 14 | @Json(name = "uri") 15 | val uri: String? = null, 16 | 17 | @Json(name = "name") 18 | val name: String? = null 19 | ) 20 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/BasicConnection.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Connection 6 | 7 | /** 8 | * Connection data. 9 | * 10 | * @param total The total number of items on this connection. 11 | */ 12 | @JsonClass(generateAdapter = true) 13 | data class BasicConnection( 14 | 15 | @Json(name = "options") 16 | override val options: List? = null, 17 | 18 | @Json(name = "uri") 19 | override val uri: String? = null, 20 | 21 | @Json(name = "total") 22 | val total: Int? = null 23 | 24 | ) : Connection 25 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/BasicInteraction.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.annotations.Internal 6 | import com.vimeo.networking2.common.Interaction 7 | 8 | /** 9 | * Interaction with options and uri information. 10 | */ 11 | @Internal 12 | @JsonClass(generateAdapter = true) 13 | data class BasicInteraction( 14 | 15 | @Internal 16 | @Json(name = "options") 17 | override val options: List? = null, 18 | 19 | @Internal 20 | @Json(name = "uri") 21 | override val uri: String? = null 22 | 23 | ) : Interaction 24 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/Billing.kt: -------------------------------------------------------------------------------- 1 | @file:JvmName("BillingUtils") 2 | 3 | package com.vimeo.networking2 4 | 5 | import com.squareup.moshi.Json 6 | import com.squareup.moshi.JsonClass 7 | import com.vimeo.networking2.enums.BillingStatusType 8 | import com.vimeo.networking2.enums.asEnum 9 | 10 | /** 11 | * The Billing information for this subscription. 12 | * 13 | * @param status The user's billing information status. See [Billing.statusType]. 14 | */ 15 | @JsonClass(generateAdapter = true) 16 | data class Billing( 17 | 18 | @Json(name = "status") 19 | val status: String? = null 20 | ) 21 | 22 | /** 23 | * @see [Billing.status] 24 | * @see BillingStatusType 25 | */ 26 | val Billing.statusType: BillingStatusType 27 | get() = status.asEnum(BillingStatusType.UNKNOWN) 28 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/CategoryConnections.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * All connections for a category. 8 | * 9 | * @param channels Information about the channels related to this category. 10 | * @param groups Information about the groups related to this category. 11 | * @param users Information about the users related to this category. 12 | * @param videos Information about the videos related to this category. 13 | */ 14 | @JsonClass(generateAdapter = true) 15 | data class CategoryConnections( 16 | 17 | @Json(name = "channels") 18 | val channels: BasicConnection? = null, 19 | 20 | @Json(name = "groups") 21 | val groups: BasicConnection? = null, 22 | 23 | @Json(name = "users") 24 | val users: BasicConnection? = null, 25 | 26 | @Json(name = "videos") 27 | val videos: BasicConnection? = null 28 | 29 | ) 30 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/CategoryInteractions.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.FollowableInteractions 6 | 7 | /** 8 | * All actions that can be taken on a category. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class CategoryInteractions( 12 | 13 | @Json(name = "follow") 14 | override val follow: FollowInteraction? = null 15 | 16 | ) : FollowableInteractions 17 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/CategoryList.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Pageable 6 | 7 | /** 8 | * List of categories that are pageable. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class CategoryList( 12 | 13 | @Json(name = "total") 14 | override val total: Int? = null, 15 | 16 | @Json(name = "page") 17 | override val page: Int? = null, 18 | 19 | @Json(name = "per_page") 20 | override val perPage: Int? = null, 21 | 22 | @Json(name = "paging") 23 | override val paging: Paging? = null, 24 | 25 | @Json(name = "data") 26 | override val data: List? = null, 27 | 28 | @Json(name = "filtered_total") 29 | override val filteredTotal: Int? = null 30 | ) : Pageable 31 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/ChannelConnections.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * All connections for a channel. 8 | * 9 | * @param privacyUsers Information provided to channel moderators about which users they have specifically permitted to 10 | * access a private channel. This data requires a bearer token with the private scope. 11 | * @param users Information about the users following or moderating this channel. 12 | * @param videos Information about the videos that belong to this channel. 13 | */ 14 | @JsonClass(generateAdapter = true) 15 | data class ChannelConnections( 16 | 17 | @Json(name = "privacy_users") 18 | val privacyUsers: BasicConnection? = null, 19 | 20 | @Json(name = "users") 21 | val users: BasicConnection? = null, 22 | 23 | @Json(name = "videos") 24 | val videos: BasicConnection? = null 25 | 26 | ) 27 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/ChannelList.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Pageable 6 | 7 | /** 8 | * List of channels that are pageable. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class ChannelList( 12 | 13 | @Json(name = "total") 14 | override val total: Int? = null, 15 | 16 | @Json(name = "page") 17 | override val page: Int? = null, 18 | 19 | @Json(name = "per_page") 20 | override val perPage: Int? = null, 21 | 22 | @Json(name = "paging") 23 | override val paging: Paging? = null, 24 | 25 | @Json(name = "data") 26 | override val data: List? = null, 27 | 28 | @Json(name = "filtered_total") 29 | override val filteredTotal: Int? = null 30 | ) : Pageable 31 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/Chapter.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Chapter data. 8 | * 9 | * @param uri The relative URI of the chapter. 10 | * @param title The title of the chapter. 11 | * @param timeCode The timecode of the chapter in seconds from the start of the video. 12 | */ 13 | @JsonClass(generateAdapter = true) 14 | data class Chapter( 15 | 16 | @Json(name = "uri") 17 | val uri: String? = null, 18 | 19 | @Json(name = "title") 20 | val title: String? = null, 21 | 22 | @Json(name = "timecode") 23 | val timeCode: Long? = null 24 | ) 25 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/ChapterList.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Page 6 | 7 | /** 8 | * List of chapters that are pageable. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class ChapterList( 12 | 13 | @Json(name = "total") 14 | override val total: Int? = null, 15 | 16 | @Json(name = "filtered_total") 17 | override val filteredTotal: Int? = null, 18 | 19 | @Json(name = "data") 20 | override val data: List? = null 21 | ) : Page 22 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/CinemaConnections.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * All connections for a cinema. 8 | * 9 | * @param contents Information about the contents of this programmed cinema item. 10 | */ 11 | @JsonClass(generateAdapter = true) 12 | data class CinemaConnections( 13 | 14 | @Json(name = "contents") 15 | val contents: BasicConnection? = null 16 | 17 | ) 18 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/CommentConnections.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * All connections for a comment. 8 | * 9 | * @param replies Information about this comment's replies. 10 | */ 11 | @JsonClass(generateAdapter = true) 12 | data class CommentConnections( 13 | 14 | @Json(name = "replies") 15 | val replies: BasicConnection? = null 16 | ) 17 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/CommentList.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Pageable 6 | 7 | /** 8 | * List of comments that are pageable. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class CommentList( 12 | 13 | @Json(name = "total") 14 | override val total: Int? = null, 15 | 16 | @Json(name = "page") 17 | override val page: Int? = null, 18 | 19 | @Json(name = "per_page") 20 | override val perPage: Int? = null, 21 | 22 | @Json(name = "paging") 23 | override val paging: Paging? = null, 24 | 25 | @Json(name = "data") 26 | override val data: List? = null, 27 | 28 | @Json(name = "filtered_total") 29 | override val filteredTotal: Int? = null 30 | ) : Pageable 31 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/ConnectedAppInteraction.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Interaction 6 | 7 | /** 8 | * All of the interactions for a connected app. 9 | * 10 | * @param allScopes Provides the lists of scopes that are required for third-party connected app features. 11 | * @param isConnected Whether an app is connected or not. 12 | */ 13 | @JsonClass(generateAdapter = true) 14 | data class ConnectedAppInteraction( 15 | 16 | @Json(name = "all_scopes") 17 | val allScopes: ConnectedScopes? = null, 18 | 19 | @Json(name = "is_connected") 20 | val isConnected: Boolean? = null, 21 | 22 | @Json(name = "options") 23 | override val options: List? = null, 24 | 25 | @Json(name = "uri") 26 | override val uri: String? = null 27 | ) : Interaction 28 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/ConnectedAppList.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Page 6 | 7 | /** 8 | * List of the logged in user's [ConnectedApps][ConnectedApp]. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class ConnectedAppList( 12 | 13 | @Json(name = "total") 14 | override val total: Int? = null, 15 | 16 | @Json(name = "data") 17 | override val data: List? = null, 18 | 19 | @Json(name = "filtered_total") 20 | override val filteredTotal: Int? = null 21 | ) : Page 22 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/ConnectedScopes.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Provides the lists of scopes that are required for third-party connected app features. 8 | * 9 | * @param publishToSocial All scopes required for publishing to a specific social media platform. 10 | * @param simulcast All scopes required for simulcasting to a specific social media platform. 11 | */ 12 | @JsonClass(generateAdapter = true) 13 | data class ConnectedScopes( 14 | 15 | @Json(name = "publish_to_social") 16 | val publishToSocial: List? = null, 17 | 18 | @Json(name = "simulcast") 19 | val simulcast: List? = null 20 | ) 21 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/Coordinates.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Relative coordinates on the surface. 8 | * 9 | * @param x The X coordinate. 10 | * @param y The Y coordinate. 11 | */ 12 | @JsonClass(generateAdapter = true) 13 | data class Coordinates( 14 | 15 | @Json(name = "x") 16 | val x: Float = 0.5f, 17 | 18 | @Json(name = "y") 19 | val y: Float = 0.5f, 20 | ) 21 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/Credit.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Video credit data. 8 | * 9 | * @param name The name of the person credited. 10 | * @param role The character that this person portrayed, or the job that this person performed. 11 | * @param uri The unique identifier to access the credits resource. 12 | * @param user The Vimeo user associated with this credit. 13 | * @param video The video associated with this credit. 14 | */ 15 | @JsonClass(generateAdapter = true) 16 | data class Credit( 17 | 18 | @Json(name = "name") 19 | val name: String? = null, 20 | 21 | @Json(name = "role") 22 | val role: String? = null, 23 | 24 | @Json(name = "uri") 25 | val uri: String? = null, 26 | 27 | @Json(name = "user") 28 | val user: User? = null, 29 | 30 | @Json(name = "video") 31 | val video: Video? = null 32 | 33 | ) 34 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/CustomDomains.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Custom domains data. 8 | * 9 | * @param authDomain auth domain url. 10 | * @param apiDomain api domain url. 11 | * @param magistoApiDomain Magisto api domain url. 12 | */ 13 | @JsonClass(generateAdapter = true) 14 | data class CustomDomains( 15 | 16 | @Json(name = "auth_domain") 17 | val authDomain: String? = null, 18 | 19 | @Json(name = "api_domain") 20 | val apiDomain: String? = null, 21 | 22 | @Json(name = "magisto_api_domain") 23 | val magistoApiDomain: String? = null 24 | ) 25 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/DefaultConnection.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Connection 6 | 7 | /** 8 | * The default implementation of a connection that does not add any other properties. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class DefaultConnection( 12 | 13 | @Json(name = "options") 14 | override val options: List? = null, 15 | 16 | @Json(name = "uri") 17 | override val uri: String? = null 18 | ) : Connection 19 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/Document.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Document data. 8 | * 9 | * @param html The partially stripped html for documents like the terms of service. 10 | */ 11 | @JsonClass(generateAdapter = true) 12 | data class Document( 13 | 14 | @Json(name = "html") 15 | val html: String? = null 16 | ) 17 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/Drm.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.annotations.Internal 6 | 7 | /** 8 | * A holder on to the drm content. There are three types, `fairplay`, `widevine`, and `playready`. Since this is a Java 9 | * library and only Apple products support `fairplay`, that type is omitted. Clients will only receive these if given 10 | * the app-specific permission, essentially this class is not consumable by the general public. 11 | * 12 | * @param widevine The video file containing the info about the DRM protected stream. 13 | */ 14 | @Internal 15 | @JsonClass(generateAdapter = true) 16 | data class Drm( 17 | 18 | @Json(name = "widevine") 19 | val widevine: DashVideoFile? = null 20 | ) 21 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/Email.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * User's email. 8 | * 9 | * @param email The user's email. 10 | */ 11 | @JsonClass(generateAdapter = true) 12 | data class Email( 13 | 14 | @Json(name = "email") 15 | val email: String? = null 16 | 17 | ) 18 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/EmbedTitle.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Embed data. 8 | * 9 | * @param name How the embeddable player handles the video title. 10 | * @param owner How the embeddable player handles the video owner's information. 11 | * @param portrait How the embeddable player handles the video owner's portrait. 12 | */ 13 | @JsonClass(generateAdapter = true) 14 | data class EmbedTitle( 15 | 16 | @Json(name = "name") 17 | val name: String? = null, 18 | 19 | @Json(name = "owner") 20 | val owner: String? = null, 21 | 22 | @Json(name = "portrait") 23 | val portrait: String? = null 24 | 25 | ) 26 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/FacebookConfiguration.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.annotations.Internal 6 | 7 | /** 8 | * Facebook API configuration data. 9 | * 10 | * @param requiredScopes An array of required scopes for connecting users to Facebook. 11 | */ 12 | @Internal 13 | @JsonClass(generateAdapter = true) 14 | data class FacebookConfiguration( 15 | 16 | @Internal 17 | @Json(name = "required_scopes") 18 | val requiredScopes: List? = null 19 | 20 | ) 21 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/FacetOption.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Facet data. 8 | * 9 | * @param name Option name. 10 | * @param text Option text. 11 | * @param total Option total. 12 | */ 13 | @JsonClass(generateAdapter = true) 14 | data class FacetOption( 15 | 16 | @Json(name = "name") 17 | val name: String? = null, 18 | 19 | @Json(name = "text") 20 | val text: String? = null, 21 | 22 | @Json(name = "total") 23 | val total: Int? = null 24 | ) 25 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/FeaturedContent.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Featured content data. 8 | * 9 | * @param video Featured video. 10 | * @param liveEvent Featured live event. 11 | */ 12 | @JsonClass(generateAdapter = true) 13 | data class FeaturedContent( 14 | 15 | @Json(name = "video") 16 | val video: Video?, 17 | 18 | @Json(name = "live_event") 19 | val liveEvent: LiveEvent?, 20 | ) 21 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/FeaturesConfiguration.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.annotations.Internal 6 | 7 | /** 8 | * Various feature configuration data. 9 | * 10 | * @param playTracking Is play tracking enabled? 11 | */ 12 | @Internal 13 | @JsonClass(generateAdapter = true) 14 | data class FeaturesConfiguration( 15 | 16 | @Internal 17 | @Json(name = "play_tracking") 18 | val playTracking: Boolean? = null 19 | 20 | ) 21 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/FeedItemConnections.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * All connections for a [FeedItem]. 8 | * 9 | * @param related A list of resource URIs related to the activity. 10 | */ 11 | @JsonClass(generateAdapter = true) 12 | data class FeedItemConnections( 13 | 14 | @Json(name = "related") 15 | val related: BasicConnection? = null 16 | 17 | ) 18 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/FeedList.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Pageable 6 | 7 | /** 8 | * List of [FeedItems][FeedItem] to show in a user's feed. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class FeedList( 12 | 13 | @Json(name = "total") 14 | override val total: Int? = null, 15 | 16 | @Json(name = "page") 17 | override val page: Int? = null, 18 | 19 | @Json(name = "per_page") 20 | override val perPage: Int? = null, 21 | 22 | @Json(name = "paging") 23 | override val paging: Paging? = null, 24 | 25 | @Json(name = "data") 26 | override val data: List? = null, 27 | 28 | @Json(name = "filtered_total") 29 | override val filteredTotal: Int? = null 30 | ) : Pageable 31 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/FileTransferPage.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.annotations.Internal 6 | 7 | /** 8 | * Information about the file transfer page. 9 | * 10 | * @param link The link to the file transfer page. 11 | */ 12 | @Internal 13 | @JsonClass(generateAdapter = true) 14 | data class FileTransferPage( 15 | 16 | @Internal 17 | @Json(name = "link") 18 | val link: String? = null 19 | ) 20 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/FolderAncestorConnection.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * The connection to a parent folder in the ancestor hierarchy of a folder. 8 | * 9 | * @param uri The URI of the parent folder. 10 | * @param name The name of the parent folder. 11 | */ 12 | @JsonClass(generateAdapter = true) 13 | data class FolderAncestorConnection( 14 | 15 | @Json(name = "uri") 16 | val uri: String? = null, 17 | 18 | @Json(name = "name") 19 | val name: String? = null 20 | ) 21 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/FolderList.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Pageable 6 | 7 | /** 8 | * List of [Folders][Folder] to show in a user's feed. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class FolderList( 12 | 13 | @Json(name = "total") 14 | override val total: Int? = null, 15 | 16 | @Json(name = "page") 17 | override val page: Int? = null, 18 | 19 | @Json(name = "per_page") 20 | override val perPage: Int? = null, 21 | 22 | @Json(name = "paging") 23 | override val paging: Paging? = null, 24 | 25 | @Json(name = "data") 26 | override val data: List? = null, 27 | 28 | @Json(name = "filtered_total") 29 | override val filteredTotal: Int? = null 30 | ) : Pageable 31 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/FolderPrivacy.kt: -------------------------------------------------------------------------------- 1 | @file:JvmName("FolderPrivacyUtils") 2 | 3 | package com.vimeo.networking2 4 | 5 | import com.squareup.moshi.Json 6 | import com.squareup.moshi.JsonClass 7 | import com.vimeo.networking2.enums.FolderViewPrivacyType 8 | import com.vimeo.networking2.enums.asEnum 9 | 10 | /** 11 | * The privacy set for a folder. 12 | * 13 | * @param viewPrivacy Who can view the folder. See [FolderPrivacy.viewPrivacyType]. 14 | */ 15 | @JsonClass(generateAdapter = true) 16 | data class FolderPrivacy( 17 | 18 | @Json(name = "view") 19 | val viewPrivacy: String? = null 20 | ) 21 | 22 | /** 23 | * @see FolderPrivacy.viewPrivacy 24 | * @see FolderViewPrivacyType 25 | */ 26 | val FolderPrivacy.viewPrivacyType: FolderViewPrivacyType 27 | get() = viewPrivacy.asEnum(FolderViewPrivacyType.UNKNOWN) 28 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/FollowInteraction.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.UpdatableInteraction 6 | import java.util.Date 7 | 8 | /** 9 | * Follow a object. 10 | */ 11 | @JsonClass(generateAdapter = true) 12 | data class FollowInteraction( 13 | 14 | @Json(name = "added") 15 | override val added: Boolean? = null, 16 | 17 | @Json(name = "added_time") 18 | override val addedTime: Date? = null, 19 | 20 | @Json(name = "options") 21 | override val options: List? = null, 22 | 23 | @Json(name = "uri") 24 | override val uri: String? = null 25 | 26 | ) : UpdatableInteraction 27 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/Gcs.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.annotations.Internal 6 | 7 | /** 8 | * GCS data. 9 | * 10 | * @param endByte Expected ending byte range for the current [uploadLink]. 11 | * @param startByte Expected starting byte size for the current [uploadLink]. 12 | * @param uploadLink Link for uploading file chunk to. 13 | */ 14 | @Internal 15 | @JsonClass(generateAdapter = true) 16 | data class Gcs( 17 | 18 | @Internal 19 | @Json(name = "end_byte") 20 | val endByte: Long? = null, 21 | 22 | @Internal 23 | @Json(name = "start_byte") 24 | val startByte: Long? = null, 25 | 26 | @Internal 27 | @Json(name = "upload_link") 28 | val uploadLink: String? = null 29 | ) 30 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/GroupConnections.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * All connections for groups. 8 | * 9 | * @param users Information about the members or moderators of this group. 10 | * @param videos Information about the videos contained within this group. 11 | */ 12 | @JsonClass(generateAdapter = true) 13 | data class GroupConnections( 14 | 15 | @Json(name = "users") 16 | val users: BasicConnection? = null, 17 | 18 | @Json(name = "videos") 19 | val videos: BasicConnection? = null 20 | 21 | ) 22 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/GroupInteractions.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.FollowableInteractions 6 | 7 | /** 8 | * All actions that can be taken on groups. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class GroupInteractions( 12 | 13 | @Json(name = "join") 14 | override val follow: GroupFollowInteraction? = null 15 | 16 | ) : FollowableInteractions 17 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/HlsVideoFile.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.annotations.Internal 6 | import com.vimeo.networking2.common.LoggingVideoFile 7 | import java.util.Date 8 | 9 | /** 10 | * Video file data. 11 | * 12 | * @param live The info about the live heartbeat endpoint, used if the video is a live video. 13 | */ 14 | @Internal 15 | @JsonClass(generateAdapter = true) 16 | data class HlsVideoFile( 17 | 18 | @Internal 19 | @Json(name = "link") 20 | override val link: String? = null, 21 | 22 | @Internal 23 | @Json(name = "link_expiration_time") 24 | override val linkExpirationTime: Date? = null, 25 | 26 | @Internal 27 | @Json(name = "log") 28 | override val log: String? = null, 29 | 30 | @Internal 31 | @Json(name = "live") 32 | val live: LiveHeartbeat? = null 33 | ) : LoggingVideoFile 34 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/Lifetime.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.StorageQuota 6 | import com.vimeo.networking2.enums.UploadQuotaUnitType 7 | import com.vimeo.networking2.enums.asEnum 8 | 9 | /** 10 | * Lifetime data. 11 | */ 12 | @JsonClass(generateAdapter = true) 13 | data class Lifetime( 14 | 15 | @Json(name = "free") 16 | override val free: Long? = null, 17 | 18 | @Json(name = "max") 19 | override val max: Long? = null, 20 | 21 | @Json(name = "unit") 22 | override val unit: String? = null, 23 | 24 | @Json(name = "used") 25 | override val used: Long? = null 26 | ) : StorageQuota 27 | 28 | /** 29 | * @see Lifetime.unit 30 | * @see UploadQuotaUnitType 31 | */ 32 | val Lifetime.unitType: UploadQuotaUnitType 33 | get() = unit.asEnum(UploadQuotaUnitType.UNKNOWN) 34 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/LikeInteraction.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.UpdatableInteraction 6 | import java.util.Date 7 | 8 | /** 9 | * Information on liking a video. 10 | */ 11 | @JsonClass(generateAdapter = true) 12 | data class LikeInteraction( 13 | 14 | @Json(name = "added") 15 | override val added: Boolean? = null, 16 | 17 | @Json(name = "added_time") 18 | override val addedTime: Date? = null, 19 | 20 | @Json(name = "options") 21 | override val options: List? = null, 22 | 23 | @Json(name = "uri") 24 | override val uri: String? = null 25 | 26 | ) : UpdatableInteraction 27 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/LiveChat.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.annotations.Internal 6 | 7 | /** 8 | * A model representing the specific data needed for the live chat feature when a live video is playing. 9 | * Additional data can be found in the [LiveChatConfiguration] class available in the [AppConfiguration]. 10 | * 11 | * @param roomId The identification number of the live clip's chat room. 12 | * @param token The JSON Web Token to access the live clip's chat room. 13 | * @param user The user that will be chatting. 14 | */ 15 | @Internal 16 | @JsonClass(generateAdapter = true) 17 | data class LiveChat( 18 | 19 | @Internal 20 | @Json(name = "room_id") 21 | val roomId: String? = null, 22 | 23 | @Internal 24 | @Json(name = "token") 25 | val token: String? = null, 26 | 27 | @Internal 28 | @Json(name = "user") 29 | val user: User? = null 30 | 31 | ) 32 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/LiveConfiguration.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.annotations.Internal 6 | 7 | /** 8 | * Live Streaming configuration data. 9 | * 10 | * @param chat Live chat configuration data. 11 | * @param heartbeat Live heart beat configuration data. 12 | */ 13 | @Internal 14 | @JsonClass(generateAdapter = true) 15 | data class LiveConfiguration( 16 | 17 | @Internal 18 | @Json(name = "chat") 19 | val chat: LiveChatConfiguration? = null, 20 | 21 | @Internal 22 | @Json(name = "heartbeat") 23 | val heartbeat: LiveHeartbeatConfiguration? = null 24 | 25 | ) 26 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/LiveEventEmbedProperties.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * LiveEvent embed properties data. 8 | * 9 | * @param width The width used to generate the fixed HTML embed code. 10 | * @param height The height used to generate the fixed HTML embed code. 11 | * @param sourceUri The source URL used to generate the fixed HTML embed code. 12 | */ 13 | @JsonClass(generateAdapter = true) 14 | data class LiveEventEmbedProperties( 15 | 16 | @Json(name = "width") 17 | val width: Long? = null, 18 | 19 | @Json(name = "height") 20 | val height: Long? = null, 21 | 22 | @Json(name = "source_url") 23 | val sourceUri: String? = null 24 | ) 25 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/LiveEventInteractions.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Interactions for a live event. 8 | * 9 | * @param activate Information about where and how to activate the live event. 10 | * @param delete Information about where and how to delete an item. 11 | * @param edit Information about where and how to edit an item. 12 | * 13 | */ 14 | @JsonClass(generateAdapter = true) 15 | data class LiveEventInteractions( 16 | 17 | @Json(name = "activate") 18 | val activate: BasicInteraction? = null, 19 | 20 | @Json(name = "delete") 21 | val delete: BasicInteraction? = null, 22 | 23 | @Json(name = "edit") 24 | val edit: BasicInteraction? = null 25 | ) 26 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/LiveEventList.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Pageable 6 | 7 | /** 8 | * List of live events that could be paged. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class LiveEventList( 12 | 13 | @Json(name = "total") 14 | override val total: Int? = null, 15 | 16 | @Json(name = "page") 17 | override val page: Int? = null, 18 | 19 | @Json(name = "per_page") 20 | override val perPage: Int? = null, 21 | 22 | @Json(name = "paging") 23 | override val paging: Paging? = null, 24 | 25 | @Json(name = "data") 26 | override val data: List? = null, 27 | 28 | @Json(name = "filtered_total") 29 | override val filteredTotal: Int? = null 30 | 31 | ) : Pageable 32 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/LiveEventLogoInfo.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Live Event Logos data. 8 | * 9 | * @param customLogo A collection of information relating to custom logos in the embeddable player. 10 | * @param shouldShowVimeoLogo Whether the Vimeo logo appears in the embeddable player for the video. 11 | */ 12 | @JsonClass(generateAdapter = true) 13 | data class LiveEventLogoInfo( 14 | 15 | @Json(name = "custom") 16 | val customLogo: LiveEventCustomLogo? = null, 17 | 18 | @Json(name = "vimeo") 19 | val shouldShowVimeoLogo: Boolean? = null 20 | ) 21 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/LiveHeartbeat.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Holds information about the live heartbeat endpoint. 8 | * 9 | * @param heartbeat The endpoint that can be called to trigger a heartbeat for a streaming video. 10 | */ 11 | @JsonClass(generateAdapter = true) 12 | data class LiveHeartbeat( 13 | 14 | @Json(name = "heartbeat") 15 | val heartbeat: String? = null 16 | ) 17 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/LiveHeartbeatConfiguration.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.annotations.Internal 6 | 7 | /** 8 | * Live heart beat configuration. 9 | * 10 | * @param enabled Whether live heartbeat logging is enabled or not. If live heartbeat logging is enabled, then mobile 11 | * apps should send a heartbeat using [HlsVideoFile.live] or [DashVideoFile.live] so we can track the amount of 12 | * concurrent users viewing a stream. 13 | * @param interval The interval, in seconds, at which a live heartbeat should be sent. 14 | */ 15 | @Internal 16 | @JsonClass(generateAdapter = true) 17 | data class LiveHeartbeatConfiguration( 18 | 19 | @Internal 20 | @Json(name = "enabled") 21 | val enabled: Boolean? = null, 22 | 23 | @Internal 24 | @Json(name = "interval") 25 | val interval: Int? = null 26 | 27 | ) 28 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/LiveStats.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Live stats data. 8 | * 9 | * @param plays The current total amount of plays this video has received. 10 | * @param totalViewTime The total amount of time spent watching this video by all viewers. 11 | * @param viewers Information about the number of people watching the stream. 12 | */ 13 | @JsonClass(generateAdapter = true) 14 | data class LiveStats( 15 | 16 | @Json(name = "plays") 17 | val plays: Long? = null, 18 | 19 | @Json(name = "total_view_time") 20 | val totalViewTime: Long? = null, 21 | 22 | @Json(name = "viewers") 23 | val viewers: LiveStatsViewers? = null 24 | 25 | ) 26 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/LiveStatsViewers.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Live stats viewers data. 8 | * 9 | * @param current The current amount of people watching this video. 10 | * @param peak The peak amount of people watching this video at any time in the provided date range. 11 | */ 12 | @JsonClass(generateAdapter = true) 13 | data class LiveStatsViewers( 14 | 15 | @Json(name = "current") 16 | val current: Long? = null, 17 | 18 | @Json(name = "peak") 19 | val peak: Long? = null 20 | ) 21 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/LiveStreamsQuota.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.annotations.Internal 6 | 7 | /** 8 | * Live Stream Quota DTO. 9 | * 10 | * @param maximum The maximum amount of streams that the user can create. 11 | * @param remaining The amount of remaining live streams that the user can create this month. 12 | */ 13 | @Internal 14 | @JsonClass(generateAdapter = true) 15 | data class LiveStreamsQuota( 16 | 17 | @Internal 18 | @Json(name = "maximum") 19 | val maximum: Int? = null, 20 | 21 | @Internal 22 | @Json(name = "remaining") 23 | val remaining: Int? = null 24 | 25 | ) 26 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/LiveTime.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Live time data. 8 | * 9 | * @param eventMaximum The amount of time per event, in seconds, that the user is allowed to live stream. 10 | * @param monthlyMaximum The amount of time this month, in seconds, that the user can live stream. 11 | * @param monthlyRemaining The amount of time remaining this month, in seconds, that the user can live stream. 12 | */ 13 | @JsonClass(generateAdapter = true) 14 | data class LiveTime( 15 | 16 | @Json(name = "event_maximum") 17 | val eventMaximum: Long? = null, 18 | 19 | @Json(name = "monthly_maximum") 20 | val monthlyMaximum: Long? = null, 21 | 22 | @Json(name = "monthly_remaining") 23 | val monthlyRemaining: Long? = null 24 | 25 | ) 26 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/LiveVideoConnection.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Connection 6 | import com.vimeo.networking2.enums.LiveStatusType 7 | import com.vimeo.networking2.enums.asEnum 8 | 9 | /** 10 | * The connection for a live video. 11 | * 12 | * @param status The current status of the live video. 13 | */ 14 | @JsonClass(generateAdapter = true) 15 | data class LiveVideoConnection( 16 | @Json(name = "options") 17 | override val options: List? = null, 18 | 19 | @Json(name = "uri") 20 | override val uri: String? = null, 21 | 22 | @Json(name = "status") 23 | val status: String? = null 24 | ) : Connection 25 | 26 | /** 27 | * @see LiveVideoConnection.status 28 | * @see LiveStatusType 29 | */ 30 | val LiveVideoConnection.statusType: LiveStatusType 31 | get() = status.asEnum(LiveStatusType.UNKNOWN) 32 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/Metadata.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Metadata with connections and interactions. 8 | * 9 | * @param connections All connections for an object. 10 | * @param interactions All interactions for an object. 11 | */ 12 | @JsonClass(generateAdapter = true) 13 | data class Metadata( 14 | 15 | @Json(name = "connections") 16 | val connections: Connections_T? = null, 17 | 18 | @Json(name = "interactions") 19 | val interactions: Interactions_T? = null 20 | ) 21 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/MetadataConnections.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Metadata with only connections. 8 | * 9 | * @param connections Connections for [Connections_T]. 10 | */ 11 | @JsonClass(generateAdapter = true) 12 | data class MetadataConnections( 13 | 14 | @Json(name = "connections") 15 | val connections: Connections_T? = null 16 | 17 | ) 18 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/MetadataInteractions.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Metadata with only interactions. 8 | * 9 | * @param interactions Interactions for [Interactions_T]. 10 | */ 11 | @JsonClass(generateAdapter = true) 12 | data class MetadataInteractions( 13 | 14 | @Json(name = "interactions") 15 | val interactions: Interactions_T? = null 16 | ) 17 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/NoteList.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Pageable 6 | 7 | /** 8 | * List of notes that are pageable. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class NoteList( 12 | 13 | @Json(name = "total") 14 | override val total: Int? = null, 15 | 16 | @Json(name = "page") 17 | override val page: Int? = null, 18 | 19 | @Json(name = "per_page") 20 | override val perPage: Int? = null, 21 | 22 | @Json(name = "paging") 23 | override val paging: Paging? = null, 24 | 25 | @Json(name = "data") 26 | override val data: List? = null, 27 | 28 | @Json(name = "filtered_total") 29 | override val filteredTotal: Int? = null 30 | ) : Pageable 31 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/NoteStatus.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.vimeo.networking2.enums.StringValue 4 | 5 | /** 6 | * Enum representing status of the discussion of the note. 7 | */ 8 | enum class NoteStatus(override val value: String?) : StringValue { 9 | /** 10 | * Note discussion status is open. 11 | */ 12 | OPEN("open"), 13 | 14 | /** 15 | * Note discussion status is closed. 16 | */ 17 | CLOSED("closed"), 18 | 19 | /** 20 | * Unknown discussion status. 21 | */ 22 | UNKNOWN(null) 23 | } 24 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/NotificationList.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Pageable 6 | 7 | /** 8 | * List of notifications that could be paged. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class NotificationList( 12 | 13 | @Json(name = "total") 14 | override val total: Int? = null, 15 | 16 | @Json(name = "page") 17 | override val page: Int? = null, 18 | 19 | @Json(name = "per_page") 20 | override val perPage: Int? = null, 21 | 22 | @Json(name = "paging") 23 | override val paging: Paging? = null, 24 | 25 | @Json(name = "data") 26 | override val data: List? = null, 27 | 28 | @Json(name = "filtered_total") 29 | override val filteredTotal: Int? = null 30 | ) : Pageable 31 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/NotificationSubscriptions.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import java.util.Date 6 | 7 | /** 8 | * A collection of push notifications the user is subscribed to. 9 | * 10 | * @param modifiedTime The time in ISO 8601 format when settings were modified. 11 | * @param subscriptions The settings for each notification subscription. 12 | * @param uri The subscription settings' canonical relative URI. 13 | */ 14 | @JsonClass(generateAdapter = true) 15 | data class NotificationSubscriptions( 16 | 17 | @Json(name = "modified_time") 18 | val modifiedTime: Date? = null, 19 | 20 | @Json(name = "subscriptions") 21 | val subscriptions: Subscriptions? = null, 22 | 23 | @Json(name = "uri") 24 | val uri: String? = null 25 | 26 | ) 27 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/Paging.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Paging urls for next, previous, first and last pages. 8 | * 9 | * @param next Next page's url. 10 | * @param previous Previous page's url. 11 | * @param first First page's url. 12 | * @param last Last page's url. 13 | */ 14 | @JsonClass(generateAdapter = true) 15 | data class Paging( 16 | 17 | @Json(name = "next") 18 | val next: String? = null, 19 | 20 | @Json(name = "previous") 21 | val previous: String? = null, 22 | 23 | @Json(name = "first") 24 | val first: String? = null, 25 | 26 | @Json(name = "last") 27 | val last: String? = null 28 | 29 | ) 30 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/PermissionPolicyList.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Represents a list of [PermissionPolicy]. 8 | * 9 | * @param total the number of policies in the list returned in [data] 10 | * @param data the actual list of [PermissionPolicies][PermissionPolicy] 11 | */ 12 | @JsonClass(generateAdapter = true) 13 | data class PermissionPolicyList( 14 | @Json(name = "total") 15 | val total: Int? = null, 16 | 17 | @Json(name = "data") 18 | val data: List? = null 19 | ) 20 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/PlatformConstraint.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Constraints put in place by a social media platform on uploading videos. 8 | * 9 | * @param duration The max length in seconds of a video for the corresponding platform. 10 | * @param size The max file size in gigabytes of a video for the corresponding platform. 11 | */ 12 | @JsonClass(generateAdapter = true) 13 | data class PlatformConstraint( 14 | 15 | @Json(name = "duration") 16 | val duration: Int? = null, 17 | 18 | @Json(name = "size") 19 | val size: Long? = null 20 | ) 21 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/PlayProgress.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.annotations.Internal 6 | 7 | /** 8 | * Play progress information. 9 | * 10 | * @param seconds The play progress in seconds. 11 | */ 12 | @Internal 13 | @JsonClass(generateAdapter = true) 14 | data class PlayProgress( 15 | 16 | @Internal 17 | @Json(name = "seconds") 18 | val seconds: Int? = null 19 | 20 | ) 21 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/Preferences.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Preferences that may have been set by a user. 8 | * 9 | * @param videos Video preferences set by the a user. 10 | */ 11 | @JsonClass(generateAdapter = true) 12 | data class Preferences( 13 | 14 | @Json(name = "videos") 15 | val videos: VideosPreference? = null 16 | 17 | ) 18 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/ProductInteractions.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Purchase a product action information. 8 | * 9 | * @param purchase The interaction for purchasing a product. 10 | */ 11 | @JsonClass(generateAdapter = true) 12 | data class ProductInteractions( 13 | 14 | @Json(name = "purchase") 15 | val purchase: PurchaseInteraction? = null 16 | 17 | ) 18 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/ProductList.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Pageable 6 | 7 | /** 8 | * List of products that could be paged. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class ProductList( 12 | 13 | @Json(name = "total") 14 | override val total: Int? = null, 15 | 16 | @Json(name = "page") 17 | override val page: Int? = null, 18 | 19 | @Json(name = "per_page") 20 | override val perPage: Int? = null, 21 | 22 | @Json(name = "paging") 23 | override val paging: Paging? = null, 24 | 25 | @Json(name = "data") 26 | override val data: List? = null, 27 | 28 | @Json(name = "filtered_total") 29 | override val filteredTotal: Int? = null 30 | ) : Pageable 31 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/ProgrammedCinemaItemList.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Pageable 6 | 7 | /** 8 | * List of cinema items that could be paged. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class ProgrammedCinemaItemList( 12 | 13 | @Json(name = "total") 14 | override val total: Int? = null, 15 | 16 | @Json(name = "page") 17 | override val page: Int? = null, 18 | 19 | @Json(name = "per_page") 20 | override val perPage: Int? = null, 21 | 22 | @Json(name = "paging") 23 | override val paging: Paging? = null, 24 | 25 | @Json(name = "data") 26 | override val data: List? = null, 27 | 28 | @Json(name = "filtered_total") 29 | override val filteredTotal: Int? = null 30 | ) : Pageable 31 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/ProjectItemList.kt: -------------------------------------------------------------------------------- 1 | @file:JvmName("ProjectItemListUtils") 2 | 3 | package com.vimeo.networking2 4 | 5 | import com.squareup.moshi.Json 6 | import com.squareup.moshi.JsonClass 7 | import com.vimeo.networking2.common.Pageable 8 | 9 | /** 10 | * List of [ProjectItems][ProjectItem] that could be paged. 11 | */ 12 | @JsonClass(generateAdapter = true) 13 | data class ProjectItemList( 14 | 15 | @Json(name = "total") 16 | override val total: Int? = null, 17 | 18 | @Json(name = "page") 19 | override val page: Int? = null, 20 | 21 | @Json(name = "per_page") 22 | override val perPage: Int? = null, 23 | 24 | @Json(name = "paging") 25 | override val paging: Paging? = null, 26 | 27 | @Json(name = "data") 28 | override val data: List? = null, 29 | 30 | @Json(name = "filtered_total") 31 | override val filteredTotal: Int? = null 32 | 33 | ) : Pageable 34 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/ProjectItemMeta.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Meta info for ProjectItem. 8 | * 9 | * @param captionMatchTimestampMs Timestamp where caption relates to. 10 | * @param caption Caption text. 11 | */ 12 | @JsonClass(generateAdapter = true) 13 | data class ProjectItemMeta( 14 | 15 | @Json(name = "caption_match_ts") 16 | val captionMatchTimestampMs: Long?, 17 | 18 | @Json(name = "caption") 19 | val caption: String?, 20 | ) 21 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/Publish.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import java.util.Date 6 | 7 | /** 8 | * [TvodItem] publish information. 9 | * 10 | * @param enabled Whether the [TvodItem] has been published. 11 | * @param time The time in ISO 8601 format when this [TvodItem] was published. 12 | */ 13 | @JsonClass(generateAdapter = true) 14 | data class Publish( 15 | 16 | @Json(name = "enabled") 17 | val enabled: Boolean? = null, 18 | 19 | @Json(name = "time") 20 | val time: Date? = null 21 | ) 22 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/PublishJobConstraints.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * An object representing the information on the publishing constraints for each social network. 8 | * 9 | * @param facebook The publish constraints for Facebook. 10 | * @param linkedin The publish constraints for LinkedIn. 11 | * @param youtube The publish constraints for YouTube. 12 | * @param twitter The publish constraints for Twitter. 13 | */ 14 | @JsonClass(generateAdapter = true) 15 | data class PublishJobConstraints( 16 | 17 | @Json(name = "facebook") 18 | val facebook: PlatformConstraint? = null, 19 | 20 | @Json(name = "linkedin") 21 | val linkedin: PlatformConstraint? = null, 22 | 23 | @Json(name = "youtube") 24 | val youtube: PlatformConstraint? = null, 25 | 26 | @Json(name = "twitter") 27 | val twitter: PlatformConstraint? = null 28 | ) 29 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/PublishJobDestinations.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Contains information about upload/post status on all third party social networks available for publishing. 8 | * 9 | * @param facebook Information about the upload/post on Facebook. 10 | * @param youTube Information about the upload/post on YouTube. 11 | * @param linkedIn Information about the upload/post on LinkedIn. 12 | * @param twitter Information about the upload/post on Twitter. 13 | */ 14 | @JsonClass(generateAdapter = true) 15 | data class PublishJobDestinations( 16 | 17 | @Json(name = "facebook") 18 | val facebook: PublishJobDestination? = null, 19 | 20 | @Json(name = "youtube") 21 | val youTube: PublishJobDestination? = null, 22 | 23 | @Json(name = "linkedin") 24 | val linkedIn: PublishJobDestination? = null, 25 | 26 | @Json(name = "twitter") 27 | val twitter: PublishJobDestination? = null 28 | ) 29 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/PublishOptionItem.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Entity 6 | 7 | /** 8 | * A page or category that can be sent when publishing to a social media platform. 9 | * 10 | * @param id The ID of the publish item. 11 | * @param name The name or display name of the publish item, i.e.: "art", "family", "vacation" etc. 12 | */ 13 | @JsonClass(generateAdapter = true) 14 | data class PublishOptionItem( 15 | 16 | @Json(name = "id") 17 | val id: String? = null, 18 | 19 | @Json(name = "name") 20 | val name: String? = null 21 | 22 | ) : Entity { 23 | override val identifier: String? = id 24 | } 25 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/PurchaseOnDemandInteraction.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.annotations.Internal 6 | 7 | /** 8 | * Purchase season interaction. 9 | * 10 | * @param buy Whether the On Demand video for purchase has DRM. 11 | * @param subscriptionInteraction Subscribe to on demand video. 12 | */ 13 | @Internal 14 | @JsonClass(generateAdapter = true) 15 | data class PurchaseOnDemandInteraction( 16 | 17 | @Internal 18 | @Json(name = "buy") 19 | val buy: BuyInteraction? = null, 20 | 21 | @Internal 22 | @Json(name = "subscribe") 23 | val subscriptionInteraction: SubscriptionInteraction? = null 24 | 25 | ) 26 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/Quota.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Quota data. 8 | * 9 | * @param hd Whether you can upload HD videos. 10 | * @param sd Whether you can upload SD videos. 11 | */ 12 | @JsonClass(generateAdapter = true) 13 | data class Quota( 14 | 15 | @Json(name = "hd") 16 | val hd: Boolean? = null, 17 | 18 | @Json(name = "sd") 19 | val sd: Boolean? = null 20 | 21 | ) 22 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/RecommendationList.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Pageable 6 | 7 | /** 8 | * List of recommendations that could be paged. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class RecommendationList( 12 | 13 | @Json(name = "total") 14 | override val total: Int? = null, 15 | 16 | @Json(name = "page") 17 | override val page: Int? = null, 18 | 19 | @Json(name = "per_page") 20 | override val perPage: Int? = null, 21 | 22 | @Json(name = "paging") 23 | override val paging: Paging? = null, 24 | 25 | @Json(name = "data") 26 | override val data: List? = null, 27 | 28 | @Json(name = "filtered_total") 29 | override val filteredTotal: Int? = null 30 | 31 | ) : Pageable 32 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/ReportInteraction.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Interaction 6 | 7 | /** 8 | * All of the interactions for a report. 9 | * 10 | * @param reason Provides the lists of valid reasons for reporting a video. 11 | */ 12 | @JsonClass(generateAdapter = true) 13 | data class ReportInteraction( 14 | 15 | @Json(name = "options") 16 | override val options: List? = null, 17 | 18 | @Json(name = "uri") 19 | override val uri: String? = null, 20 | 21 | @Json(name = "reason") 22 | val reason: List? = null 23 | 24 | ) : Interaction 25 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/ReviewPage.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.annotations.Internal 6 | 7 | /** 8 | * Review page information. 9 | * 10 | * @param active Whether or not the review page is active for this video. 11 | * @param link Link to the Vimeo review page. 12 | * @param notes Whether or not notes are enabled on the review page. 13 | * @param vimeoLogo Whether or not the vimeo logo should be displayed on the review page. 14 | */ 15 | @Internal 16 | @JsonClass(generateAdapter = true) 17 | data class ReviewPage( 18 | 19 | @Internal 20 | @Json(name = "active") 21 | val active: Boolean? = null, 22 | 23 | @Internal 24 | @Json(name = "link") 25 | val link: String? = null, 26 | 27 | @Internal 28 | @Json(name = "notes") 29 | val notes: Boolean? = null, 30 | 31 | @Internal 32 | @Json(name = "vimeo_logo") 33 | val vimeoLogo: Boolean? = null 34 | 35 | ) 36 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/SearchFacet.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Search Facet. 8 | * 9 | * @param name Option name. 10 | * @param options Search options. 11 | */ 12 | @JsonClass(generateAdapter = true) 13 | data class SearchFacet( 14 | 15 | @Json(name = "name") 16 | val name: String? = null, 17 | 18 | @Json(name = "options") 19 | val options: List? = null 20 | ) 21 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/SeasonConnections.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * All of [Season]'s connections. 8 | * 9 | * @param videos The Videos connection. 10 | */ 11 | @JsonClass(generateAdapter = true) 12 | data class SeasonConnections( 13 | 14 | @Json(name = "videos") 15 | val videos: BasicConnection? = null 16 | 17 | ) 18 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/SeasonInteractions.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.annotations.Internal 6 | 7 | /** 8 | * All actions that can be taken on a [Season]. 9 | * 10 | * @param purchase The interactions for an On Demand video. 11 | */ 12 | @JsonClass(generateAdapter = true) 13 | data class SeasonInteractions( 14 | 15 | @Internal 16 | @Json(name = "purchase") 17 | val purchase: PurchaseOnDemandInteraction? = null 18 | 19 | ) 20 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/SeasonList.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Pageable 6 | 7 | /** 8 | * List of seasons that are pageable. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class SeasonList( 12 | 13 | @Json(name = "total") 14 | override val total: Int? = null, 15 | 16 | @Json(name = "page") 17 | override val page: Int? = null, 18 | 19 | @Json(name = "per_page") 20 | override val perPage: Int? = null, 21 | 22 | @Json(name = "paging") 23 | override val paging: Paging? = null, 24 | 25 | @Json(name = "data") 26 | override val data: List? = null, 27 | 28 | @Json(name = "filtered_total") 29 | override val filteredTotal: Int? = null 30 | 31 | ) : Pageable 32 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/SsoConnection.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.annotations.Internal 6 | 7 | /** 8 | * A connection used to log into Vimeo via Single Sign-On. 9 | * 10 | * @param connectionName The name of the connection. 11 | * @param metadata The metadata containing the interactions of the connection. 12 | * @param uri The URI of the connection. 13 | */ 14 | @Internal 15 | @JsonClass(generateAdapter = true) 16 | data class SsoConnection( 17 | 18 | @Json(name = "connection_name") 19 | val connectionName: String? = null, 20 | 21 | @Json(name = "metadata") 22 | val metadata: MetadataInteractions? = null, 23 | 24 | @Json(name = "uri") 25 | val uri: String? = null 26 | ) 27 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/SsoConnectionInteractions.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.annotations.Internal 6 | 7 | /** 8 | * The interaction for an Single Sign-On connection. 9 | * 10 | * @param connect The interaction to connect via Single Sign-On. 11 | */ 12 | @Internal 13 | @JsonClass(generateAdapter = true) 14 | data class SsoConnectionInteractions( 15 | 16 | @Json(name = "connect") 17 | val connect: BasicInteraction? = null 18 | ) 19 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/Subscription.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Information about the user's subscription. 8 | * 9 | * @param renewal Information about the user's next renewal. 10 | * @param trial Information about the user's trial period. 11 | * @param billing Information about the user's billing info. 12 | */ 13 | @JsonClass(generateAdapter = true) 14 | data class Subscription( 15 | 16 | @Json(name = "renewal") 17 | val renewal: SubscriptionRenewal? = null, 18 | 19 | @Json(name = "trial") 20 | val trial: SubscriptionTrial? = null, 21 | 22 | @Json(name = "billing") 23 | val billing: Billing? = null 24 | ) 25 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/SubscriptionRenewal.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import java.util.Date 6 | 7 | /** 8 | * Information about the user's next renewal. 9 | * 10 | * @param displayDate The date in YYYY-MM-DD format when the user's membership renews (or expires, if they have disabled 11 | * autorenew). For display only. 12 | * @param renewalDate The date the user's membership renews (or expires, if they have disabled autorenew). 13 | */ 14 | @JsonClass(generateAdapter = true) 15 | data class SubscriptionRenewal( 16 | 17 | @Json(name = "display_date") 18 | val displayDate: String? = null, 19 | 20 | @Json(name = "renewal_date") 21 | val renewalDate: Date? = null 22 | ) 23 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/SurveyResponseChoice.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Entity 6 | 7 | /** 8 | * A survey response choice associated with a [SurveyQuestion]. 9 | * 10 | * @param analyticsId The id that should be used when logging this [SurveyResponseChoice]. 11 | * @param resourceKey A unique identifier for the response choice within the context of a [SurveyQuestion]. 12 | * @param title A user-facing display title that represents the choice. This will be localized by the API. 13 | */ 14 | @JsonClass(generateAdapter = true) 15 | data class SurveyResponseChoice( 16 | 17 | @Json(name = "analytics_id") 18 | val analyticsId: String? = null, 19 | 20 | @Json(name = "resource_key") 21 | val resourceKey: String? = null, 22 | 23 | @Json(name = "title") 24 | val title: String? = null 25 | 26 | ) : Entity { 27 | override val identifier: String? = resourceKey 28 | } 29 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/TeamEntityDisplayOptions.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Represents any client side display characteristics which are dictated by the server, or backend. 8 | * 9 | * @param color Shows the tint or background color used against a view element representing a team entity. Likely some 10 | * manner of icon 11 | */ 12 | @JsonClass(generateAdapter = true) 13 | data class TeamEntityDisplayOptions( 14 | @Json(name = "color") 15 | val color: String 16 | ) 17 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/TeamGroupConnections.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Represents the connections associated with a [TeamGroup]. 8 | * 9 | * @param users a connection which returns all users within a [TeamGroup] 10 | */ 11 | @JsonClass(generateAdapter = true) 12 | data class TeamGroupConnections( 13 | @Json(name = "users") 14 | val users: BasicConnection 15 | ) 16 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/TeamList.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Page 6 | 7 | /** 8 | * Non-paginated list of the logged in user's [Teams][Team]. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class TeamList( 12 | 13 | @Json(name = "total") 14 | override val total: Int? = null, 15 | 16 | @Json(name = "data") 17 | override val data: List? = null, 18 | 19 | @Json(name = "filtered_total") 20 | override val filteredTotal: Int? = null 21 | 22 | ) : Page 23 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/TeamMembershipConnections.kt: -------------------------------------------------------------------------------- 1 | @file:JvmName("FolderConnectionsUtils") 2 | 3 | package com.vimeo.networking2 4 | 5 | import com.squareup.moshi.Json 6 | import com.squareup.moshi.JsonClass 7 | 8 | /** 9 | * All of the connections for a team membership. 10 | * 11 | * @param owner A connection object indicating how to get the owner of this user. 12 | */ 13 | @JsonClass(generateAdapter = true) 14 | data class TeamMembershipConnections( 15 | 16 | @Json(name = "owner") 17 | val owner: TeamOwnerConnection? = null 18 | ) 19 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/TeamMembershipList.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Page 6 | 7 | /** 8 | * List of [TeamMemberships][TeamMembership] that cannot be paged. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class TeamMembershipList( 12 | @Json(name = "total") 13 | override val total: Int? = null, 14 | 15 | @Json(name = "data") 16 | override val data: List? = null, 17 | 18 | @Json(name = "filtered_total") 19 | override val filteredTotal: Int? = null 20 | ) : Page 21 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/TeamOwnerConnection.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Connection 6 | 7 | /** 8 | * Connection data. 9 | * 10 | * @param displayName The team owner's display name. 11 | * @param invitesRemaining The total number of team member invites remaining. 12 | * @param total The total number of owners on this connection. 13 | */ 14 | @JsonClass(generateAdapter = true) 15 | data class TeamOwnerConnection( 16 | 17 | @Json(name = "options") 18 | override val options: List? = null, 19 | 20 | @Json(name = "uri") 21 | override val uri: String? = null, 22 | 23 | @Json(name = "display_name") 24 | val displayName: String? = null, 25 | 26 | @Json(name = "invites_remaining") 27 | val invitesRemaining: Int? = null, 28 | 29 | @Json(name = "total") 30 | val total: Int? = null 31 | 32 | ) : Connection 33 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/TeamPermissionCurrentPermissions.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Represents the current permission for a [TeamPermission]. 8 | * 9 | * @param permissionPolicyUri The uri for the permission 10 | */ 11 | @JsonClass(generateAdapter = true) 12 | data class TeamPermissionCurrentPermissions( 13 | @Json(name = "permission_policy_uri") 14 | val permissionPolicyUri: String? = null 15 | ) 16 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/TeamPermissionInteraction.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Represents any interactions for a [TeamPermission]. 8 | * 9 | * @param edit an interaction denoting the ability to edit the [TeamPermission] 10 | * @param remove an interaction denoting the ability to remove the [TeamPermission] 11 | */ 12 | @JsonClass(generateAdapter = true) 13 | data class TeamPermissionInteraction( 14 | @Json(name = "edit") 15 | val edit: BasicInteraction? = null, 16 | 17 | @Json(name = "remove") 18 | val remove: BasicInteraction? = null 19 | ) 20 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/TeamPermissionList.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Pageable 6 | 7 | /** 8 | * Represents a pageable array/list of [TeamPermission]. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class TeamPermissionList( 12 | 13 | @Json(name = "total") 14 | override val total: Int? = null, 15 | 16 | @Json(name = "page") 17 | override val page: Int? = null, 18 | 19 | @Json(name = "per_page") 20 | override val perPage: Int? = null, 21 | 22 | @Json(name = "paging") 23 | override val paging: Paging? = null, 24 | 25 | @Json(name = "data") 26 | override val data: List? = null, 27 | 28 | @Json(name = "filtered_total") 29 | override val filteredTotal: Int? = null 30 | ) : Pageable 31 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/TeamToken.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Token of Magisto team. 8 | * 9 | * @param token The token of Magisto team. 10 | */ 11 | @JsonClass(generateAdapter = true) 12 | data class TeamToken( 13 | 14 | @Json(name = "magisto_access_token") 15 | val token: String? = null 16 | 17 | ) 18 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/TextTrackList.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Pageable 6 | 7 | /** 8 | * List of text tracks for a video. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class TextTrackList( 12 | 13 | @Json(name = "total") 14 | override val total: Int? = null, 15 | 16 | @Json(name = "page") 17 | override val page: Int? = null, 18 | 19 | @Json(name = "per_page") 20 | override val perPage: Int? = null, 21 | 22 | @Json(name = "paging") 23 | override val paging: Paging? = null, 24 | 25 | @Json(name = "data") 26 | override val data: List? = null, 27 | 28 | @Json(name = "filtered_total") 29 | override val filteredTotal: Int? = null 30 | 31 | ) : Pageable 32 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/Transcode.kt: -------------------------------------------------------------------------------- 1 | @file:JvmName("TranscodeUtils") 2 | 3 | package com.vimeo.networking2 4 | 5 | import com.squareup.moshi.Json 6 | import com.squareup.moshi.JsonClass 7 | import com.vimeo.networking2.enums.TranscodeStatusType 8 | import com.vimeo.networking2.enums.asEnum 9 | 10 | /** 11 | * The transcode information for a video upload. 12 | * 13 | * @param status Status code for clip availability. See [Transcode.statusType]. 14 | */ 15 | @JsonClass(generateAdapter = true) 16 | data class Transcode( 17 | 18 | @Json(name = "status") 19 | val status: String? = null 20 | 21 | ) 22 | 23 | /** 24 | * @see Transcode.status 25 | * @see TranscodeStatusType 26 | */ 27 | val Transcode.statusType: TranscodeStatusType 28 | get() = status.asEnum(TranscodeStatusType.UNKNOWN) 29 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/TrialEligibility.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.annotations.Internal 6 | 7 | /** 8 | * Trial account eligibility. 9 | * 10 | * @param eligible Whether or not the user is eligible for a trial period. 11 | */ 12 | @Internal 13 | @JsonClass(generateAdapter = true) 14 | data class TrialEligibility( 15 | 16 | @Internal 17 | @Json(name = "eligible") 18 | val eligible: Boolean? = null 19 | ) 20 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/TvodItemList.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Pageable 6 | 7 | /** 8 | * List of [TvodItem] that could be paged. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class TvodItemList( 12 | 13 | @Json(name = "total") 14 | override val total: Int? = null, 15 | 16 | @Json(name = "page") 17 | override val page: Int? = null, 18 | 19 | @Json(name = "per_page") 20 | override val perPage: Int? = null, 21 | 22 | @Json(name = "paging") 23 | override val paging: Paging? = null, 24 | 25 | @Json(name = "data") 26 | override val data: List? = null, 27 | 28 | @Json(name = "filtered_total") 29 | override val filteredTotal: Int? = null 30 | 31 | ) : Pageable 32 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/UploadQuota.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * User's upload quota information. 8 | * 9 | * @param lifetime The number of bytes remaining in your lifetime maximum. 10 | * @param periodic The number of bytes remaining in your upload quota for the current period. 11 | * @param quota Quota information. 12 | * @param space Space information. 13 | */ 14 | @JsonClass(generateAdapter = true) 15 | data class UploadQuota( 16 | 17 | @Json(name = "lifetime") 18 | val lifetime: Lifetime? = null, 19 | 20 | @Json(name = "periodic") 21 | val periodic: Periodic? = null, 22 | 23 | @Json(name = "quota") 24 | val quota: Quota? = null, 25 | 26 | @Json(name = "space") 27 | val space: Space? = null 28 | 29 | ) 30 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/UserList.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Pageable 6 | 7 | /** 8 | * List of users that could be paged. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class UserList( 12 | 13 | @Json(name = "total") 14 | override val total: Int? = null, 15 | 16 | @Json(name = "page") 17 | override val page: Int? = null, 18 | 19 | @Json(name = "per_page") 20 | override val perPage: Int? = null, 21 | 22 | @Json(name = "paging") 23 | override val paging: Paging? = null, 24 | 25 | @Json(name = "data") 26 | override val data: List? = null, 27 | 28 | @Json(name = "filtered_total") 29 | override val filteredTotal: Int? = null 30 | 31 | ) : Pageable 32 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/UserSegmentSurveyList.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Page 6 | 7 | /** 8 | * A list of [UserSegmentSurveys][UserSegmentSurvey]. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class UserSegmentSurveyList( 12 | 13 | @Json(name = "total") 14 | override val total: Int? = null, 15 | 16 | @Json(name = "data") 17 | override val data: List? = null, 18 | 19 | @Json(name = "filtered_total") 20 | override val filteredTotal: Int? = null 21 | ) : Page 22 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/VideoBadges.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | 6 | /** 7 | * Video badges data. 8 | * 9 | * @param hdr Whether the video has an HDR-compatible transcode. 10 | * @param live Live data. 11 | * @param weekendChallenge Whether the video is a Vimeo Weekend Challenge. 12 | */ 13 | @JsonClass(generateAdapter = true) 14 | data class VideoBadges( 15 | 16 | @Json(name = "hdr") 17 | val hdr: Boolean? = null, 18 | 19 | @Json(name = "live") 20 | val live: Live? = null, 21 | 22 | @Json(name = "weekendChallenge") 23 | val weekendChallenge: Boolean? = null 24 | ) 25 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/VideoContainer.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.vimeo.networking2.common.Entity 4 | 5 | /** 6 | * Represents entity that contains [Video]. 7 | */ 8 | sealed interface VideoContainer> : Entity { 9 | 10 | /** 11 | * Container URI (video or live event URI). 12 | */ 13 | val uri: String? 14 | 15 | /** 16 | * Related [Video]. 17 | */ 18 | val video: Video? 19 | 20 | /** 21 | * Copies this [VideoContainer] with new [video]. 22 | */ 23 | fun copyVideoContainer( 24 | video: Video? = null, 25 | ): T 26 | } 27 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/VideoContext.kt: -------------------------------------------------------------------------------- 1 | @file:JvmName("VideoContextUtils") 2 | 3 | package com.vimeo.networking2 4 | 5 | import com.squareup.moshi.Json 6 | import com.squareup.moshi.JsonClass 7 | import com.vimeo.networking2.enums.VideoActionType 8 | import com.vimeo.networking2.enums.asEnum 9 | 10 | /** 11 | * Video context data. 12 | * 13 | * @param videoAction The contextual action. See [VideoContext.videoActionType]. 14 | * @param resourceType The contextual resource type. 15 | */ 16 | @JsonClass(generateAdapter = true) 17 | data class VideoContext( 18 | 19 | @Json(name = "action") 20 | val videoAction: String? = null, 21 | 22 | @Json(name = "resource_type") 23 | val resourceType: String? = null 24 | 25 | ) 26 | 27 | /** 28 | * @see VideoContext.videoAction 29 | * @see VideoActionType 30 | */ 31 | val VideoContext.videoActionType: VideoActionType 32 | get() = videoAction.asEnum(VideoActionType.UNKNOWN) 33 | -------------------------------------------------------------------------------- /models/src/main/java/com/vimeo/networking2/VideoList.kt: -------------------------------------------------------------------------------- 1 | package com.vimeo.networking2 2 | 3 | import com.squareup.moshi.Json 4 | import com.squareup.moshi.JsonClass 5 | import com.vimeo.networking2.common.Pageable 6 | 7 | /** 8 | * List of videos that could be paged. 9 | */ 10 | @JsonClass(generateAdapter = true) 11 | data class VideoList( 12 | 13 | @Json(name = "total") 14 | override val total: Int? = null, 15 | 16 | @Json(name = "page") 17 | override val page: Int? = null, 18 | 19 | @Json(name = "per_page") 20 | override val perPage: Int? = null, 21 | 22 | @Json(name = "paging") 23 | override val paging: Paging? = null, 24 | 25 | @Json(name = "data") 26 | override val data: List