// OnlyMapper interface
972575
func (oms *OnlyMapperStruct) NewKey() sophie.Sophier {
	if oms.NewKeyF != nil {
		return oms.NewKeyF()
	}
	// sophie.RawByteSlice is a Sophier that can read any Sophie data.
	return new(sophie.RawByteSlice)
}
1341942
func (client DefaultClient) GetMappings() (map[int]Mapping, error) {
	req, err := http.NewRequest("GET", fmt.Sprintf("%s/rest/com.deniz.jira.mapping/latest/mappings", client.baseURL), nil)
	if err != nil {
		return nil, err
	}
	req.Header.Set("Accept", "application/json")
	req.SetBasicAuth(client.username, client.password)

	responseCode, data, err := client.consumeResponse(req)
	if err != nil {
		return nil, err
	}
	if responseCode != http.StatusOK {
		logger.Printf("JIRA response: %s\n", string(data))
		return nil, fmt.Errorf("error getting mappings.  Status code: %d.\n", responseCode)
	}

	var r []Mapping
	if err := json.Unmarshal(data, &r); err != nil {
		return nil, err
	}

	m := make(map[int]Mapping)
	for _, c := range r {
		m[c.ID] = c
	}
	return m, nil
}
971420
func (r *Result) ResourceMapping() (*meta.RESTMapping, error) {
	if r.err != nil {
		return nil, r.err
	}
	mappings := map[schema.GroupVersionResource]*meta.RESTMapping{}
	for i := range r.sources {
		m, ok := r.sources[i].(ResourceMapping)
		if !ok {
			return nil, fmt.Errorf("a resource mapping could not be loaded from %v", reflect.TypeOf(r.sources[i]))
		}
		mapping := m.ResourceMapping()
		mappings[mapping.Resource] = mapping
	}
	if len(mappings) != 1 {
		return nil, fmt.Errorf("expected only a single resource type")
	}
	for _, mapping := range mappings {
		return mapping, nil
	}
	return nil, nil
}
1016348
func (c *CloudPersister) ListMaps() ([]*models.Map, error) {
	ctx := context.Background()
	Maps := make([]*models.Map, 0)
	q := datastore.NewQuery("Map")

	keys, err := c.DatastoreClient().GetAll(ctx, q, &Maps)

	if err != nil {
		return nil, fmt.Errorf("datastoredb: could not list Maps: %v", err)
	}

	for i, k := range keys {
		Maps[i].ID = k.ID()
	}

	return Maps, nil
}
1208956
func (v *Type) GetMapType() (o *TypePair) {
	if v != nil && v.MapType != nil {
		return v.MapType
	}

	return
}
687003
func AsMap(obj interface{}, includeGlobals bool) context.Map {
	return cm.AsMap(obj, includeGlobals)
}
1057273
func MapsFrom(utd *design.UserTypeDefinition, field string) {
	if f, ok := relationalFieldDefinition(true); ok {
		md := gorma.NewMapDefinition()
		md.RemoteField = field
		md.RemoteType = utd
		f.Mappings[utd.TypeName] = md

	}
}
285681
func Only(platform specs.Platform) MatchComparer {
	platform = Normalize(platform)
	if platform.Architecture == "arm" {
		if platform.Variant == "v7" {
			return orderedPlatformComparer{
				matchers: []Matcher{
					&matcher{
						Platform: platform,
					},
					&matcher{
						Platform: specs.Platform{
							Architecture: platform.Architecture,
							OS:           platform.OS,
							OSVersion:    platform.OSVersion,
							OSFeatures:   platform.OSFeatures,
							Variant:      "v6",
						},
					},
					&matcher{
						Platform: specs.Platform{
							Architecture: platform.Architecture,
							OS:           platform.OS,
							OSVersion:    platform.OSVersion,
							OSFeatures:   platform.OSFeatures,
							Variant:      "v5",
						},
					},
				},
			}
		}
		if platform.Variant == "v6" {
			return orderedPlatformComparer{
				matchers: []Matcher{
					&matcher{
						Platform: platform,
					},
					&matcher{
						Platform: specs.Platform{
							Architecture: platform.Architecture,
							OS:           platform.OS,
							OSVersion:    platform.OSVersion,
							OSFeatures:   platform.OSFeatures,
							Variant:      "v5",
						},
					},
				},
			}
		}
	}

	return singlePlatformComparer{
		Matcher: &matcher{
			Platform: platform,
		},
	}
}
860225
func mappingFor(user *userapi.User, identity *userapi.Identity) (*userinternal.UserIdentityMapping, error) {
	return &userinternal.UserIdentityMapping{
		ObjectMeta: metav1.ObjectMeta{
			Name:            identity.Name,
			ResourceVersion: identity.ResourceVersion,
			UID:             identity.UID,
		},
		Identity: kapi.ObjectReference{
			Name: identity.Name,
			UID:  identity.UID,
		},
		User: kapi.ObjectReference{
			Name: user.Name,
			UID:  user.UID,
		},
	}, nil
}
298926
func (ctl *Controller) initMapper(c context.Context, j *Job, shardIdx int) (Mapper, error) {
	f, err := ctl.getFactory(j.Config.Mapper)
	if err != nil {
		return nil, errors.Annotate(err, "when initializing mapper").Err()
	}
	m, err := f(c, j, shardIdx)
	if err != nil {
		return nil, errors.Annotate(err, "error from mapper factory %q", j.Config.Mapper).Err()
	}
	return m, nil
}
314374
func (mapOp *MapOperation) RemoveMap(key string) *MapOperation {
	if mapOp.maps != nil {
		delete(mapOp.maps, key)
	}
	if mapOp.removeMaps == nil {
		mapOp.removeMaps = make(map[string]bool)
	}
	mapOp.removeMaps[key] = true
	return mapOp
}
614720
func (opts *ListOpts) GetMap() map[string]struct{} {
	ret := make(map[string]struct{})
	for _, k := range *opts.values {
		ret[k] = struct{}{}
	}
	return ret
}
1205553
func (v *Value) EachObjxMap(callback func(int, Map) bool) *Value {
	for index, val := range v.MustObjxMapSlice() {
		carryon := callback(index, val)
		if !carryon {
			break
		}
	}
	return v
}
428926
func GetMap(builder interface{}) map[string]interface{} {
	m := getBuilderMap(builder)
	structType := getBuilderStructType(reflect.TypeOf(builder))

	ret := make(map[string]interface{}, m.Size())

	m.ForEach(func(name string, val ps.Any) {
		list, isList := val.(ps.List)
		if isList {
			arrayType := anyArrayType

			if structType != nil {
				field, ok := (*structType).FieldByName(name)
				if ok {
					arrayType = field.Type
				}
			}

			val = listToSlice(list, arrayType).Interface()
		}

		ret[name] = val
	})

	return ret
}
209287
func MapToResource(resourceMap interface{}, asPointer bool) interface{} {
	b, _ := json.Marshal(&resourceMap)
	m := resourceMap.(map[string]interface{})
	t := m["resourceType"]
	switch t {
	case "Account":
		x := Account{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "AllergyIntolerance":
		x := AllergyIntolerance{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Appointment":
		x := Appointment{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "AppointmentResponse":
		x := AppointmentResponse{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "AuditEvent":
		x := AuditEvent{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Basic":
		x := Basic{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Binary":
		x := Binary{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "BodySite":
		x := BodySite{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Bundle":
		x := Bundle{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "CarePlan":
		x := CarePlan{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Claim":
		x := Claim{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "ClaimResponse":
		x := ClaimResponse{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "ClinicalImpression":
		x := ClinicalImpression{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Communication":
		x := Communication{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "CommunicationRequest":
		x := CommunicationRequest{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Composition":
		x := Composition{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "ConceptMap":
		x := ConceptMap{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Condition":
		x := Condition{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Conformance":
		x := Conformance{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Contract":
		x := Contract{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Coverage":
		x := Coverage{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "DataElement":
		x := DataElement{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "DetectedIssue":
		x := DetectedIssue{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Device":
		x := Device{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "DeviceComponent":
		x := DeviceComponent{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "DeviceMetric":
		x := DeviceMetric{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "DeviceUseRequest":
		x := DeviceUseRequest{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "DeviceUseStatement":
		x := DeviceUseStatement{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "DiagnosticOrder":
		x := DiagnosticOrder{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "DiagnosticReport":
		x := DiagnosticReport{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "DocumentManifest":
		x := DocumentManifest{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "DocumentReference":
		x := DocumentReference{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "EligibilityRequest":
		x := EligibilityRequest{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "EligibilityResponse":
		x := EligibilityResponse{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Encounter":
		x := Encounter{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "EnrollmentRequest":
		x := EnrollmentRequest{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "EnrollmentResponse":
		x := EnrollmentResponse{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "EpisodeOfCare":
		x := EpisodeOfCare{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "ExplanationOfBenefit":
		x := ExplanationOfBenefit{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "FamilyMemberHistory":
		x := FamilyMemberHistory{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Flag":
		x := Flag{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Goal":
		x := Goal{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Group":
		x := Group{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "HealthcareService":
		x := HealthcareService{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "ImagingObjectSelection":
		x := ImagingObjectSelection{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "ImagingStudy":
		x := ImagingStudy{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Immunization":
		x := Immunization{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "ImmunizationRecommendation":
		x := ImmunizationRecommendation{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "ImplementationGuide":
		x := ImplementationGuide{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "List":
		x := List{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Location":
		x := Location{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Media":
		x := Media{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Medication":
		x := Medication{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "MedicationAdministration":
		x := MedicationAdministration{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "MedicationDispense":
		x := MedicationDispense{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "MedicationOrder":
		x := MedicationOrder{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "MedicationStatement":
		x := MedicationStatement{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "MessageHeader":
		x := MessageHeader{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "NamingSystem":
		x := NamingSystem{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "NutritionOrder":
		x := NutritionOrder{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Observation":
		x := Observation{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "OperationDefinition":
		x := OperationDefinition{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "OperationOutcome":
		x := OperationOutcome{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Order":
		x := Order{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "OrderResponse":
		x := OrderResponse{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Organization":
		x := Organization{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Parameters":
		x := Parameters{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Patient":
		x := Patient{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "PaymentNotice":
		x := PaymentNotice{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "PaymentReconciliation":
		x := PaymentReconciliation{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Person":
		x := Person{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Practitioner":
		x := Practitioner{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Procedure":
		x := Procedure{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "ProcedureRequest":
		x := ProcedureRequest{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "ProcessRequest":
		x := ProcessRequest{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "ProcessResponse":
		x := ProcessResponse{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Provenance":
		x := Provenance{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Questionnaire":
		x := Questionnaire{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "QuestionnaireResponse":
		x := QuestionnaireResponse{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "ReferralRequest":
		x := ReferralRequest{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "RelatedPerson":
		x := RelatedPerson{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "RiskAssessment":
		x := RiskAssessment{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Schedule":
		x := Schedule{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "SearchParameter":
		x := SearchParameter{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Slot":
		x := Slot{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Specimen":
		x := Specimen{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "StructureDefinition":
		x := StructureDefinition{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Subscription":
		x := Subscription{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "Substance":
		x := Substance{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "SupplyDelivery":
		x := SupplyDelivery{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "SupplyRequest":
		x := SupplyRequest{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "TestScript":
		x := TestScript{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "ValueSet":
		x := ValueSet{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}
	case "VisionPrescription":
		x := VisionPrescription{}
		json.Unmarshal(b, &x)
		if asPointer {
			return &x
		} else {
			return x
		}

	}
	return nil
}
759434
func (s *IndicesForcemergeService) OnlyExpungeDeletes(onlyExpungeDeletes bool) *IndicesForcemergeService {
	s.onlyExpungeDeletes = &onlyExpungeDeletes
	return s
}
232185
func CreateMap(values ...interface{}) (map[string]interface{}, error) {
	if len(values)%2 != 0 {
		return nil, errors.New("invalid map call")
	}
	dict := make(map[string]interface{}, len(values)/2)
	for i := 0; i < len(values); i += 2 {
		key, ok := values[i].(string)
		if !ok {
			return nil, errors.New("map keys must be strings")
		}
		dict[key] = values[i+1]
	}
	return dict, nil
}