libraries/botbuilder-azure/botbuilder/azure/cosmosdb_storage.py
def __get_or_create_container(self, doc_client, container) -> str:
        """Return the container link.

        Check if the container exists or create the container.

        :param doc_client:
        :param container:
        :return str:
        """
        # query CosmosDB for a container in the database with that name
        containers = list(doc_client.QueryContainers(
            self.__database_link,
            {
                "query": "SELECT * FROM r WHERE r.id=@id",
                "parameters": [
                    {"name": "@id", "value": container}
                ]
            }
        ))
        # if there are results, return the first (container names are unique)
        if len(containers) > 0:
            return containers[0]['id']
        else:
            # Create a container if it didn't exist
            res = doc_client.CreateContainer(
                self.__database_link, {'id': container})
            return res['id']
def __get_or_create_container(self, doc_client, container) -> str:
        # query CosmosDB for a container in the database with that name
        containers = list(doc_client.QueryContainers(
            self.__database_link,
            {
                "query": "SELECT * FROM r WHERE r.id=@id",
                "parameters": [
                    {"name": "@id", "value": container}
                ]
            }
        ))
        # if there are results, return the first (container names are unique)
        if len(containers) > 0:
            return containers[0]['id']
        else:
            # Create a container if it didn't exist
            res = doc_client.CreateContainer(
                self.__database_link, {'id': container})
            return res['id']
def __get_or_create_container ( self , doc_client , container ) -> str : # query CosmosDB for a container in the database with that name containers = list ( doc_client . QueryContainers ( self . __database_link , { "query" : "SELECT * FROM r WHERE r.id=@id" , "parameters" : [ { "name" : "@id" , "value" : container } ] } ) ) # if there are results, return the first (container names are unique) if len ( containers ) > 0 : return containers [ 0 ] [ 'id' ] else : # Create a container if it didn't exist res = doc_client . CreateContainer ( self . __database_link , { 'id' : container } ) return res [ 'id' ]
Return the container link.

        Check if the container exists or create the container.

        :param doc_client:
        :param container:
        :return str:
Return the container link .