Skip to content

Commit

Permalink
Merge pull request #131 from CitizenNineCoding/feature/app-acm
Browse files Browse the repository at this point in the history
Feature Enhancement: ACM actions for App object
  • Loading branch information
martyzz1 committed Apr 17, 2023
2 parents 1370af5 + 963baca commit 6b9428e
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion heroku3/models/app.py
Expand Up @@ -35,7 +35,7 @@ class App(BaseResource):

_strs = ["buildpack_provided_description", "git_url", "id", "name", "web_url"]
_ints = ["slug_size", "repo_size"]
_bools = ["maintenance"]
_bools = ["maintenance", "acm"]
_dates = ["archived_at", "created_at", "released_at", "updated_at"]
_map = {"region": Region, "owner": User, "stack": Stack,
"organization": Organization, "team": Team, "space": Space}
Expand Down Expand Up @@ -161,6 +161,33 @@ def sni_endpoints(self, **kwargs):
"""The SNI (SSL) endpoints for this app."""
return self._h._get_resources(resource=("apps", self.id, "sni-endpoints"), obj=SNIEndpoint, app=self)

def enable_acm(self):
r = self._h._http_resource(
method="POST",
resource=("apps", self.id, "acm")
)

r.raise_for_status()
return r.ok

def disable_acm(self):
r = self._h._http_resource(
method="DELETE",
resource=("apps", self.id, "acm")
)

r.raise_for_status()
return r.ok

def refresh_acm(self):
r = self._h._http_resource(
method="PATCH",
resource=("apps", self.id, "acm")
)

r.raise_for_status()
return r.ok

def add_sni_endpoint(self, certificate_chain, private_key):
r = self._h._http_resource(
method="POST",
Expand Down

0 comments on commit 6b9428e

Please sign in to comment.