29
29
import com .google .firebase .FirebaseApp ;
30
30
import com .google .firebase .auth .FirebaseUserManager .EmailLinkType ;
31
31
import com .google .firebase .auth .FirebaseUserManager .UserImportRequest ;
32
+ import com .google .firebase .auth .ListProviderConfigsPage ;
33
+ import com .google .firebase .auth .ListProviderConfigsPage .DefaultOidcProviderConfigSource ;
34
+ import com .google .firebase .auth .ListUsersPage ;
32
35
import com .google .firebase .auth .ListUsersPage .DefaultUserSource ;
33
- import com .google .firebase .auth .ListUsersPage .PageFactory ;
34
36
import com .google .firebase .auth .UserRecord ;
35
37
import com .google .firebase .auth .internal .FirebaseTokenFactory ;
36
38
import com .google .firebase .internal .CallableOperation ;
@@ -500,8 +502,8 @@ private CallableOperation<ListUsersPage, FirebaseAuthException> listUsersOp(
500
502
@ Nullable final String pageToken , final int maxResults ) {
501
503
checkNotDestroyed ();
502
504
final FirebaseUserManager userManager = getUserManager ();
503
- final PageFactory factory =
504
- new PageFactory ( new DefaultUserSource ( userManager , jsonFactory ) , maxResults , pageToken );
505
+ final DefaultUserSource source = new DefaultUserSource ( userManager , jsonFactory );
506
+ final ListUsersPage . Factory factory = new ListUsersPage . Factory ( source , maxResults , pageToken );
505
507
return new CallableOperation <ListUsersPage , FirebaseAuthException >() {
506
508
@ Override
507
509
protected ListUsersPage execute () throws FirebaseAuthException {
@@ -1033,6 +1035,7 @@ public OidcProviderConfig getOidcProviderConfig(@NonNull String providerId)
1033
1035
1034
1036
/**
1035
1037
* Similar to {@link #getOidcProviderConfig(String)} but performs the operation asynchronously.
1038
+ * Page size will be limited to 100 provider configs.
1036
1039
*
1037
1040
* @param providerId A provider ID string.
1038
1041
* @return An {@code ApiFuture} which will complete successfully with an
@@ -1058,6 +1061,78 @@ protected OidcProviderConfig execute() throws FirebaseAuthException {
1058
1061
};
1059
1062
}
1060
1063
1064
+ /**
1065
+ * Gets a page of OIDC Auth provider configs starting from the specified {@code pageToken}.
1066
+ *
1067
+ * @param pageToken A non-empty page token string, or null to retrieve the first page of provider
1068
+ * configs.
1069
+ * @param maxResults Maximum number of provider configs to include in the returned page. This may
1070
+ * not exceed 100.
1071
+ * @return A {@link ListProviderConfigsPage} instance.
1072
+ * @throws IllegalArgumentException If the specified page token is empty, or max results value is
1073
+ * invalid.
1074
+ * @throws FirebaseAuthException If an error occurs while retrieving user data.
1075
+ */
1076
+ public ListProviderConfigsPage <OidcProviderConfig > listOidcProviderConfigs (
1077
+ @ Nullable String pageToken , int maxResults ) throws FirebaseAuthException {
1078
+ return listOidcProviderConfigsOp (pageToken , maxResults ).call ();
1079
+ }
1080
+
1081
+ /**
1082
+ * Similar to {@link #listlistOidcProviderConfigs(String)} but performs the operation
1083
+ * asynchronously. Page size will be limited to 100 provider configs.
1084
+ *
1085
+ * @param pageToken A non-empty page token string, or null to retrieve the first page of provider
1086
+ * configs.
1087
+ * @return An {@code ApiFuture} which will complete successfully with a
1088
+ * {@link ListProviderConfigsPage} instance. If an error occurs while retrieving provider
1089
+ * config data, the future throws an exception.
1090
+ * @throws IllegalArgumentException If the specified page token is empty.
1091
+ */
1092
+ public ApiFuture <ListProviderConfigsPage <OidcProviderConfig >> listOidcProviderConfigsAsync (
1093
+ @ Nullable String pageToken ) {
1094
+ return listOidcProviderConfigsAsync (
1095
+ pageToken ,
1096
+ FirebaseUserManager .MAX_LIST_PROVIDER_CONFIGS_RESULTS );
1097
+ }
1098
+
1099
+ /**
1100
+ * Similar to {@link #listOidcProviderConfigs(String, int)} but performs the operation
1101
+ * asynchronously.
1102
+ *
1103
+ * @param pageToken A non-empty page token string, or null to retrieve the first page of provider
1104
+ * configs.
1105
+ * @param maxResults Maximum number of provider configs to include in the returned page. This may
1106
+ * not exceed 100.
1107
+ * @return An {@code ApiFuture} which will complete successfully with a
1108
+ * {@link ListProviderConfigsPage} instance. If an error occurs while retrieving provider
1109
+ * config data, the future throws an exception.
1110
+ * @throws IllegalArgumentException If the specified page token is empty, or max results value is
1111
+ * invalid.
1112
+ */
1113
+ public ApiFuture <ListProviderConfigsPage <OidcProviderConfig >> listOidcProviderConfigsAsync (
1114
+ @ Nullable String pageToken ,
1115
+ int maxResults ) {
1116
+ return listOidcProviderConfigsOp (pageToken , maxResults ).callAsync (firebaseApp );
1117
+ }
1118
+
1119
+ private CallableOperation <ListProviderConfigsPage <OidcProviderConfig >, FirebaseAuthException >
1120
+ listOidcProviderConfigsOp (@ Nullable final String pageToken , final int maxResults ) {
1121
+ checkNotDestroyed ();
1122
+ final FirebaseUserManager userManager = getUserManager ();
1123
+ final DefaultOidcProviderConfigSource source = new DefaultOidcProviderConfigSource (userManager );
1124
+ final ListProviderConfigsPage .Factory <OidcProviderConfig > factory =
1125
+ new ListProviderConfigsPage .Factory <OidcProviderConfig >(source , maxResults , pageToken );
1126
+ return
1127
+ new CallableOperation <ListProviderConfigsPage <OidcProviderConfig >, FirebaseAuthException >() {
1128
+ @ Override
1129
+ protected ListProviderConfigsPage <OidcProviderConfig > execute ()
1130
+ throws FirebaseAuthException {
1131
+ return factory .create ();
1132
+ }
1133
+ };
1134
+ }
1135
+
1061
1136
/**
1062
1137
* Deletes the provider config identified by the specified provider ID.
1063
1138
*
0 commit comments