Gets the mapping of all/index/types

@param null|string $index
@param null|string $type

@return \Elastification\Client\Response\ResponseInterface
@author Daniel Wendlandt
161181
public function getMapping($index = null, $type = null)
    {
        $request = $this->createRequestInstance(self::INDEX_GET_MAPPING, $index, $type);

        return $this->client->send($request);
    }
620469
public function getParameter($index)
    {
        if (!is_string($index) && !is_numeric($index)) {
            return null;
        }
        if (array_key_exists($index, $this->_parameterNameMap)) {
            $index = $this->_parameterNameMap[$index];
        }
        if (array_key_exists($index, $this->_parameters)) {
            return $this->_parameters[$index];
        }
        return null;
    }
342649
public Optional<Map<String, ?>> getMappings(String index, String
            type) {
        try {
            return Optional
                    .of(getMappingsResponse(index).get(index).get(type)
                            .getSourceAsMap());
        } catch (Exception e) {
            return JMExceptionManager.handleExceptionAndReturnEmptyOptional
                    (log, e, "getMappings", index, type);
        }
    }
391095
public function getChartByIndex($index = null)
    {
        $chartCount = count($this->chartCollection);
        if ($chartCount == 0) {
            return false;
        }
        if (is_null($index)) {
            $index = --$chartCount;
        }
        if (!isset($this->chartCollection[$index])) {
            return false;
        }

        return $this->chartCollection[$index];
    }
779632
public function get($index)
    {
        if( $index >= count($this->generators) || $index < 0 )
            return null;
          
        return $this->generators[$index];
    }
1231887
public function getMappings($index)
    {
        $config = $this->get($index);

        if (null === $config || !isset($config['mappings'])) {
            return null;
        }

        return $config['mappings'];
    }
1243103
public function delete($index, $type, $id)
    {
        $request = $this->createRequestInstance(self::DELETE_DOCUMENT, $index, $type);
        $request->setId($id);

        return $this->client->send($request);
    }
766501
protected function createZedClient($index = null): Index
    {

        if ($index === null) {
            $index = Config::get(ConditionalAvailabilityConstants::ELASTICA_PARAMETER__INDEX_NAME);
        }

        return parent::createZedClient($index);
    }
1306686
public function getQueries($index = null)
    {
        //Argument 1 must be an int string or null
        Argument::i()->test(1, 'int', 'string', 'null');
        
        //if no index
        if (is_null($index)) {
            //return all the queries
            return $this->queries;
        }
        
        //is it the first?
        if ($index == self::FIRST) {
            //index is 0 then
            $index = 0;
        //is it the last?
        } else if ($index == self::LAST) {
            //set index to the last one
            $index = count($this->queries) - 1;
        }
        
        //if we have that record
        if (isset($this->queries[$index])) {
            //return it
            return $this->queries[$index];
        }
        
        return null;
    }
390524
protected function resolveIndexType($index)
    {
        $indexTypes = $this->getIndexTypes();
        $index->type = array_key_exists($index->name, $indexTypes) ? $indexTypes[$index->name] : 'unknown';
        $index->isRt = ($index->type == 'rt');
    }
806982
private function getParameters($type, $index = null)
    {
        // If the type is invalid, return an empty array
        if ( ! in_array($type, ['dataset', 'messageset', 'ruleset'])) return [];

        return array_get($this->{$type}, $index, []);
    }
807068
public static function getErrorRoute($type, $index = 0) {

		if(false === ('-' . intval($type) == '-' . $type)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($type)), E_USER_ERROR);
		}

		if(false === ('-' . intval($index) == '-' . $index)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($index)), E_USER_ERROR);
		}

		if(true === isset(static :: $error['types'][$type][$index])) {
			return static :: $error['types'][$type][$index];
		}

		return null;
	}
759633
protected function __mfind($index, $type, $ids) {
        try {
            $docs = $this->client->mget([
                'index' => $index,
                'type' => $type,
                'body' => [
                    "ids" => $ids
                ]
            ]);
            $result = ['ids' => $ids, 'found' => [], 'missed' => [], 'docs' => []];
            $missed = [] + $ids;
            foreach ($docs['docs'] as $doc) {
                if ($doc['found']) {
                    $result['docs'][] = $doc;
                    $result['found'][] = $doc['_id'];
                    unset($missed[array_search($doc['_id'], $missed)]);
                }
            }
            $result['missed'] = $missed;
            return $this->_makeMultiGetResult($result);
        } catch (\Exception $e) {
            trigger_error($e->getMessage(), E_USER_WARNING);
            return null;
        }
    }
470493
public function offsetGet($index) {
		if( $this->results === null ){
			$this->results = ($this->query)();
		}
		if( isset($this->results[$index]) ){
			return $this->results[$index];
		}
		return null;
	}
1304453
public function getSearchIndex($index)
    {
        return isset($this->search[$index]) ? $this->search[$index] : null;
    }
1352458
public function get($index){
		if(isset($this->map[ $index ])){
			return $this->map[ $index ];
		}
		return null;
	}
988176
protected function map($index) // -> int
	{
		$r = $index;
		
		if( (null !== $index) && is_integer($index))
		{
			$r    = $index + $this->start;
			$size = $this->data->getSize();
			
			if($r >= $size)
			{
				$r -= $size;
			}
		}
		
		return $r;
	}