Skip to content

Commit

Permalink
[gcp][chore] Housekeeping (#1447)
Browse files Browse the repository at this point in the history
* billing info

* housekeeping
  • Loading branch information
anjafr committed Feb 15, 2023
1 parent c58b77d commit a7ec115
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions plugins/gcp/resoto_plugin_gcp/resources/billing.py
Expand Up @@ -12,6 +12,9 @@
@define(eq=False, slots=False)
class GcpBillingAccount(GcpResource):
kind: ClassVar[str] = "gcp_billing_account"
reference_kinds: ClassVar[ModelReference] = {
"successors": {"default": ["gcp_project_billing_info"]},
}
api_spec: ClassVar[GcpApiSpec] = GcpApiSpec(
service="cloudbilling",
version="v1",
Expand All @@ -35,9 +38,6 @@ class GcpBillingAccount(GcpResource):
"account_master_billing_account": S("masterBillingAccount"),
"account_open": S("open"),
}
reference_kinds: ClassVar[ModelReference] = {
"successors": {"default": ["gcp_project_billing_info"]},
}

account_display_name: Optional[str] = field(default=None)
account_master_billing_account: Optional[str] = field(default=None)
Expand Down Expand Up @@ -82,6 +82,9 @@ class GcpProjectBillingInfo(GcpResource):
@define(eq=False, slots=False)
class GcpService(GcpResource):
kind: ClassVar[str] = "gcp_service"
reference_kinds: ClassVar[ModelReference] = {
"successors": {"default": ["gcp_sku"]},
}
api_spec: ClassVar[GcpApiSpec] = GcpApiSpec(
service="cloudbilling",
version="v1",
Expand All @@ -103,14 +106,12 @@ class GcpService(GcpResource):
"deprecation_status": S("deprecated", default={}) >> Bend(GcpDeprecationStatus.mapping),
"service_business_entity_name": S("businessEntityName"),
"service_display_name": S("displayName"),
"service_service_id": S("serviceId"),
}
reference_kinds: ClassVar[ModelReference] = {
"successors": {"default": ["gcp_sku"]},
"service_id": S("serviceId"),
}

service_business_entity_name: Optional[str] = field(default=None)
service_display_name: Optional[str] = field(default=None)
service_service_id: Optional[str] = field(default=None)
service_id: Optional[str] = field(default=None)

def post_process(self, graph_builder: GraphBuilder, source: Json) -> None:
for sku in GcpSku.collect_resources(graph_builder, parent=self.id):
Expand Down

0 comments on commit a7ec115

Please sign in to comment.