def apply(self):
        stub = group_pb2_grpc.MonitoringGroupServiceStub(channel.Channel())
        request = group_pb2.ApplyMonitoringGroupRequest()
        if Primitive.to_proto(self.display_name):
            request.resource.display_name = Primitive.to_proto(
                self.display_name)

        if Primitive.to_proto(self.filter):
            request.resource.filter = Primitive.to_proto(self.filter)

        if Primitive.to_proto(self.is_cluster):
            request.resource.is_cluster = Primitive.to_proto(self.is_cluster)

        if Primitive.to_proto(self.name):
            request.resource.name = Primitive.to_proto(self.name)

        if Primitive.to_proto(self.parent_name):
            request.resource.parent_name = Primitive.to_proto(self.parent_name)

        if Primitive.to_proto(self.project):
            request.resource.project = Primitive.to_proto(self.project)

        request.service_account_file = self.service_account_file

        response = stub.ApplyMonitoringGroup(request)
        self.display_name = Primitive.from_proto(response.display_name)
        self.filter = Primitive.from_proto(response.filter)
        self.is_cluster = Primitive.from_proto(response.is_cluster)
        self.name = Primitive.from_proto(response.name)
        self.parent_name = Primitive.from_proto(response.parent_name)
        self.project = Primitive.from_proto(response.project)
    def list(self, project, service_account_file=""):
        stub = group_pb2_grpc.MonitoringGroupServiceStub(channel.Channel())
        request = group_pb2.ListMonitoringGroupRequest()
        request.service_account_file = service_account_file
        request.Project = project

        return stub.ListMonitoringGroup(request).items
    def delete(self, project, name, service_account_file=""):
        stub = group_pb2_grpc.MonitoringGroupServiceStub(channel.Channel())
        request = group_pb2.DeleteMonitoringGroupRequest()
        request.service_account_file = service_account_file
        request.Project = project

        request.Name = name

        response = stub.DeleteMonitoringGroup(request)