gitlab-org--gitlab-foss/app/services/check_gcp_project_billing_s...

9 lines
248 B
Ruby
Raw Normal View History

2017-12-16 00:44:36 +00:00
class CheckGCPProjectBillingService
def execute(token)
client = GoogleApi::CloudPlatform::Client.new(token, nil)
client.projects_list.any? do |project|
client.projects_get_billing_info(project.name).billingEnabled
end
end
end