// Code generated by go generate. DO NOT EDIT.

package opt

import (
	"github.com/algolia/algoliasearch-client-go/v3/algolia/opt"
)

// ExtractExtraOptions returns the first found ExtraOptionsOption from the
// given variadic arguments or nil otherwise. If multiple options are found, the
// inner maps are merged.
func ExtractExtraOptions(opts ...interface{}) *opt.ExtraOptionsOption {
	merged := make(map[string]interface{})

	for _, o := range opts {
		if v, ok := o.(*opt.ExtraOptionsOption); ok {
			for key, value := range v.Get() {
				merged[key] = value
			}
		}
	}

	if len(merged) == 0 {
		return nil
	}

	return opt.ExtraOptions(merged)
}
