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

Choose a canonical names for services #462

Open
omus opened this issue Sep 27, 2021 · 1 comment
Open

Choose a canonical names for services #462

omus opened this issue Sep 27, 2021 · 1 comment

Comments

@omus
Copy link
Member

omus commented Sep 27, 2021

Right now @service supports allowing the user to define the casing used for the module name:

AWS.jl/src/AWS.jl

Lines 113 to 116 in ca6b550

# All of the examples below are valid!
@service Secrets_Manager
@service SECRETS_MANAGER
@service sECRETS_MANAGER

If we implement #435 we should probably choose a single canonical spelling for each service instead of having the user be able to specify their own.

I think going with the standard Julia module naming convention is the correct approach which would result in:

ServiceId Proposed Module Name Current Module Name
S3 S3 s3
Secrets Manager SecretsManager secrets_manager
ACM PCA ACMPCA acm_pca
@omus
Copy link
Member Author

omus commented Sep 27, 2021

Proposal for an backwards compatible implementation:

  1. When generating the high-level API file names keep the casing as defined by the ServiceId and keep the whitespace.
  2. Generate a mapping of lowercase service names to the high-level API file name that have entries using underscore or no space separator (e.g. "secretsmanager" => "Secrets Manager.jl", "secrets_manager" => "Secrets Manager.jl")
  3. When using @service lower case the specified module name and use the mapping to determine the service file name.
  4. If the module name passed into @service (prior to lower casing) does not match the service name (the service file name with spaces and the extension removed) then emit a deprecation warning

This should keep the current behaviour and also allow the use of the new proposed module names

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants