-
Notifications
You must be signed in to change notification settings - Fork 909
Generation region/service metadata #759
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add those diff tests for the new generated classes? Also do we still support custom endpoint files at runtime?
Could we rename the generated metadata file to something like BatchServiceMetadata? |
Can the region class itself be generated? |
Will add diff tests. Fine with adding ServiceMetadata suffix. Can switch Region to be generated as well. |
core/regions/pom.xml
Outdated
</build> | ||
|
||
<profiles> | ||
<!-- Build steps executed for services with models --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you explain what this does? not quite getting it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is slightly incorrect as I just copied it from the other but it's just the configuration for running the codegen-lite-maven-plugin. It's exactly copied from the pom.xml of the services module just with the "lite" version.
@Generated("software.amazon.awssdk:codegen") | ||
@SdkPublicApi | ||
public final class ServiceMetadataProvider { | ||
private static final Map<String, ServiceMetadata> SERVICE_METADATA = Collections.unmodifiableMap(Stream.of( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use ImmutableMap.Builder here? I feel like that would cut down on the verbosity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can do.
import software.amazon.awssdk.annotations.SdkPublicApi; | ||
import software.amazon.awssdk.utils.Validate; | ||
|
||
/** | ||
* An Amazon Web Services region that hosts a set of Amazon services. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep the docs in the generated version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes. This was just a miss.
|
||
@Generated("software.amazon.awssdk:codegen") | ||
@SdkPublicApi | ||
public final class RegionMetadataProvider { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we keep this an interface if we decide to support runtime discovery later on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Will do.
4e5786e
to
2bb3232
Compare
…ebd93e04 Pull request: release <- staging/28b5df1f-0704-4b85-828f-760bebd93e04
Introduces two new modules, codegen-lite and codegen-lite-maven-plugin in order to be able to generate region and service metadata for the regions module.
Could also refactor codegen-lite into codegen-core and move the core non-service related codegen files to this module