package fedcm

// Code generated by cdproto-gen. DO NOT EDIT.

import (
	

	
	
	
)

// LoginState whether this is a sign-up or sign-in action for this account,
// i.e. whether this account has ever been used to sign in to this RP before.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/FedCm#type-LoginState
type LoginState string

// String returns the LoginState as string value.
func ( LoginState) () string {
	return string()
}

// LoginState values.
const (
	LoginStateSignIn LoginState = "SignIn"
	LoginStateSignUp LoginState = "SignUp"
)

// MarshalEasyJSON satisfies easyjson.Marshaler.
func ( LoginState) ( *jwriter.Writer) {
	.String(string())
}

// MarshalJSON satisfies json.Marshaler.
func ( LoginState) () ([]byte, error) {
	return easyjson.Marshal()
}

// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func ( *LoginState) ( *jlexer.Lexer) {
	 := .String()
	switch LoginState() {
	case LoginStateSignIn:
		* = LoginStateSignIn
	case LoginStateSignUp:
		* = LoginStateSignUp

	default:
		.AddError(fmt.Errorf("unknown LoginState value: %v", ))
	}
}

// UnmarshalJSON satisfies json.Unmarshaler.
func ( *LoginState) ( []byte) error {
	return easyjson.Unmarshal(, )
}

// DialogType whether the dialog shown is an account chooser or an auto
// re-authentication dialog.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/FedCm#type-DialogType
type DialogType string

// String returns the DialogType as string value.
func ( DialogType) () string {
	return string()
}

// DialogType values.
const (
	DialogTypeAccountChooser  DialogType = "AccountChooser"
	DialogTypeAutoReauthn     DialogType = "AutoReauthn"
	DialogTypeConfirmIdpLogin DialogType = "ConfirmIdpLogin"
)

// MarshalEasyJSON satisfies easyjson.Marshaler.
func ( DialogType) ( *jwriter.Writer) {
	.String(string())
}

// MarshalJSON satisfies json.Marshaler.
func ( DialogType) () ([]byte, error) {
	return easyjson.Marshal()
}

// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func ( *DialogType) ( *jlexer.Lexer) {
	 := .String()
	switch DialogType() {
	case DialogTypeAccountChooser:
		* = DialogTypeAccountChooser
	case DialogTypeAutoReauthn:
		* = DialogTypeAutoReauthn
	case DialogTypeConfirmIdpLogin:
		* = DialogTypeConfirmIdpLogin

	default:
		.AddError(fmt.Errorf("unknown DialogType value: %v", ))
	}
}

// UnmarshalJSON satisfies json.Unmarshaler.
func ( *DialogType) ( []byte) error {
	return easyjson.Unmarshal(, )
}

// Account corresponds to IdentityRequestAccount.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/FedCm#type-Account
type Account struct {
	AccountID         string     `json:"accountId"`
	Email             string     `json:"email"`
	Name              string     `json:"name"`
	GivenName         string     `json:"givenName"`
	PictureURL        string     `json:"pictureUrl"`
	IdpConfigURL      string     `json:"idpConfigUrl"`
	IdpLoginURL       string     `json:"idpLoginUrl"`
	LoginState        LoginState `json:"loginState"`
	TermsOfServiceURL string     `json:"termsOfServiceUrl,omitempty"` // These two are only set if the loginState is signUp
	PrivacyPolicyURL  string     `json:"privacyPolicyUrl,omitempty"`
}