paws-r / paws

Paws, a package for Amazon Web Services in R
https://www.paws-r-sdk.com
Other
314 stars 37 forks source link

Config flatten #639

Closed DyfanJones closed 1 year ago

DyfanJones commented 1 year ago

Initial idea for flattening the config list for initialising services (ticket: https://github.com/paws-r/paws/issues/421)

proposal 2

svc(config = list(), ...)
# current config list
s3  <- paws::s3(config = list(credentials = list(profile = "dummy"), region = "us-east-1"))

# flatten config short hand
s3  <- paws::s3(profile = "dummy", region = "us-east-1")

# flatten config short hand and config list together
s3  <- paws::s3(config = list(region = "us-east-1"), profile = "dummy")

Downside: Doesn't help with auto-complete as the short hand utilises ... instead of individual parameters.

Upside: Allows the short hand method to keep up to date with any parameters that get added to the paws.common backend.

DyfanJones commented 1 year ago

@davidkretch What's your view on this? I am just toying around with this idea so not tied to it as of yet.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage has no change and project coverage change: -0.23 :warning:

Comparison is base (71c6594) 83.88% compared to head (fe8384c) 83.66%.

:exclamation: Current head fe8384c differs from pull request most recent head c3fb7d8. Consider uploading reports for the commit c3fb7d8 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #639 +/- ## ========================================== - Coverage 83.88% 83.66% -0.23% ========================================== Files 189 195 +6 Lines 12934 13213 +279 ========================================== + Hits 10850 11054 +204 - Misses 2084 2159 +75 ``` [see 21 files with indirect coverage changes](https://app.codecov.io/gh/paws-r/paws/pull/639/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=paws-r)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

DyfanJones commented 1 year ago

After discussion in https://github.com/paws-r/paws/issues/421 will go for proposal 1. As it helps with auto-complete when initialising service.

svc <- acm(
  config = list(),
  credentials = list(
    creds = list(
      access_key_id = "string",
      secret_access_key = "string",
      session_token = "string"
    ),
    profile = "string"
  ),
  endpoint = "string",
  region = "string"
)