If you’re just starting out and learning Java, avoid the temptation of defining anything as static until you understand what this modifier does and why/when you need to use it: no static Class properties, no static methods.
The only use of static while you’re starting out is in your main method. You don’t need it anywhere else. You’ll avoid a lot of unexpected and unexplainable behavior as a result.
I’ve been sharing updates on updating my AWS Lambdas related to my Twitter bot projects recently and I’ve still got a way to go. Just leaving this here as a reminder. Still got a lot of Lambdas that I haven’t touched for years running on long out of support Node runtimes:
The docs for the Mastodon APIs are pretty good, but there’s a surprising lack of working examples online (compared to using the Twitter APIs) which means starting out I’ve been stumped several times already trying to work out how to what seem to be simple things.
Publishing a new status (a ‘Toot’, equivalent in Twitter terms to a ‘Tweet’), is easy enough with POST /statuses . Getting a list of who has mentioned you in a status was not that obvious though.
I took a look at getting my timeline with various options, using GET /timelines, before realizing what I was probably looking for was GET /notifications which can be filtered by various types, including mentions, using
Note the types array parameter with  following the name. I haven’t seen this convention used before, but this is described in the docs here.
Most of the APIs returning statuses look like this:
// details about the account that posted this status
//content of the status here, as HTML
Note that the type=mention here, as this is what we filtered for with the types= parameter.
Migrating my @kevinhookebot Twitter bot to Mastodon, I made some updates to how the Lambda queries a source DynamoDB table for new messages to be posted and ran into this error:
"errorMessage": "User: arn:aws:sts::account-id:assumed-role/lambda-kevinhookebot-role/kevinhooketwitterbot-v2-dev-sendTweet is not authorized to perform: dynamodb:Query on resource: arn:aws:dynamodb:us-west-1:account-id:table/tweetbottweets/index/tweetdate-createdate-index because no identity-based policy allows the dynamodb:Query action"
The IAM role I’m reusing does have dynamodb:Query, but only on these resources: