[AWS Lambda] Add request-id as header to Lambda start/end invocation by rithikanarayan · Pull Request #7835 · DataDog/dd-trace-dotnet

@rithikanarayan

## Summary of changes
Cast object state to CallTargetState earlier in its usage to add type
safety. Added type checks combined with variable declarations when using
the state and scope attributes of CallTargetState.

## Reason for change
Merged [earlier PR adding request id
headers](#7835) to start
and end invocation calls to the lambda extension, needed to improve code
quality post-merge.

## Implementation details

## Test coverage

## Other details
<!-- Fixes #{issue} -->


<!--  ⚠️ Note:

Where possible, please obtain 2 approvals prior to merging. Unless
CODEOWNERS specifies otherwise, for external teams it is typically best
to have one review from a team member, and one review from apm-dotnet.
Trivial changes do not require 2 reviews.

MergeQueue is NOT enabled in this repository. If you have write access
to the repo, the PR has 1-2 approvals (see above), and all of the
required checks have passed, you can use the Squash and Merge button to
merge the PR. If you don't have write access, or you need help, reach
out in the #apm-dotnet channel in Slack.
-->