Skip to content

Small issue: CognitoEventUserPoolsMigrateUser request/response fields are not named #429

Open
@johanlunds

Description

@johanlunds

Other Cognito event structs look like:

type CognitoEventUserPoolsPostAuthentication struct {
	CognitoEventUserPoolsHeader
	Request  CognitoEventUserPoolsPostAuthenticationRequest  `json:"request"`
	Response CognitoEventUserPoolsPostAuthenticationResponse `json:"response"`
}

But CognitoEventUserPoolsMigrateUser is defined as:

type CognitoEventUserPoolsMigrateUser struct {
	CognitoEventUserPoolsHeader
	CognitoEventUserPoolsMigrateUserRequest  `json:"request"`
	CognitoEventUserPoolsMigrateUserResponse `json:"response"`
}

So instead of event.Response.UserAttributes you have to do either event.UserAttributes or event.CognitoEventUserPoolsMigrateUserResponse.UserAttributes which both look a bit weird to me and is a bit inconsistent with the other event definitions?

Is this intentional or just a miss?

My suggestion is to change the definition to:

type CognitoEventUserPoolsMigrateUser struct {
	CognitoEventUserPoolsHeader
	Request CognitoEventUserPoolsMigrateUserRequest  `json:"request"`
	Response CognitoEventUserPoolsMigrateUserResponse `json:"response"`
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions