vendor/github.com/go-rod/rod/lib/proto/fed_cm.go

244 lines · 6366 bytes

  1// This file is generated by "./lib/proto/generate"
  2
  3package proto
  4
  5/*
  6
  7FedCm
  8
  9This domain allows interacting with the FedCM dialog.
 10
 11*/
 12
 13// FedCmLoginState Whether this is a sign-up or sign-in action for this account, i.e.
 14// whether this account has ever been used to sign in to this RP before.
 15type FedCmLoginState string
 16
 17const (
 18	// FedCmLoginStateSignIn enum const.
 19	FedCmLoginStateSignIn FedCmLoginState = "SignIn"
 20
 21	// FedCmLoginStateSignUp enum const.
 22	FedCmLoginStateSignUp FedCmLoginState = "SignUp"
 23)
 24
 25// FedCmDialogType The types of FedCM dialogs.
 26type FedCmDialogType string
 27
 28const (
 29	// FedCmDialogTypeAccountChooser enum const.
 30	FedCmDialogTypeAccountChooser FedCmDialogType = "AccountChooser"
 31
 32	// FedCmDialogTypeAutoReauthn enum const.
 33	FedCmDialogTypeAutoReauthn FedCmDialogType = "AutoReauthn"
 34
 35	// FedCmDialogTypeConfirmIdpLogin enum const.
 36	FedCmDialogTypeConfirmIdpLogin FedCmDialogType = "ConfirmIdpLogin"
 37
 38	// FedCmDialogTypeError enum const.
 39	FedCmDialogTypeError FedCmDialogType = "Error"
 40)
 41
 42// FedCmDialogButton The buttons on the FedCM dialog.
 43type FedCmDialogButton string
 44
 45const (
 46	// FedCmDialogButtonConfirmIdpLoginContinue enum const.
 47	FedCmDialogButtonConfirmIdpLoginContinue FedCmDialogButton = "ConfirmIdpLoginContinue"
 48
 49	// FedCmDialogButtonErrorGotIt enum const.
 50	FedCmDialogButtonErrorGotIt FedCmDialogButton = "ErrorGotIt"
 51
 52	// FedCmDialogButtonErrorMoreDetails enum const.
 53	FedCmDialogButtonErrorMoreDetails FedCmDialogButton = "ErrorMoreDetails"
 54)
 55
 56// FedCmAccountURLType The URLs that each account has.
 57type FedCmAccountURLType string
 58
 59const (
 60	// FedCmAccountURLTypeTermsOfService enum const.
 61	FedCmAccountURLTypeTermsOfService FedCmAccountURLType = "TermsOfService"
 62
 63	// FedCmAccountURLTypePrivacyPolicy enum const.
 64	FedCmAccountURLTypePrivacyPolicy FedCmAccountURLType = "PrivacyPolicy"
 65)
 66
 67// FedCmAccount Corresponds to IdentityRequestAccount.
 68type FedCmAccount struct {
 69	// AccountID ...
 70	AccountID string `json:"accountId"`
 71
 72	// Email ...
 73	Email string `json:"email"`
 74
 75	// Name ...
 76	Name string `json:"name"`
 77
 78	// GivenName ...
 79	GivenName string `json:"givenName"`
 80
 81	// PictureURL ...
 82	PictureURL string `json:"pictureUrl"`
 83
 84	// IdpConfigURL ...
 85	IdpConfigURL string `json:"idpConfigUrl"`
 86
 87	// IdpLoginURL ...
 88	IdpLoginURL string `json:"idpLoginUrl"`
 89
 90	// LoginState ...
 91	LoginState FedCmLoginState `json:"loginState"`
 92
 93	// TermsOfServiceURL (optional) These two are only set if the loginState is signUp
 94	TermsOfServiceURL string `json:"termsOfServiceUrl,omitempty"`
 95
 96	// PrivacyPolicyURL (optional) ...
 97	PrivacyPolicyURL string `json:"privacyPolicyUrl,omitempty"`
 98}
 99
100// FedCmEnable ...
101type FedCmEnable struct {
102	// DisableRejectionDelay (optional) Allows callers to disable the promise rejection delay that would
103	// normally happen, if this is unimportant to what's being tested.
104	// (step 4 of https://fedidcg.github.io/FedCM/#browser-api-rp-sign-in)
105	DisableRejectionDelay bool `json:"disableRejectionDelay,omitempty"`
106}
107
108// ProtoReq name.
109func (m FedCmEnable) ProtoReq() string { return "FedCm.enable" }
110
111// Call sends the request.
112func (m FedCmEnable) Call(c Client) error {
113	return call(m.ProtoReq(), m, nil, c)
114}
115
116// FedCmDisable ...
117type FedCmDisable struct{}
118
119// ProtoReq name.
120func (m FedCmDisable) ProtoReq() string { return "FedCm.disable" }
121
122// Call sends the request.
123func (m FedCmDisable) Call(c Client) error {
124	return call(m.ProtoReq(), m, nil, c)
125}
126
127// FedCmSelectAccount ...
128type FedCmSelectAccount struct {
129	// DialogID ...
130	DialogID string `json:"dialogId"`
131
132	// AccountIndex ...
133	AccountIndex int `json:"accountIndex"`
134}
135
136// ProtoReq name.
137func (m FedCmSelectAccount) ProtoReq() string { return "FedCm.selectAccount" }
138
139// Call sends the request.
140func (m FedCmSelectAccount) Call(c Client) error {
141	return call(m.ProtoReq(), m, nil, c)
142}
143
144// FedCmClickDialogButton ...
145type FedCmClickDialogButton struct {
146	// DialogID ...
147	DialogID string `json:"dialogId"`
148
149	// DialogButton ...
150	DialogButton FedCmDialogButton `json:"dialogButton"`
151}
152
153// ProtoReq name.
154func (m FedCmClickDialogButton) ProtoReq() string { return "FedCm.clickDialogButton" }
155
156// Call sends the request.
157func (m FedCmClickDialogButton) Call(c Client) error {
158	return call(m.ProtoReq(), m, nil, c)
159}
160
161// FedCmOpenURL ...
162type FedCmOpenURL struct {
163	// DialogID ...
164	DialogID string `json:"dialogId"`
165
166	// AccountIndex ...
167	AccountIndex int `json:"accountIndex"`
168
169	// AccountURLType ...
170	AccountURLType FedCmAccountURLType `json:"accountUrlType"`
171}
172
173// ProtoReq name.
174func (m FedCmOpenURL) ProtoReq() string { return "FedCm.openUrl" }
175
176// Call sends the request.
177func (m FedCmOpenURL) Call(c Client) error {
178	return call(m.ProtoReq(), m, nil, c)
179}
180
181// FedCmDismissDialog ...
182type FedCmDismissDialog struct {
183	// DialogID ...
184	DialogID string `json:"dialogId"`
185
186	// TriggerCooldown (optional) ...
187	TriggerCooldown bool `json:"triggerCooldown,omitempty"`
188}
189
190// ProtoReq name.
191func (m FedCmDismissDialog) ProtoReq() string { return "FedCm.dismissDialog" }
192
193// Call sends the request.
194func (m FedCmDismissDialog) Call(c Client) error {
195	return call(m.ProtoReq(), m, nil, c)
196}
197
198// FedCmResetCooldown Resets the cooldown time, if any, to allow the next FedCM call to show
199// a dialog even if one was recently dismissed by the user.
200type FedCmResetCooldown struct{}
201
202// ProtoReq name.
203func (m FedCmResetCooldown) ProtoReq() string { return "FedCm.resetCooldown" }
204
205// Call sends the request.
206func (m FedCmResetCooldown) Call(c Client) error {
207	return call(m.ProtoReq(), m, nil, c)
208}
209
210// FedCmDialogShown ...
211type FedCmDialogShown struct {
212	// DialogID ...
213	DialogID string `json:"dialogId"`
214
215	// DialogType ...
216	DialogType FedCmDialogType `json:"dialogType"`
217
218	// Accounts ...
219	Accounts []*FedCmAccount `json:"accounts"`
220
221	// Title These exist primarily so that the caller can verify the
222	// RP context was used appropriately.
223	Title string `json:"title"`
224
225	// Subtitle (optional) ...
226	Subtitle string `json:"subtitle,omitempty"`
227}
228
229// ProtoEvent name.
230func (evt FedCmDialogShown) ProtoEvent() string {
231	return "FedCm.dialogShown"
232}
233
234// FedCmDialogClosed Triggered when a dialog is closed, either by user action, JS abort,
235// or a command below.
236type FedCmDialogClosed struct {
237	// DialogID ...
238	DialogID string `json:"dialogId"`
239}
240
241// ProtoEvent name.
242func (evt FedCmDialogClosed) ProtoEvent() string {
243	return "FedCm.dialogClosed"
244}