func UnstructuredToConfig()

in unstructured/google/identitytoolkit/beta/config.go [380:1116]


func UnstructuredToConfig(u *unstructured.Resource) (*dclService.Config, error) {
	r := &dclService.Config{}
	if _, ok := u.Object["authorizedDomains"]; ok {
		if s, ok := u.Object["authorizedDomains"].([]interface{}); ok {
			for _, ss := range s {
				if strval, ok := ss.(string); ok {
					r.AuthorizedDomains = append(r.AuthorizedDomains, strval)
				}
			}
		} else {
			return nil, fmt.Errorf("r.AuthorizedDomains: expected []interface{}")
		}
	}
	if _, ok := u.Object["blockingFunctions"]; ok {
		if rBlockingFunctions, ok := u.Object["blockingFunctions"].(map[string]interface{}); ok {
			r.BlockingFunctions = &dclService.ConfigBlockingFunctions{}
			if _, ok := rBlockingFunctions["triggers"]; ok {
				if rBlockingFunctionsTriggers, ok := rBlockingFunctions["triggers"].(map[string]interface{}); ok {
					m := make(map[string]dclService.ConfigBlockingFunctionsTriggers)
					for k, v := range rBlockingFunctionsTriggers {
						if objval, ok := v.(map[string]interface{}); ok {
							var rBlockingFunctionsTriggersObj dclService.ConfigBlockingFunctionsTriggers
							if _, ok := objval["functionUri"]; ok {
								if s, ok := objval["functionUri"].(string); ok {
									rBlockingFunctionsTriggersObj.FunctionUri = dcl.String(s)
								} else {
									return nil, fmt.Errorf("rBlockingFunctionsTriggersObj.FunctionUri: expected string")
								}
							}
							if _, ok := objval["updateTime"]; ok {
								if s, ok := objval["updateTime"].(string); ok {
									rBlockingFunctionsTriggersObj.UpdateTime = dcl.String(s)
								} else {
									return nil, fmt.Errorf("rBlockingFunctionsTriggersObj.UpdateTime: expected string")
								}
							}
							m[k] = rBlockingFunctionsTriggersObj
						} else {
							return nil, fmt.Errorf("r.BlockingFunctions.Triggers: expected map[string]interface{}")
						}
					}
					r.BlockingFunctions.Triggers = m
				} else {
					return nil, fmt.Errorf("r.BlockingFunctions.Triggers: expected map[string]interface{}")
				}
			}
		} else {
			return nil, fmt.Errorf("r.BlockingFunctions: expected map[string]interface{}")
		}
	}
	if _, ok := u.Object["client"]; ok {
		if rClient, ok := u.Object["client"].(map[string]interface{}); ok {
			r.Client = &dclService.ConfigClient{}
			if _, ok := rClient["apiKey"]; ok {
				if s, ok := rClient["apiKey"].(string); ok {
					r.Client.ApiKey = dcl.String(s)
				} else {
					return nil, fmt.Errorf("r.Client.ApiKey: expected string")
				}
			}
			if _, ok := rClient["firebaseSubdomain"]; ok {
				if s, ok := rClient["firebaseSubdomain"].(string); ok {
					r.Client.FirebaseSubdomain = dcl.String(s)
				} else {
					return nil, fmt.Errorf("r.Client.FirebaseSubdomain: expected string")
				}
			}
			if _, ok := rClient["permissions"]; ok {
				if rClientPermissions, ok := rClient["permissions"].(map[string]interface{}); ok {
					r.Client.Permissions = &dclService.ConfigClientPermissions{}
					if _, ok := rClientPermissions["disabledUserDeletion"]; ok {
						if b, ok := rClientPermissions["disabledUserDeletion"].(bool); ok {
							r.Client.Permissions.DisabledUserDeletion = dcl.Bool(b)
						} else {
							return nil, fmt.Errorf("r.Client.Permissions.DisabledUserDeletion: expected bool")
						}
					}
					if _, ok := rClientPermissions["disabledUserSignup"]; ok {
						if b, ok := rClientPermissions["disabledUserSignup"].(bool); ok {
							r.Client.Permissions.DisabledUserSignup = dcl.Bool(b)
						} else {
							return nil, fmt.Errorf("r.Client.Permissions.DisabledUserSignup: expected bool")
						}
					}
				} else {
					return nil, fmt.Errorf("r.Client.Permissions: expected map[string]interface{}")
				}
			}
		} else {
			return nil, fmt.Errorf("r.Client: expected map[string]interface{}")
		}
	}
	if _, ok := u.Object["mfa"]; ok {
		if rMfa, ok := u.Object["mfa"].(map[string]interface{}); ok {
			r.Mfa = &dclService.ConfigMfa{}
			if _, ok := rMfa["state"]; ok {
				if s, ok := rMfa["state"].(string); ok {
					r.Mfa.State = dclService.ConfigMfaStateEnumRef(s)
				} else {
					return nil, fmt.Errorf("r.Mfa.State: expected string")
				}
			}
		} else {
			return nil, fmt.Errorf("r.Mfa: expected map[string]interface{}")
		}
	}
	if _, ok := u.Object["monitoring"]; ok {
		if rMonitoring, ok := u.Object["monitoring"].(map[string]interface{}); ok {
			r.Monitoring = &dclService.ConfigMonitoring{}
			if _, ok := rMonitoring["requestLogging"]; ok {
				if rMonitoringRequestLogging, ok := rMonitoring["requestLogging"].(map[string]interface{}); ok {
					r.Monitoring.RequestLogging = &dclService.ConfigMonitoringRequestLogging{}
					if _, ok := rMonitoringRequestLogging["enabled"]; ok {
						if b, ok := rMonitoringRequestLogging["enabled"].(bool); ok {
							r.Monitoring.RequestLogging.Enabled = dcl.Bool(b)
						} else {
							return nil, fmt.Errorf("r.Monitoring.RequestLogging.Enabled: expected bool")
						}
					}
				} else {
					return nil, fmt.Errorf("r.Monitoring.RequestLogging: expected map[string]interface{}")
				}
			}
		} else {
			return nil, fmt.Errorf("r.Monitoring: expected map[string]interface{}")
		}
	}
	if _, ok := u.Object["multiTenant"]; ok {
		if rMultiTenant, ok := u.Object["multiTenant"].(map[string]interface{}); ok {
			r.MultiTenant = &dclService.ConfigMultiTenant{}
			if _, ok := rMultiTenant["allowTenants"]; ok {
				if b, ok := rMultiTenant["allowTenants"].(bool); ok {
					r.MultiTenant.AllowTenants = dcl.Bool(b)
				} else {
					return nil, fmt.Errorf("r.MultiTenant.AllowTenants: expected bool")
				}
			}
			if _, ok := rMultiTenant["defaultTenantLocation"]; ok {
				if s, ok := rMultiTenant["defaultTenantLocation"].(string); ok {
					r.MultiTenant.DefaultTenantLocation = dcl.String(s)
				} else {
					return nil, fmt.Errorf("r.MultiTenant.DefaultTenantLocation: expected string")
				}
			}
		} else {
			return nil, fmt.Errorf("r.MultiTenant: expected map[string]interface{}")
		}
	}
	if _, ok := u.Object["notification"]; ok {
		if rNotification, ok := u.Object["notification"].(map[string]interface{}); ok {
			r.Notification = &dclService.ConfigNotification{}
			if _, ok := rNotification["defaultLocale"]; ok {
				if s, ok := rNotification["defaultLocale"].(string); ok {
					r.Notification.DefaultLocale = dcl.String(s)
				} else {
					return nil, fmt.Errorf("r.Notification.DefaultLocale: expected string")
				}
			}
			if _, ok := rNotification["sendEmail"]; ok {
				if rNotificationSendEmail, ok := rNotification["sendEmail"].(map[string]interface{}); ok {
					r.Notification.SendEmail = &dclService.ConfigNotificationSendEmail{}
					if _, ok := rNotificationSendEmail["callbackUri"]; ok {
						if s, ok := rNotificationSendEmail["callbackUri"].(string); ok {
							r.Notification.SendEmail.CallbackUri = dcl.String(s)
						} else {
							return nil, fmt.Errorf("r.Notification.SendEmail.CallbackUri: expected string")
						}
					}
					if _, ok := rNotificationSendEmail["changeEmailTemplate"]; ok {
						if rNotificationSendEmailChangeEmailTemplate, ok := rNotificationSendEmail["changeEmailTemplate"].(map[string]interface{}); ok {
							r.Notification.SendEmail.ChangeEmailTemplate = &dclService.ConfigNotificationSendEmailChangeEmailTemplate{}
							if _, ok := rNotificationSendEmailChangeEmailTemplate["body"]; ok {
								if s, ok := rNotificationSendEmailChangeEmailTemplate["body"].(string); ok {
									r.Notification.SendEmail.ChangeEmailTemplate.Body = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.ChangeEmailTemplate.Body: expected string")
								}
							}
							if _, ok := rNotificationSendEmailChangeEmailTemplate["bodyFormat"]; ok {
								if s, ok := rNotificationSendEmailChangeEmailTemplate["bodyFormat"].(string); ok {
									r.Notification.SendEmail.ChangeEmailTemplate.BodyFormat = dclService.ConfigNotificationSendEmailChangeEmailTemplateBodyFormatEnumRef(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.ChangeEmailTemplate.BodyFormat: expected string")
								}
							}
							if _, ok := rNotificationSendEmailChangeEmailTemplate["customized"]; ok {
								if b, ok := rNotificationSendEmailChangeEmailTemplate["customized"].(bool); ok {
									r.Notification.SendEmail.ChangeEmailTemplate.Customized = dcl.Bool(b)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.ChangeEmailTemplate.Customized: expected bool")
								}
							}
							if _, ok := rNotificationSendEmailChangeEmailTemplate["replyTo"]; ok {
								if s, ok := rNotificationSendEmailChangeEmailTemplate["replyTo"].(string); ok {
									r.Notification.SendEmail.ChangeEmailTemplate.ReplyTo = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.ChangeEmailTemplate.ReplyTo: expected string")
								}
							}
							if _, ok := rNotificationSendEmailChangeEmailTemplate["senderDisplayName"]; ok {
								if s, ok := rNotificationSendEmailChangeEmailTemplate["senderDisplayName"].(string); ok {
									r.Notification.SendEmail.ChangeEmailTemplate.SenderDisplayName = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.ChangeEmailTemplate.SenderDisplayName: expected string")
								}
							}
							if _, ok := rNotificationSendEmailChangeEmailTemplate["senderLocalPart"]; ok {
								if s, ok := rNotificationSendEmailChangeEmailTemplate["senderLocalPart"].(string); ok {
									r.Notification.SendEmail.ChangeEmailTemplate.SenderLocalPart = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.ChangeEmailTemplate.SenderLocalPart: expected string")
								}
							}
							if _, ok := rNotificationSendEmailChangeEmailTemplate["subject"]; ok {
								if s, ok := rNotificationSendEmailChangeEmailTemplate["subject"].(string); ok {
									r.Notification.SendEmail.ChangeEmailTemplate.Subject = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.ChangeEmailTemplate.Subject: expected string")
								}
							}
						} else {
							return nil, fmt.Errorf("r.Notification.SendEmail.ChangeEmailTemplate: expected map[string]interface{}")
						}
					}
					if _, ok := rNotificationSendEmail["dnsInfo"]; ok {
						if rNotificationSendEmailDnsInfo, ok := rNotificationSendEmail["dnsInfo"].(map[string]interface{}); ok {
							r.Notification.SendEmail.DnsInfo = &dclService.ConfigNotificationSendEmailDnsInfo{}
							if _, ok := rNotificationSendEmailDnsInfo["customDomain"]; ok {
								if s, ok := rNotificationSendEmailDnsInfo["customDomain"].(string); ok {
									r.Notification.SendEmail.DnsInfo.CustomDomain = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.DnsInfo.CustomDomain: expected string")
								}
							}
							if _, ok := rNotificationSendEmailDnsInfo["customDomainState"]; ok {
								if s, ok := rNotificationSendEmailDnsInfo["customDomainState"].(string); ok {
									r.Notification.SendEmail.DnsInfo.CustomDomainState = dclService.ConfigNotificationSendEmailDnsInfoCustomDomainStateEnumRef(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.DnsInfo.CustomDomainState: expected string")
								}
							}
							if _, ok := rNotificationSendEmailDnsInfo["domainVerificationRequestTime"]; ok {
								if s, ok := rNotificationSendEmailDnsInfo["domainVerificationRequestTime"].(string); ok {
									r.Notification.SendEmail.DnsInfo.DomainVerificationRequestTime = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.DnsInfo.DomainVerificationRequestTime: expected string")
								}
							}
							if _, ok := rNotificationSendEmailDnsInfo["pendingCustomDomain"]; ok {
								if s, ok := rNotificationSendEmailDnsInfo["pendingCustomDomain"].(string); ok {
									r.Notification.SendEmail.DnsInfo.PendingCustomDomain = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.DnsInfo.PendingCustomDomain: expected string")
								}
							}
							if _, ok := rNotificationSendEmailDnsInfo["useCustomDomain"]; ok {
								if b, ok := rNotificationSendEmailDnsInfo["useCustomDomain"].(bool); ok {
									r.Notification.SendEmail.DnsInfo.UseCustomDomain = dcl.Bool(b)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.DnsInfo.UseCustomDomain: expected bool")
								}
							}
						} else {
							return nil, fmt.Errorf("r.Notification.SendEmail.DnsInfo: expected map[string]interface{}")
						}
					}
					if _, ok := rNotificationSendEmail["method"]; ok {
						if s, ok := rNotificationSendEmail["method"].(string); ok {
							r.Notification.SendEmail.Method = dclService.ConfigNotificationSendEmailMethodEnumRef(s)
						} else {
							return nil, fmt.Errorf("r.Notification.SendEmail.Method: expected string")
						}
					}
					if _, ok := rNotificationSendEmail["resetPasswordTemplate"]; ok {
						if rNotificationSendEmailResetPasswordTemplate, ok := rNotificationSendEmail["resetPasswordTemplate"].(map[string]interface{}); ok {
							r.Notification.SendEmail.ResetPasswordTemplate = &dclService.ConfigNotificationSendEmailResetPasswordTemplate{}
							if _, ok := rNotificationSendEmailResetPasswordTemplate["body"]; ok {
								if s, ok := rNotificationSendEmailResetPasswordTemplate["body"].(string); ok {
									r.Notification.SendEmail.ResetPasswordTemplate.Body = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.ResetPasswordTemplate.Body: expected string")
								}
							}
							if _, ok := rNotificationSendEmailResetPasswordTemplate["bodyFormat"]; ok {
								if s, ok := rNotificationSendEmailResetPasswordTemplate["bodyFormat"].(string); ok {
									r.Notification.SendEmail.ResetPasswordTemplate.BodyFormat = dclService.ConfigNotificationSendEmailResetPasswordTemplateBodyFormatEnumRef(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.ResetPasswordTemplate.BodyFormat: expected string")
								}
							}
							if _, ok := rNotificationSendEmailResetPasswordTemplate["customized"]; ok {
								if b, ok := rNotificationSendEmailResetPasswordTemplate["customized"].(bool); ok {
									r.Notification.SendEmail.ResetPasswordTemplate.Customized = dcl.Bool(b)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.ResetPasswordTemplate.Customized: expected bool")
								}
							}
							if _, ok := rNotificationSendEmailResetPasswordTemplate["replyTo"]; ok {
								if s, ok := rNotificationSendEmailResetPasswordTemplate["replyTo"].(string); ok {
									r.Notification.SendEmail.ResetPasswordTemplate.ReplyTo = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.ResetPasswordTemplate.ReplyTo: expected string")
								}
							}
							if _, ok := rNotificationSendEmailResetPasswordTemplate["senderDisplayName"]; ok {
								if s, ok := rNotificationSendEmailResetPasswordTemplate["senderDisplayName"].(string); ok {
									r.Notification.SendEmail.ResetPasswordTemplate.SenderDisplayName = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.ResetPasswordTemplate.SenderDisplayName: expected string")
								}
							}
							if _, ok := rNotificationSendEmailResetPasswordTemplate["senderLocalPart"]; ok {
								if s, ok := rNotificationSendEmailResetPasswordTemplate["senderLocalPart"].(string); ok {
									r.Notification.SendEmail.ResetPasswordTemplate.SenderLocalPart = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.ResetPasswordTemplate.SenderLocalPart: expected string")
								}
							}
							if _, ok := rNotificationSendEmailResetPasswordTemplate["subject"]; ok {
								if s, ok := rNotificationSendEmailResetPasswordTemplate["subject"].(string); ok {
									r.Notification.SendEmail.ResetPasswordTemplate.Subject = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.ResetPasswordTemplate.Subject: expected string")
								}
							}
						} else {
							return nil, fmt.Errorf("r.Notification.SendEmail.ResetPasswordTemplate: expected map[string]interface{}")
						}
					}
					if _, ok := rNotificationSendEmail["revertSecondFactorAdditionTemplate"]; ok {
						if rNotificationSendEmailRevertSecondFactorAdditionTemplate, ok := rNotificationSendEmail["revertSecondFactorAdditionTemplate"].(map[string]interface{}); ok {
							r.Notification.SendEmail.RevertSecondFactorAdditionTemplate = &dclService.ConfigNotificationSendEmailRevertSecondFactorAdditionTemplate{}
							if _, ok := rNotificationSendEmailRevertSecondFactorAdditionTemplate["body"]; ok {
								if s, ok := rNotificationSendEmailRevertSecondFactorAdditionTemplate["body"].(string); ok {
									r.Notification.SendEmail.RevertSecondFactorAdditionTemplate.Body = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.RevertSecondFactorAdditionTemplate.Body: expected string")
								}
							}
							if _, ok := rNotificationSendEmailRevertSecondFactorAdditionTemplate["bodyFormat"]; ok {
								if s, ok := rNotificationSendEmailRevertSecondFactorAdditionTemplate["bodyFormat"].(string); ok {
									r.Notification.SendEmail.RevertSecondFactorAdditionTemplate.BodyFormat = dclService.ConfigNotificationSendEmailRevertSecondFactorAdditionTemplateBodyFormatEnumRef(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.RevertSecondFactorAdditionTemplate.BodyFormat: expected string")
								}
							}
							if _, ok := rNotificationSendEmailRevertSecondFactorAdditionTemplate["customized"]; ok {
								if b, ok := rNotificationSendEmailRevertSecondFactorAdditionTemplate["customized"].(bool); ok {
									r.Notification.SendEmail.RevertSecondFactorAdditionTemplate.Customized = dcl.Bool(b)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.RevertSecondFactorAdditionTemplate.Customized: expected bool")
								}
							}
							if _, ok := rNotificationSendEmailRevertSecondFactorAdditionTemplate["replyTo"]; ok {
								if s, ok := rNotificationSendEmailRevertSecondFactorAdditionTemplate["replyTo"].(string); ok {
									r.Notification.SendEmail.RevertSecondFactorAdditionTemplate.ReplyTo = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.RevertSecondFactorAdditionTemplate.ReplyTo: expected string")
								}
							}
							if _, ok := rNotificationSendEmailRevertSecondFactorAdditionTemplate["senderDisplayName"]; ok {
								if s, ok := rNotificationSendEmailRevertSecondFactorAdditionTemplate["senderDisplayName"].(string); ok {
									r.Notification.SendEmail.RevertSecondFactorAdditionTemplate.SenderDisplayName = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.RevertSecondFactorAdditionTemplate.SenderDisplayName: expected string")
								}
							}
							if _, ok := rNotificationSendEmailRevertSecondFactorAdditionTemplate["senderLocalPart"]; ok {
								if s, ok := rNotificationSendEmailRevertSecondFactorAdditionTemplate["senderLocalPart"].(string); ok {
									r.Notification.SendEmail.RevertSecondFactorAdditionTemplate.SenderLocalPart = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.RevertSecondFactorAdditionTemplate.SenderLocalPart: expected string")
								}
							}
							if _, ok := rNotificationSendEmailRevertSecondFactorAdditionTemplate["subject"]; ok {
								if s, ok := rNotificationSendEmailRevertSecondFactorAdditionTemplate["subject"].(string); ok {
									r.Notification.SendEmail.RevertSecondFactorAdditionTemplate.Subject = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.RevertSecondFactorAdditionTemplate.Subject: expected string")
								}
							}
						} else {
							return nil, fmt.Errorf("r.Notification.SendEmail.RevertSecondFactorAdditionTemplate: expected map[string]interface{}")
						}
					}
					if _, ok := rNotificationSendEmail["smtp"]; ok {
						if rNotificationSendEmailSmtp, ok := rNotificationSendEmail["smtp"].(map[string]interface{}); ok {
							r.Notification.SendEmail.Smtp = &dclService.ConfigNotificationSendEmailSmtp{}
							if _, ok := rNotificationSendEmailSmtp["host"]; ok {
								if s, ok := rNotificationSendEmailSmtp["host"].(string); ok {
									r.Notification.SendEmail.Smtp.Host = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.Smtp.Host: expected string")
								}
							}
							if _, ok := rNotificationSendEmailSmtp["password"]; ok {
								if s, ok := rNotificationSendEmailSmtp["password"].(string); ok {
									r.Notification.SendEmail.Smtp.Password = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.Smtp.Password: expected string")
								}
							}
							if _, ok := rNotificationSendEmailSmtp["port"]; ok {
								if i, ok := rNotificationSendEmailSmtp["port"].(int64); ok {
									r.Notification.SendEmail.Smtp.Port = dcl.Int64(i)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.Smtp.Port: expected int64")
								}
							}
							if _, ok := rNotificationSendEmailSmtp["securityMode"]; ok {
								if s, ok := rNotificationSendEmailSmtp["securityMode"].(string); ok {
									r.Notification.SendEmail.Smtp.SecurityMode = dclService.ConfigNotificationSendEmailSmtpSecurityModeEnumRef(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.Smtp.SecurityMode: expected string")
								}
							}
							if _, ok := rNotificationSendEmailSmtp["senderEmail"]; ok {
								if s, ok := rNotificationSendEmailSmtp["senderEmail"].(string); ok {
									r.Notification.SendEmail.Smtp.SenderEmail = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.Smtp.SenderEmail: expected string")
								}
							}
							if _, ok := rNotificationSendEmailSmtp["username"]; ok {
								if s, ok := rNotificationSendEmailSmtp["username"].(string); ok {
									r.Notification.SendEmail.Smtp.Username = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.Smtp.Username: expected string")
								}
							}
						} else {
							return nil, fmt.Errorf("r.Notification.SendEmail.Smtp: expected map[string]interface{}")
						}
					}
					if _, ok := rNotificationSendEmail["verifyEmailTemplate"]; ok {
						if rNotificationSendEmailVerifyEmailTemplate, ok := rNotificationSendEmail["verifyEmailTemplate"].(map[string]interface{}); ok {
							r.Notification.SendEmail.VerifyEmailTemplate = &dclService.ConfigNotificationSendEmailVerifyEmailTemplate{}
							if _, ok := rNotificationSendEmailVerifyEmailTemplate["body"]; ok {
								if s, ok := rNotificationSendEmailVerifyEmailTemplate["body"].(string); ok {
									r.Notification.SendEmail.VerifyEmailTemplate.Body = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.VerifyEmailTemplate.Body: expected string")
								}
							}
							if _, ok := rNotificationSendEmailVerifyEmailTemplate["bodyFormat"]; ok {
								if s, ok := rNotificationSendEmailVerifyEmailTemplate["bodyFormat"].(string); ok {
									r.Notification.SendEmail.VerifyEmailTemplate.BodyFormat = dclService.ConfigNotificationSendEmailVerifyEmailTemplateBodyFormatEnumRef(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.VerifyEmailTemplate.BodyFormat: expected string")
								}
							}
							if _, ok := rNotificationSendEmailVerifyEmailTemplate["customized"]; ok {
								if b, ok := rNotificationSendEmailVerifyEmailTemplate["customized"].(bool); ok {
									r.Notification.SendEmail.VerifyEmailTemplate.Customized = dcl.Bool(b)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.VerifyEmailTemplate.Customized: expected bool")
								}
							}
							if _, ok := rNotificationSendEmailVerifyEmailTemplate["replyTo"]; ok {
								if s, ok := rNotificationSendEmailVerifyEmailTemplate["replyTo"].(string); ok {
									r.Notification.SendEmail.VerifyEmailTemplate.ReplyTo = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.VerifyEmailTemplate.ReplyTo: expected string")
								}
							}
							if _, ok := rNotificationSendEmailVerifyEmailTemplate["senderDisplayName"]; ok {
								if s, ok := rNotificationSendEmailVerifyEmailTemplate["senderDisplayName"].(string); ok {
									r.Notification.SendEmail.VerifyEmailTemplate.SenderDisplayName = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.VerifyEmailTemplate.SenderDisplayName: expected string")
								}
							}
							if _, ok := rNotificationSendEmailVerifyEmailTemplate["senderLocalPart"]; ok {
								if s, ok := rNotificationSendEmailVerifyEmailTemplate["senderLocalPart"].(string); ok {
									r.Notification.SendEmail.VerifyEmailTemplate.SenderLocalPart = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.VerifyEmailTemplate.SenderLocalPart: expected string")
								}
							}
							if _, ok := rNotificationSendEmailVerifyEmailTemplate["subject"]; ok {
								if s, ok := rNotificationSendEmailVerifyEmailTemplate["subject"].(string); ok {
									r.Notification.SendEmail.VerifyEmailTemplate.Subject = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendEmail.VerifyEmailTemplate.Subject: expected string")
								}
							}
						} else {
							return nil, fmt.Errorf("r.Notification.SendEmail.VerifyEmailTemplate: expected map[string]interface{}")
						}
					}
				} else {
					return nil, fmt.Errorf("r.Notification.SendEmail: expected map[string]interface{}")
				}
			}
			if _, ok := rNotification["sendSms"]; ok {
				if rNotificationSendSms, ok := rNotification["sendSms"].(map[string]interface{}); ok {
					r.Notification.SendSms = &dclService.ConfigNotificationSendSms{}
					if _, ok := rNotificationSendSms["smsTemplate"]; ok {
						if rNotificationSendSmsSmsTemplate, ok := rNotificationSendSms["smsTemplate"].(map[string]interface{}); ok {
							r.Notification.SendSms.SmsTemplate = &dclService.ConfigNotificationSendSmsSmsTemplate{}
							if _, ok := rNotificationSendSmsSmsTemplate["content"]; ok {
								if s, ok := rNotificationSendSmsSmsTemplate["content"].(string); ok {
									r.Notification.SendSms.SmsTemplate.Content = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.Notification.SendSms.SmsTemplate.Content: expected string")
								}
							}
						} else {
							return nil, fmt.Errorf("r.Notification.SendSms.SmsTemplate: expected map[string]interface{}")
						}
					}
					if _, ok := rNotificationSendSms["useDeviceLocale"]; ok {
						if b, ok := rNotificationSendSms["useDeviceLocale"].(bool); ok {
							r.Notification.SendSms.UseDeviceLocale = dcl.Bool(b)
						} else {
							return nil, fmt.Errorf("r.Notification.SendSms.UseDeviceLocale: expected bool")
						}
					}
				} else {
					return nil, fmt.Errorf("r.Notification.SendSms: expected map[string]interface{}")
				}
			}
		} else {
			return nil, fmt.Errorf("r.Notification: expected map[string]interface{}")
		}
	}
	if _, ok := u.Object["project"]; ok {
		if s, ok := u.Object["project"].(string); ok {
			r.Project = dcl.String(s)
		} else {
			return nil, fmt.Errorf("r.Project: expected string")
		}
	}
	if _, ok := u.Object["quota"]; ok {
		if rQuota, ok := u.Object["quota"].(map[string]interface{}); ok {
			r.Quota = &dclService.ConfigQuota{}
			if _, ok := rQuota["signUpQuotaConfig"]; ok {
				if rQuotaSignUpQuotaConfig, ok := rQuota["signUpQuotaConfig"].(map[string]interface{}); ok {
					r.Quota.SignUpQuotaConfig = &dclService.ConfigQuotaSignUpQuotaConfig{}
					if _, ok := rQuotaSignUpQuotaConfig["quota"]; ok {
						if i, ok := rQuotaSignUpQuotaConfig["quota"].(int64); ok {
							r.Quota.SignUpQuotaConfig.Quota = dcl.Int64(i)
						} else {
							return nil, fmt.Errorf("r.Quota.SignUpQuotaConfig.Quota: expected int64")
						}
					}
					if _, ok := rQuotaSignUpQuotaConfig["quotaDuration"]; ok {
						if s, ok := rQuotaSignUpQuotaConfig["quotaDuration"].(string); ok {
							r.Quota.SignUpQuotaConfig.QuotaDuration = dcl.String(s)
						} else {
							return nil, fmt.Errorf("r.Quota.SignUpQuotaConfig.QuotaDuration: expected string")
						}
					}
					if _, ok := rQuotaSignUpQuotaConfig["startTime"]; ok {
						if s, ok := rQuotaSignUpQuotaConfig["startTime"].(string); ok {
							r.Quota.SignUpQuotaConfig.StartTime = dcl.String(s)
						} else {
							return nil, fmt.Errorf("r.Quota.SignUpQuotaConfig.StartTime: expected string")
						}
					}
				} else {
					return nil, fmt.Errorf("r.Quota.SignUpQuotaConfig: expected map[string]interface{}")
				}
			}
		} else {
			return nil, fmt.Errorf("r.Quota: expected map[string]interface{}")
		}
	}
	if _, ok := u.Object["signIn"]; ok {
		if rSignIn, ok := u.Object["signIn"].(map[string]interface{}); ok {
			r.SignIn = &dclService.ConfigSignIn{}
			if _, ok := rSignIn["allowDuplicateEmails"]; ok {
				if b, ok := rSignIn["allowDuplicateEmails"].(bool); ok {
					r.SignIn.AllowDuplicateEmails = dcl.Bool(b)
				} else {
					return nil, fmt.Errorf("r.SignIn.AllowDuplicateEmails: expected bool")
				}
			}
			if _, ok := rSignIn["anonymous"]; ok {
				if rSignInAnonymous, ok := rSignIn["anonymous"].(map[string]interface{}); ok {
					r.SignIn.Anonymous = &dclService.ConfigSignInAnonymous{}
					if _, ok := rSignInAnonymous["enabled"]; ok {
						if b, ok := rSignInAnonymous["enabled"].(bool); ok {
							r.SignIn.Anonymous.Enabled = dcl.Bool(b)
						} else {
							return nil, fmt.Errorf("r.SignIn.Anonymous.Enabled: expected bool")
						}
					}
				} else {
					return nil, fmt.Errorf("r.SignIn.Anonymous: expected map[string]interface{}")
				}
			}
			if _, ok := rSignIn["email"]; ok {
				if rSignInEmail, ok := rSignIn["email"].(map[string]interface{}); ok {
					r.SignIn.Email = &dclService.ConfigSignInEmail{}
					if _, ok := rSignInEmail["enabled"]; ok {
						if b, ok := rSignInEmail["enabled"].(bool); ok {
							r.SignIn.Email.Enabled = dcl.Bool(b)
						} else {
							return nil, fmt.Errorf("r.SignIn.Email.Enabled: expected bool")
						}
					}
					if _, ok := rSignInEmail["hashConfig"]; ok {
						if rSignInEmailHashConfig, ok := rSignInEmail["hashConfig"].(map[string]interface{}); ok {
							r.SignIn.Email.HashConfig = &dclService.ConfigSignInEmailHashConfig{}
							if _, ok := rSignInEmailHashConfig["algorithm"]; ok {
								if s, ok := rSignInEmailHashConfig["algorithm"].(string); ok {
									r.SignIn.Email.HashConfig.Algorithm = dclService.ConfigSignInEmailHashConfigAlgorithmEnumRef(s)
								} else {
									return nil, fmt.Errorf("r.SignIn.Email.HashConfig.Algorithm: expected string")
								}
							}
							if _, ok := rSignInEmailHashConfig["memoryCost"]; ok {
								if i, ok := rSignInEmailHashConfig["memoryCost"].(int64); ok {
									r.SignIn.Email.HashConfig.MemoryCost = dcl.Int64(i)
								} else {
									return nil, fmt.Errorf("r.SignIn.Email.HashConfig.MemoryCost: expected int64")
								}
							}
							if _, ok := rSignInEmailHashConfig["rounds"]; ok {
								if i, ok := rSignInEmailHashConfig["rounds"].(int64); ok {
									r.SignIn.Email.HashConfig.Rounds = dcl.Int64(i)
								} else {
									return nil, fmt.Errorf("r.SignIn.Email.HashConfig.Rounds: expected int64")
								}
							}
							if _, ok := rSignInEmailHashConfig["saltSeparator"]; ok {
								if s, ok := rSignInEmailHashConfig["saltSeparator"].(string); ok {
									r.SignIn.Email.HashConfig.SaltSeparator = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.SignIn.Email.HashConfig.SaltSeparator: expected string")
								}
							}
							if _, ok := rSignInEmailHashConfig["signerKey"]; ok {
								if s, ok := rSignInEmailHashConfig["signerKey"].(string); ok {
									r.SignIn.Email.HashConfig.SignerKey = dcl.String(s)
								} else {
									return nil, fmt.Errorf("r.SignIn.Email.HashConfig.SignerKey: expected string")
								}
							}
						} else {
							return nil, fmt.Errorf("r.SignIn.Email.HashConfig: expected map[string]interface{}")
						}
					}
					if _, ok := rSignInEmail["passwordRequired"]; ok {
						if b, ok := rSignInEmail["passwordRequired"].(bool); ok {
							r.SignIn.Email.PasswordRequired = dcl.Bool(b)
						} else {
							return nil, fmt.Errorf("r.SignIn.Email.PasswordRequired: expected bool")
						}
					}
				} else {
					return nil, fmt.Errorf("r.SignIn.Email: expected map[string]interface{}")
				}
			}
			if _, ok := rSignIn["hashConfig"]; ok {
				if rSignInHashConfig, ok := rSignIn["hashConfig"].(map[string]interface{}); ok {
					r.SignIn.HashConfig = &dclService.ConfigSignInHashConfig{}
					if _, ok := rSignInHashConfig["algorithm"]; ok {
						if s, ok := rSignInHashConfig["algorithm"].(string); ok {
							r.SignIn.HashConfig.Algorithm = dclService.ConfigSignInHashConfigAlgorithmEnumRef(s)
						} else {
							return nil, fmt.Errorf("r.SignIn.HashConfig.Algorithm: expected string")
						}
					}
					if _, ok := rSignInHashConfig["memoryCost"]; ok {
						if i, ok := rSignInHashConfig["memoryCost"].(int64); ok {
							r.SignIn.HashConfig.MemoryCost = dcl.Int64(i)
						} else {
							return nil, fmt.Errorf("r.SignIn.HashConfig.MemoryCost: expected int64")
						}
					}
					if _, ok := rSignInHashConfig["rounds"]; ok {
						if i, ok := rSignInHashConfig["rounds"].(int64); ok {
							r.SignIn.HashConfig.Rounds = dcl.Int64(i)
						} else {
							return nil, fmt.Errorf("r.SignIn.HashConfig.Rounds: expected int64")
						}
					}
					if _, ok := rSignInHashConfig["saltSeparator"]; ok {
						if s, ok := rSignInHashConfig["saltSeparator"].(string); ok {
							r.SignIn.HashConfig.SaltSeparator = dcl.String(s)
						} else {
							return nil, fmt.Errorf("r.SignIn.HashConfig.SaltSeparator: expected string")
						}
					}
					if _, ok := rSignInHashConfig["signerKey"]; ok {
						if s, ok := rSignInHashConfig["signerKey"].(string); ok {
							r.SignIn.HashConfig.SignerKey = dcl.String(s)
						} else {
							return nil, fmt.Errorf("r.SignIn.HashConfig.SignerKey: expected string")
						}
					}
				} else {
					return nil, fmt.Errorf("r.SignIn.HashConfig: expected map[string]interface{}")
				}
			}
			if _, ok := rSignIn["phoneNumber"]; ok {
				if rSignInPhoneNumber, ok := rSignIn["phoneNumber"].(map[string]interface{}); ok {
					r.SignIn.PhoneNumber = &dclService.ConfigSignInPhoneNumber{}
					if _, ok := rSignInPhoneNumber["enabled"]; ok {
						if b, ok := rSignInPhoneNumber["enabled"].(bool); ok {
							r.SignIn.PhoneNumber.Enabled = dcl.Bool(b)
						} else {
							return nil, fmt.Errorf("r.SignIn.PhoneNumber.Enabled: expected bool")
						}
					}
					if _, ok := rSignInPhoneNumber["testPhoneNumbers"]; ok {
						if rSignInPhoneNumberTestPhoneNumbers, ok := rSignInPhoneNumber["testPhoneNumbers"].(map[string]interface{}); ok {
							m := make(map[string]string)
							for k, v := range rSignInPhoneNumberTestPhoneNumbers {
								if s, ok := v.(string); ok {
									m[k] = s
								}
							}
							r.SignIn.PhoneNumber.TestPhoneNumbers = m
						} else {
							return nil, fmt.Errorf("r.SignIn.PhoneNumber.TestPhoneNumbers: expected map[string]interface{}")
						}
					}
				} else {
					return nil, fmt.Errorf("r.SignIn.PhoneNumber: expected map[string]interface{}")
				}
			}
		} else {
			return nil, fmt.Errorf("r.SignIn: expected map[string]interface{}")
		}
	}
	if _, ok := u.Object["subtype"]; ok {
		if s, ok := u.Object["subtype"].(string); ok {
			r.Subtype = dclService.ConfigSubtypeEnumRef(s)
		} else {
			return nil, fmt.Errorf("r.Subtype: expected string")
		}
	}
	return r, nil
}