88import lombok .*;
99
1010@ Getter
11- @ Builder
11+ @ RequiredArgsConstructor
1212@ ToString
1313@ EqualsAndHashCode
1414public class StartAuthorizationFlowRequest {
@@ -25,11 +25,85 @@ public class StartAuthorizationFlowRequest {
2525
2626 private final Map <String , String > userAccountSelection ;
2727
28+ public static StartAuthorizationFlowRequestBuilder builder () {
29+ return new StartAuthorizationFlowRequestBuilder ();
30+ }
31+
32+ // TODO: remove in future major version, as we will no longer support empty provider selection
33+ public static class StartAuthorizationFlowRequestBuilder {
34+ private boolean withProviderSelection ;
35+
36+ private ProviderSelection providerSelection ;
37+
38+ private Map <String , String > schemeSelection ;
39+
40+ private Redirect redirect ;
41+
42+ private Consent consent ;
43+
44+ private Form form ;
45+
46+ private Map <String , String > userAccountSelection ;
47+
48+ /**
49+ * Include an empty provider selection object in the request
50+ * @deprecated use providerSelection(ProviderSelection) instead
51+ * @return the builder object
52+ */
53+ @ Deprecated
54+ public StartAuthorizationFlowRequestBuilder withProviderSelection () {
55+ this .withProviderSelection = true ;
56+ return this ;
57+ }
58+
59+ public StartAuthorizationFlowRequestBuilder providerSelection (ProviderSelection providerSelection ) {
60+ this .providerSelection = providerSelection ;
61+ return this ;
62+ }
63+
64+ public StartAuthorizationFlowRequestBuilder schemeSelection (Map <String , String > schemeSelection ) {
65+ this .schemeSelection = schemeSelection ;
66+ return this ;
67+ }
68+
69+ public StartAuthorizationFlowRequestBuilder redirect (Redirect redirect ) {
70+ this .redirect = redirect ;
71+ return this ;
72+ }
73+
74+ public StartAuthorizationFlowRequestBuilder consent (Consent consent ) {
75+ this .consent = consent ;
76+ return this ;
77+ }
78+
79+ public StartAuthorizationFlowRequestBuilder form (Form form ) {
80+ this .form = form ;
81+ return this ;
82+ }
83+
84+ public StartAuthorizationFlowRequestBuilder userAccountSelection (Map <String , String > userAccountSelection ) {
85+ this .userAccountSelection = userAccountSelection ;
86+ return this ;
87+ }
88+
89+ public StartAuthorizationFlowRequest build () {
90+ if (withProviderSelection && providerSelection == null ) {
91+ providerSelection = new ProviderSelection ();
92+ }
93+
94+ return new StartAuthorizationFlowRequest (
95+ providerSelection , schemeSelection , redirect , consent , form , userAccountSelection );
96+ }
97+ }
98+
2899 @ Builder
29100 @ ToString
30101 @ EqualsAndHashCode
102+ @ AllArgsConstructor
31103 public static class ProviderSelection {
32- private final Icon icon ;
104+ private Icon icon ;
105+
106+ public ProviderSelection () {}
33107
34108 @ NoArgsConstructor
35109 @ AllArgsConstructor
0 commit comments