Closed jacegu closed 8 years ago
We can't apply it consistently, because it depends on what the API can offer. Some API methods can detect the account automatically, others can't.
We should default to the wildcard only when the method allows it.
I didn't know that... Is this explained somewhere in the docs? Are there rules to know which ones are the ones that can use it (besides looking at the developer docs)?
The general rule is that whenever there is a secondary resource attached to account and we have an unique identifier, we are generally able to detect the account from it.
This is the case of reading a contact or a domain. It's not the case of a template (when given by short name), because that's not a completely unique identifier.
The docs should expose such information. For example see https://developer.dnsimple.com/v2/domains/#get
:account integer The account id or wildcard (_)
Closing as this is not posible as @weppos explained.
Some functions define a default value for the
account_id
parameter (account_id \\ Dnsimple.Client.__WILDCARD_ACCOUNT
) while others don't define a default value. We should apply one approach or the other consistently.