def list(self, project, service_account_file=""):
        stub = hmac_key_pb2_grpc.StorageHmacKeyServiceStub(channel.Channel())
        request = hmac_key_pb2.ListStorageHmacKeyRequest()
        request.service_account_file = service_account_file
        request.Project = project

        return stub.ListStorageHmacKey(request).items
    def apply(self):
        stub = hmac_key_pb2_grpc.StorageHmacKeyServiceStub(channel.Channel())
        request = hmac_key_pb2.ApplyStorageHmacKeyRequest()
        if Primitive.to_proto(self.name):
            request.resource.name = Primitive.to_proto(self.name)

        if HmacKeyStateEnum.to_proto(self.state):
            request.resource.state = HmacKeyStateEnum.to_proto(self.state)

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

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

        request.service_account_file = self.service_account_file

        response = stub.ApplyStorageHmacKey(request)
        self.name = Primitive.from_proto(response.name)
        self.time_created = Primitive.from_proto(response.time_created)
        self.updated = Primitive.from_proto(response.updated)
        self.secret = Primitive.from_proto(response.secret)
        self.state = HmacKeyStateEnum.from_proto(response.state)
        self.project = Primitive.from_proto(response.project)
        self.service_account_email = Primitive.from_proto(
            response.service_account_email)
    def delete(self, project, name, service_account_file=""):
        stub = hmac_key_pb2_grpc.StorageHmacKeyServiceStub(channel.Channel())
        request = hmac_key_pb2.DeleteStorageHmacKeyRequest()
        request.service_account_file = service_account_file
        request.Project = project

        request.Name = name

        response = stub.DeleteStorageHmacKey(request)
    def delete(self):
        stub = hmac_key_pb2_grpc.StorageHmacKeyServiceStub(channel.Channel())
        request = hmac_key_pb2.DeleteStorageHmacKeyRequest()
        request.service_account_file = self.service_account_file
        if Primitive.to_proto(self.name):
            request.resource.name = Primitive.to_proto(self.name)

        if HmacKeyStateEnum.to_proto(self.state):
            request.resource.state = HmacKeyStateEnum.to_proto(self.state)

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

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

        response = stub.DeleteStorageHmacKey(request)