Skip to content

Commit

Permalink
chore: fix type 'cost_report_mgr' -> 'cost_report_config_mgr'
Browse files Browse the repository at this point in the history
Signed-off-by: ImMin5 <[email protected]>
  • Loading branch information
ImMin5 committed Jun 21, 2024
1 parent 64e0ff4 commit b2c01fb
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions src/spaceone/cost_analysis/service/cost_report_config_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class CostReportConfigService(BaseService):

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.cost_report_mgr = CostReportConfigManager()
self.cost_report_config_mgr = CostReportConfigManager()

@transaction(
permission="cost-analysis:CostReportConfig.write", role_types=["DOMAIN_ADMIN"]
Expand Down Expand Up @@ -50,7 +50,9 @@ def create(
if not params.issue_day:
raise ERROR_REQUIRED_PARAMETER(key="issue_day")

cost_report_vo = self.cost_report_mgr.create_cost_report_config(params.dict())
cost_report_vo = self.cost_report_config_mgr.create_cost_report_config(
params.dict()
)

return CostReportConfigResponse(**cost_report_vo.to_dict())

Expand All @@ -76,16 +78,18 @@ def update(
Returns:
CostReportConfigResponse:
"""
cost_report_config_vo = self.cost_report_mgr.get_cost_report_config(
cost_report_config_vo = self.cost_report_config_mgr.get_cost_report_config(
params.domain_id,
params.cost_report_config_id,
)

if params.is_last_day is None:
params.is_last_day = False

cost_report_config_vo = self.cost_report_mgr.update_cost_report_config_by_vo(
params.dict(exclude_unset=True), cost_report_config_vo
cost_report_config_vo = (
self.cost_report_config_mgr.update_cost_report_config_by_vo(
params.dict(exclude_unset=True), cost_report_config_vo
)
)

return CostReportConfigResponse(**cost_report_config_vo.to_dict())
Expand All @@ -108,13 +112,13 @@ def update_recipients(
Returns:
CostReportConfigResponse:
"""
cost_report_config_vo = self.cost_report_mgr.get_cost_report_config(
cost_report_config_vo = self.cost_report_config_mgr.get_cost_report_config(
params.domain_id,
params.cost_report_config_id,
)

cost_report_config_vo = (
self.cost_report_mgr.update_recipients_cost_report_config(
self.cost_report_config_mgr.update_recipients_cost_report_config(
params.dict(exclude_unset=True), cost_report_config_vo
)
)
Expand All @@ -138,11 +142,11 @@ def enable(
Returns:
CostReportConfigResponse:
"""
cost_report_config_vo = self.cost_report_mgr.get_cost_report_config(
cost_report_config_vo = self.cost_report_config_mgr.get_cost_report_config(
params.domain_id, params.cost_report_config_id
)

cost_report_config_vo = self.cost_report_mgr.enable_cost_report_config(
cost_report_config_vo = self.cost_report_config_mgr.enable_cost_report_config(
cost_report_config_vo
)

Expand All @@ -165,12 +169,12 @@ def disable(
Returns:
CostReportConfigResponse:
"""
cost_report_config_vo = self.cost_report_mgr.get_cost_report_config(
cost_report_config_vo = self.cost_report_config_mgr.get_cost_report_config(
params.domain_id,
params.cost_report_config_id,
)

cost_report_config_vo = self.cost_report_mgr.disable_cost_report_config(
cost_report_config_vo = self.cost_report_config_mgr.disable_cost_report_config(
cost_report_config_vo
)

Expand All @@ -191,11 +195,13 @@ def delete(self, params: CostReportConfigDeleteRequest) -> None:
Returns:
None
"""
cost_report_config_vo = self.cost_report_mgr.get_cost_report_config(
cost_report_config_vo = self.cost_report_config_mgr.get_cost_report_config(
params.domain_id, params.cost_report_config_id
)

self.cost_report_mgr.delete_cost_report_config_by_vo(cost_report_config_vo)
self.cost_report_config_mgr.delete_cost_report_config_by_vo(
cost_report_config_vo
)

@transaction(
permission="cost-analysis:CostReportConfig.write", role_types=["DOMAIN_ADMIN"]
Expand All @@ -212,7 +218,7 @@ def run(self, params: CostReportConfigRunRequest) -> None:
None
"""

cost_report_config_vo = self.cost_report_mgr.get_cost_report_config(
cost_report_config_vo = self.cost_report_config_mgr.get_cost_report_config(
params.domain_id, params.cost_report_config_id
)

Expand Down Expand Up @@ -248,7 +254,7 @@ def get(
Returns:
CostReportConfigResponse:
"""
cost_report_config_vo = self.cost_report_mgr.get_cost_report_config(
cost_report_config_vo = self.cost_report_config_mgr.get_cost_report_config(
params.domain_id, params.cost_report_config_id
)

Expand Down Expand Up @@ -281,7 +287,9 @@ def list(
(
cost_report_config_vos,
total_count,
) = self.cost_report_mgr.list_cost_report_configs(query, params.domain_id)
) = self.cost_report_config_mgr.list_cost_report_configs(
query, params.domain_id
)

cost_report_configs_info = [
cost_report_config_vo.to_dict()
Expand Down Expand Up @@ -313,4 +321,4 @@ def stat(self, params: CostReportConfigStatQueryRequest) -> dict:
CostReportConfigStatResponse:
"""
query = params.query or {}
return self.cost_report_mgr.stat_cost_report_configs(query)
return self.cost_report_config_mgr.stat_cost_report_configs(query)

0 comments on commit b2c01fb

Please sign in to comment.