From 9a07411c905c22e83287f6a54abe258c731dbb57 Mon Sep 17 00:00:00 2001 From: ImMin5 Date: Wed, 3 Jan 2024 12:53:18 +0900 Subject: [PATCH] feat: add workspace_id at CostQuerySetInfo --- .../cost_analysis/info/cost_query_set_info.py | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/spaceone/cost_analysis/info/cost_query_set_info.py b/src/spaceone/cost_analysis/info/cost_query_set_info.py index d0a47c52..ce8d5e14 100644 --- a/src/spaceone/cost_analysis/info/cost_query_set_info.py +++ b/src/spaceone/cost_analysis/info/cost_query_set_info.py @@ -4,29 +4,36 @@ from spaceone.core import utils from spaceone.cost_analysis.model.cost_query_set_model import CostQuerySet -__all__ = ['CostQuerySetInfo', 'CostQuerySetsInfo'] +__all__ = ["CostQuerySetInfo", "CostQuerySetsInfo"] def CostQuerySetInfo(cost_query_set_vo: CostQuerySet, minimal=False): info = { - 'cost_query_set_id': cost_query_set_vo.cost_query_set_id, - 'name': cost_query_set_vo.name, - 'user_id': cost_query_set_vo.user_id, + "cost_query_set_id": cost_query_set_vo.cost_query_set_id, + "name": cost_query_set_vo.name, + "user_id": cost_query_set_vo.user_id, + "workspace_id": cost_query_set_vo.workspace_id, } if not minimal: - info.update({ - 'options': change_struct_type(cost_query_set_vo.options), - 'tags': change_struct_type(cost_query_set_vo.tags), - 'data_source_id': cost_query_set_vo.data_source_id, - 'domain_id': cost_query_set_vo.domain_id, - 'created_at': utils.datetime_to_iso8601(cost_query_set_vo.created_at), - 'updated_at': utils.datetime_to_iso8601(cost_query_set_vo.updated_at), - }) + info.update( + { + "options": change_struct_type(cost_query_set_vo.options), + "tags": change_struct_type(cost_query_set_vo.tags), + "data_source_id": cost_query_set_vo.data_source_id, + "domain_id": cost_query_set_vo.domain_id, + "created_at": utils.datetime_to_iso8601(cost_query_set_vo.created_at), + "updated_at": utils.datetime_to_iso8601(cost_query_set_vo.updated_at), + } + ) return cost_query_set_pb2.CostQuerySetInfo(**info) def CostQuerySetsInfo(cost_query_set_vos, total_count, **kwargs): - return cost_query_set_pb2.CostQuerySetsInfo(results=list( - map(functools.partial(CostQuerySetInfo, **kwargs), cost_query_set_vos)), total_count=total_count) + return cost_query_set_pb2.CostQuerySetsInfo( + results=list( + map(functools.partial(CostQuerySetInfo, **kwargs), cost_query_set_vos) + ), + total_count=total_count, + )