summaryrefslogtreecommitdiff
path: root/app/services/check_gcp_project_billing_service.rb
blob: 854adf2177dccdc3e1fba55354f577573fdfe3dd (plain)
1
2
3
4
5
6
7
8
class CheckGcpProjectBillingService
  def execute(token)
    client = GoogleApi::CloudPlatform::Client.new(token, nil)
    client.projects_list.select do |project|
      client.projects_get_billing_info(project.name).billingEnabled
    end
  end
end