Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/src/v3/api/api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ export 'resolve_object/resolve_object.dart';
export 'search/search.dart';
export 'site/site.dart';
export 'user/user.dart';
export 'oauth/oauth.dart';
26 changes: 26 additions & 0 deletions lib/src/v3/api/oauth/oauth.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import 'package:freezed_annotation/freezed_annotation.dart';

import '../../../../v3.dart';
import '../../../utils/serde.dart';

part 'oauth.freezed.dart';
part 'oauth.g.dart';

/// Only available in lemmy v0.20.0 and above
/// Authenticate with OAuth.
///
/// `HTTP.POST /oauth/authenticate`
@freezed
class AuthenticateWithOAuth with _$AuthenticateWithOAuth implements LemmyApiQuery<LoginResponse> {
@apiSerde
const factory AuthenticateWithOAuth({required String code, required int oauth_provider_id, required String redirect_uri, String? username, String? answer}) = _AuthenticateWithOAuth;

const AuthenticateWithOAuth._();
factory AuthenticateWithOAuth.fromJson(Map<String, dynamic> json) => _$AuthenticateWithOAuthFromJson(json);

final path = '/oauth/authenticate';
final httpMethod = HttpMethod.post;

@override
LoginResponse responseFactory(Map<String, dynamic> json) => LoginResponse.fromJson(json);
}
218 changes: 218 additions & 0 deletions lib/src/v3/api/oauth/oauth.freezed.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions lib/src/v3/api/oauth/oauth.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions lib/src/v3/models/local_user/local_user.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ class LocalUser with _$LocalUser {
bool? blurNsfw, // v0.18.3
bool? autoExpand, // v0.18.3
required String theme, // v0.18.0
required SortType defaultSortType, // v0.18.0
@deprecated SortType? defaultSortType, // v0.18.0 [deprecated in v0.20.0]
SortType? defaultCommentSortType, // v0.20.0
SortType? defaultPostSortType, // v0.20.0
required ListingType defaultListingType, // v0.18.0
required String interfaceLanguage, // v0.18.0
required bool showAvatars, // v0.18.0
required bool sendNotificationsToEmail, // v0.18.0
@deprecated String? validatorTime, // v0.18.0 [deprecated in v0.19.0]
required bool showScores, // v0.18.0
@deprecated bool? showScores, // v0.18.0 [deprecated in v0.20.0]
required bool showBotAccounts, // v0.18.0
required bool showReadPosts, // v0.18.0
@deprecated bool? showNewPostNotifs, // v0.18.0 [deprecated in v0.19.0]
Expand Down
Loading