Skip to content

Commit

Permalink
Remove billing related properties from project details [EH-766]
Browse files Browse the repository at this point in the history
The following fields are removed from displayed project details and,
replaced with `billing_group_id` and `billing_group_name`.
(e.g. by `project list`)
- `credit_card`
- `billing_address`
- `country_code`
- `billing_currency`
- `vat_id`

[EH-766]
  • Loading branch information
dogukancagatay committed Nov 10, 2023
1 parent a3e7355 commit bff1450
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions aiven/client/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4295,19 +4295,14 @@ def _format_card_info(cls, project: Mapping[str, Any]) -> str:
return "{}/{}".format(project["card_info"]["user_email"], project["card_info"]["card_id"])

def _show_projects(self, projects: Sequence[dict[str, Any]], verbose: bool = True) -> None:
for project in projects:
project["credit_card"] = self._format_card_info(project)
if verbose:
layout: list = [
["project_name", "default_cloud", "billing_currency", "vat_id"],
"credit_card",
"billing_address",
"country_code",
["project_name", "default_cloud"],
"billing_group_id",
"billing_group_name",
]
if any(project["billing_extra_text"] for project in projects):
layout.append("billing_extra_text")
else:
layout = [["project_name", "default_cloud", "credit_card"]]
layout = [["project_name", "default_cloud"]]
self.print_response(projects, json=getattr(self.args, "json", False), table_layout=layout)

def _resolve_parent_id(self, parent_id: str) -> str:
Expand Down

0 comments on commit bff1450

Please sign in to comment.