Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a toString method for S3EventNotificationRecord class #301

Open
ashunimbz opened this issue Jan 2, 2022 · 2 comments
Open

Add a toString method for S3EventNotificationRecord class #301

ashunimbz opened this issue Jan 2, 2022 · 2 comments
Labels
events-v4 To be pulled into aws-lambda-java-event v4

Comments

@ashunimbz
Copy link

ashunimbz commented Jan 2, 2022

Currently while logging S3Event instance , toString just logs hash code .

S3Event toString() method in turn calls S3EventNotificationRecord toString() method which is not present . Hence it defaults to plain objects toString() method which in turn just logs hash code rendering toString() method of S3Event class useless .

public class S3Event extends S3EventNotification implements Serializable, Cloneable {

@ashunimbz ashunimbz changed the title Add a toString method for S3EventNotification class Add a toString method for S3EventNotificationRecord class Jan 2, 2022
@msailes
Copy link
Collaborator

msailes commented Jan 4, 2022

I've created a pull request #302

The output is quite verbose, maybe there are improvements which could be main.

{
   [
      S3EventNotificationRecord{
         "awsRegion=""eu-central-1",
         "eventName=""ObjectCreated:Put",
         "eventSource=""aws:s3",
         "eventTime=1970-01-01T00":"00":00.000Z,
         "eventVersion=""2.0",
         "requestParameters=RequestParametersEntity"{
            "sourceIPAddress=""127.0.0.1"
         },
         "responseElements=ResponseElementsEntity"{
            xAmzId2="EXAMPLE123/5678abcdefghijklambdaisawesome/mnopqrstuvwxyzABCDEFGH",
            "xAmzRequestId=""EXAMPLE123456789"
         },
         s3=S3Entity{
            "configurationId=""testConfigRule",
            bucket=S3BucketEntity{
               "name=""example-bucket",
               "ownerIdentity=UserIdentityEntity"{
                  "principalId=""EXAMPLE"
               },
               "arn=""arn:aws:s3:::example-bucket"
            },
            object=S3ObjectEntity{
               "key=""test/key",
               size=1024,
               "eTag=""0123456789abcdef0123456789abcdef",
               "versionId=""",
               "sequencer=""0A1B2C3D4E5F678901"
            },
            s3SchemaVersion="1.0"
         },
         "userIdentity=UserIdentityEntity"{
            "principalId=""EXAMPLE"
         }
      }
   ]
}

@msailes msailes added the events-v4 To be pulled into aws-lambda-java-event v4 label May 6, 2022
@msailes
Copy link
Collaborator

msailes commented May 6, 2022

This will be fixed in v4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
events-v4 To be pulled into aws-lambda-java-event v4
Projects
None yet
Development

No branches or pull requests

2 participants