ParseGetAdminAuditResponse parses an HTTP response from a GetAdminAuditWithResponse call
(rsp *http.Response)
| 1984 | |
| 1985 | // ParseGetAdminAuditResponse parses an HTTP response from a GetAdminAuditWithResponse call |
| 1986 | func ParseGetAdminAuditResponse(rsp *http.Response) (*GetAdminAuditResponse, error) { |
| 1987 | bodyBytes, err := io.ReadAll(rsp.Body) |
| 1988 | defer func() { _ = rsp.Body.Close() }() |
| 1989 | if err != nil { |
| 1990 | return nil, err |
| 1991 | } |
| 1992 | |
| 1993 | response := &GetAdminAuditResponse{ |
| 1994 | Body: bodyBytes, |
| 1995 | HTTPResponse: rsp, |
| 1996 | } |
| 1997 | |
| 1998 | switch { |
| 1999 | case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: |
| 2000 | var dest []struct { |
| 2001 | CreatedAt *time.Time `json:"created_at,omitempty"` |
| 2002 | Id *openapi_types.UUID `json:"id,omitempty"` |
| 2003 | IpAddress *string `json:"ip_address,omitempty"` |
| 2004 | Payload *struct { |
| 2005 | // Action Usually one of these values: |
| 2006 | // - login |
| 2007 | // - logout |
| 2008 | // - invite_accepted |
| 2009 | // - user_signedup |
| 2010 | // - user_invited |
| 2011 | // - user_deleted |
| 2012 | // - user_modified |
| 2013 | // - user_recovery_requested |
| 2014 | // - user_reauthenticate_requested |
| 2015 | // - user_confirmation_requested |
| 2016 | // - user_repeated_signup |
| 2017 | // - user_updated_password |
| 2018 | // - token_revoked |
| 2019 | // - token_refreshed |
| 2020 | // - generate_recovery_codes |
| 2021 | // - factor_in_progress |
| 2022 | // - factor_unenrolled |
| 2023 | // - challenge_created |
| 2024 | // - verification_attempted |
| 2025 | // - factor_deleted |
| 2026 | // - recovery_codes_deleted |
| 2027 | // - factor_updated |
| 2028 | // - mfa_code_login |
| 2029 | Action *string `json:"action,omitempty"` |
| 2030 | ActorId *string `json:"actor_id,omitempty"` |
| 2031 | ActorName *string `json:"actor_name,omitempty"` |
| 2032 | ActorUsername *string `json:"actor_username,omitempty"` |
| 2033 | |
| 2034 | // ActorViaSso Whether the actor used a SSO protocol (like SAML 2.0 or OIDC) to authenticate. |
| 2035 | ActorViaSso *bool `json:"actor_via_sso,omitempty"` |
| 2036 | |
| 2037 | // LogType Usually one of these values: |
| 2038 | // - account |
| 2039 | // - team |
| 2040 | // - token |
| 2041 | // - user |
| 2042 | // - factor |
| 2043 | // - recovery_codes |
no test coverage detected
searching dependent graphs…