def delete(self):
        stub = access_level_pb2_grpc.AccesscontextmanagerAccessLevelServiceStub(
            channel.Channel())
        request = access_level_pb2.DeleteAccesscontextmanagerAccessLevelRequest(
        )
        request.service_account_file = self.service_account_file
        if Primitive.to_proto(self.title):
            request.resource.title = Primitive.to_proto(self.title)

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

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

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

        if AccessLevelBasic.to_proto(self.basic):
            request.resource.basic.CopyFrom(
                AccessLevelBasic.to_proto(self.basic))
        else:
            request.resource.ClearField("basic")
        if Primitive.to_proto(self.name):
            request.resource.name = Primitive.to_proto(self.name)

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

        response = stub.DeleteAccesscontextmanagerAccessLevel(request)
Ejemplo n.º 2
0
    def list(self, policy, service_account_file=""):
        stub = access_level_pb2_grpc.AccesscontextmanagerAccessLevelServiceStub(
            channel.Channel())
        request = access_level_pb2.ListAccesscontextmanagerAccessLevelRequest()
        request.service_account_file = service_account_file
        request.Policy = policy

        return stub.ListAccesscontextmanagerAccessLevel(request).items
Ejemplo n.º 3
0
    def delete(self, policy, name, service_account_file=""):
        stub = access_level_pb2_grpc.AccesscontextmanagerAccessLevelServiceStub(
            channel.Channel())
        request = access_level_pb2.DeleteAccesscontextmanagerAccessLevelRequest(
        )
        request.service_account_file = service_account_file
        request.Policy = policy

        request.Name = name

        response = stub.DeleteAccesscontextmanagerAccessLevel(request)