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

Some new methods: #237

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open

Conversation

mikkohirvonen
Copy link
Contributor

dcv using email method
dcv.all
acme.get_domais

@mikkohirvonen mikkohirvonen requested a review from a team as a code owner September 30, 2024 13:11
Comment on lines 178 to 199
def get_domains (self, acme_id, **kwargs):
"""List ACME account’s domains.

:param int acme_id: The ID of the acme account to list domains
"""
self.__acc_domains = []
result = self.__find_domains(acme_id)
for dom in result:
self.__acc_domains.append(dom)
return self.__acc_domains

@paginate
def __find_domains(self, acme_id, **kwargs):

params = {
self._find_params_to_api[param]: kwargs.get(param)
for param in self._find_params_to_api # pylint:disable=consider-using-dict-items
}
url = self._url(f"{acme_id}", "domain")
result = self._client.get(url, params=params)
return result.json()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should all probably be one function named get_domains that uses the @paginate wrapper. Additionally, we probably shouldn't cache the results in self.__acc_domains since this data would change if a different ACME ID was provided, correct? This should probably just accumulate a list of domains in a local variable and then return at the end.

do not store results
DomainControlValidation.all use search instead __search
Remove __search method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants