class Schema:
    def __init__(self, client):
        self.client = client

    def get_cluster_schema(self, cluster_id):
        return self.client.request("GET", f"/schema/clusters/{cluster_id}")

    def analyze_collection(self, cluster_id, collection_name):
        return self.client.request("GET", f"/schema/clusters/{cluster_id}/collections/{collection_name}")

    def get_indexes(self, cluster_id, collection_name):
        return self.client.request("GET", f"/schema/clusters/{cluster_id}/collections/{collection_name}/indexes")

    def create_index(self, cluster_id, collection_name, keys, options=None):
        data = {"keys": keys}
        if options:
            data["options"] = options
        return self.client.request("POST", f"/schema/clusters/{cluster_id}/collections/{collection_name}/indexes", json=data)

    def drop_index(self, cluster_id, collection_name, index_name):
        return self.client.request("DELETE", f"/schema/clusters/{cluster_id}/collections/{collection_name}/indexes/{index_name}")
