def list(self, name, service_account_file=""): stub = project_billing_info_pb2_grpc.CloudbillingProjectBillingInfoServiceStub( channel.Channel() ) request = project_billing_info_pb2.ListCloudbillingProjectBillingInfoRequest() request.service_account_file = service_account_file request.Name = name return stub.ListCloudbillingProjectBillingInfo(request).items
def delete(self, name, service_account_file=""): stub = project_billing_info_pb2_grpc.CloudbillingProjectBillingInfoServiceStub( channel.Channel() ) request = project_billing_info_pb2.DeleteCloudbillingProjectBillingInfoRequest() request.service_account_file = service_account_file request.Name = name response = stub.DeleteCloudbillingProjectBillingInfo(request)
def delete(self): stub = project_billing_info_pb2_grpc.CloudbillingProjectBillingInfoServiceStub( channel.Channel()) request = project_billing_info_pb2.DeleteCloudbillingProjectBillingInfoRequest( ) request.service_account_file = self.service_account_file if Primitive.to_proto(self.name): request.resource.name = Primitive.to_proto(self.name) if Primitive.to_proto(self.billing_account_name): request.resource.billing_account_name = Primitive.to_proto( self.billing_account_name) response = stub.DeleteCloudbillingProjectBillingInfo(request)
def apply(self): stub = project_billing_info_pb2_grpc.CloudbillingProjectBillingInfoServiceStub( channel.Channel() ) request = project_billing_info_pb2.ApplyCloudbillingProjectBillingInfoRequest() if Primitive.to_proto(self.name): request.resource.name = Primitive.to_proto(self.name) if Primitive.to_proto(self.billing_account_name): request.resource.billing_account_name = Primitive.to_proto( self.billing_account_name ) request.service_account_file = self.service_account_file response = stub.ApplyCloudbillingProjectBillingInfo(request) self.name = Primitive.from_proto(response.name) self.billing_account_name = Primitive.from_proto(response.billing_account_name) self.billing_enabled = Primitive.from_proto(response.billing_enabled)