// inherit from resource type
// fields need to be inherited:
// - description
// - response
437143
func (m *Method) inheritFromResourceType(r *Resource, rtm *Method, rt *ResourceType, apiDef *APIDefinition) {
	if rtm == nil {
		return
	}
	dicts := initResourceTypeDicts(r, r.Type.Parameters)

	// inherit description
	m.Description = substituteParams(m.Description, rtm.Description, dicts)

	// inherit display name
	m.DisplayName = substituteParams(m.DisplayName, rtm.DisplayName, dicts)

	// inherit bodies
	m.Bodies.inherit(rtm.Bodies, dicts, m.resourceTypeName, apiDef)

	// inherit headers
	m.inheritHeaders(rtm.Headers, dicts)

	// inherit query params
	m.inheritQueryParams(rtm.QueryParameters, dicts)

	// inherit response
	m.inheritResponses(rtm.Responses, dicts, apiDef)

	// inherit protocols
	m.inheritProtocols(rtm.Protocols)
}
244716
func Kind(res *api.GenericResource) string {
	switch r := res.Resource.(type) {
	case *api.GenericResource_DiscreteResourceSpec:
		return r.DiscreteResourceSpec.Kind
	case *api.GenericResource_NamedResourceSpec:
		return r.NamedResourceSpec.Kind
	}

	return ""
}
290609
func (s Style) InheritFrom(defaults Style) (final Style) {
	final.ClassName = s.GetClassName(defaults.ClassName)

	final.StrokeColor = s.GetStrokeColor(defaults.StrokeColor)
	final.StrokeWidth = s.GetStrokeWidth(defaults.StrokeWidth)
	final.StrokeDashArray = s.GetStrokeDashArray(defaults.StrokeDashArray)

	final.DotColor = s.GetDotColor(defaults.DotColor)
	final.DotWidth = s.GetDotWidth(defaults.DotWidth)

	final.DotWidthProvider = s.DotWidthProvider
	final.DotColorProvider = s.DotColorProvider

	final.FillColor = s.GetFillColor(defaults.FillColor)
	final.FontColor = s.GetFontColor(defaults.FontColor)
	final.FontSize = s.GetFontSize(defaults.FontSize)
	final.Font = s.GetFont(defaults.Font)
	final.Padding = s.GetPadding(defaults.Padding)
	final.TextHorizontalAlign = s.GetTextHorizontalAlign(defaults.TextHorizontalAlign)
	final.TextVerticalAlign = s.GetTextVerticalAlign(defaults.TextVerticalAlign)
	final.TextWrap = s.GetTextWrap(defaults.TextWrap)
	final.TextLineSpacing = s.GetTextLineSpacing(defaults.TextLineSpacing)
	final.TextRotationDegrees = s.GetTextRotationDegrees(defaults.TextRotationDegrees)

	return
}
343819
func (s *Policy) SetResourceType(v string) *Policy {
	s.ResourceType = &v
	return s
}
465
func (resource *AppointmentResponse) MarshalJSON() ([]byte, error) {
	resource.ResourceType = "AppointmentResponse"
	// Dereferencing the pointer to avoid infinite recursion.
	// Passing in plain old x (a pointer to AppointmentResponse), would cause this same
	// MarshallJSON function to be called again
	return json.Marshal(*resource)
}
732777
func (resource *EnrollmentResponse) MarshalJSON() ([]byte, error) {
	resource.ResourceType = "EnrollmentResponse"
	// Dereferencing the pointer to avoid infinite recursion.
	// Passing in plain old x (a pointer to EnrollmentResponse), would cause this same
	// MarshallJSON function to be called again
	return json.Marshal(*resource)
}
60498
func ResourceTypeFromString(typeString string) (ResourceType, error) {
	switch strings.ToUpper(typeString) {
	case "ANY":
		return ResourceAny, nil
	case "TOPIC":
		return ResourceTopic, nil
	case "GROUP":
		return ResourceGroup, nil
	case "BROKER":
		return ResourceBroker, nil
	default:
		return ResourceUnknown, NewError(ErrInvalidArg, "Unknown resource type", false)
	}
}
1346006
func (m *Method) inheritProtocols(parent []string) {
	for _, p := range parent {
		m.Protocols = appendStrNotExist(p, m.Protocols)
	}
}
88673
func (resource *Specimen) MarshalJSON() ([]byte, error) {
	resource.ResourceType = "Specimen"
	// Dereferencing the pointer to avoid infinite recursion.
	// Passing in plain old x (a pointer to Specimen), would cause this same
	// MarshallJSON function to be called again
	return json.Marshal(*resource)
}
592843
func (resource *ProcedureRequest) MarshalJSON() ([]byte, error) {
	resource.ResourceType = "ProcedureRequest"
	// Dereferencing the pointer to avoid infinite recursion.
	// Passing in plain old x (a pointer to ProcedureRequest), would cause this same
	// MarshallJSON function to be called again
	return json.Marshal(*resource)
}
157549
func (resource *EligibilityRequest) MarshalJSON() ([]byte, error) {
	resource.ResourceType = "EligibilityRequest"
	// Dereferencing the pointer to avoid infinite recursion.
	// Passing in plain old x (a pointer to EligibilityRequest), would cause this same
	// MarshallJSON function to be called again
	return json.Marshal(*resource)
}
116360
func (resource *ClaimResponse) MarshalJSON() ([]byte, error) {
	resource.ResourceType = "ClaimResponse"
	// Dereferencing the pointer to avoid infinite recursion.
	// Passing in plain old x (a pointer to ClaimResponse), would cause this same
	// MarshallJSON function to be called again
	return json.Marshal(*resource)
}
1217464
func Inherit(name string, property string, opts *InheritOpts) error {
	cmd := newCmd("inherit")
	if opts != nil {
		cmd = addOpt(cmd, opts.Recurse, "-r")
		cmd = addOpt(cmd, opts.Received, "-S")
	}
	cmd = addNonEmpty(cmd, property, name)
	return zExecNoOut(cmd)
}
651444
func (resource *Practitioner) MarshalJSON() ([]byte, error) {
	resource.ResourceType = "Practitioner"
	// Dereferencing the pointer to avoid infinite recursion.
	// Passing in plain old x (a pointer to Practitioner), would cause this same
	// MarshallJSON function to be called again
	return json.Marshal(*resource)
}
1055631
func (resource *Parameters) MarshalJSON() ([]byte, error) {
	resource.ResourceType = "Parameters"
	// Dereferencing the pointer to avoid infinite recursion.
	// Passing in plain old x (a pointer to Parameters), would cause this same
	// MarshallJSON function to be called again
	return json.Marshal(*resource)
}
1190034
func (resource *Condition) MarshalJSON() ([]byte, error) {
	resource.ResourceType = "Condition"
	// Dereferencing the pointer to avoid infinite recursion.
	// Passing in plain old x (a pointer to Condition), would cause this same
	// MarshallJSON function to be called again
	return json.Marshal(*resource)
}
252123
func (resource *AllergyIntolerance) MarshalJSON() ([]byte, error) {
	resource.ResourceType = "AllergyIntolerance"
	// Dereferencing the pointer to avoid infinite recursion.
	// Passing in plain old x (a pointer to AllergyIntolerance), would cause this same
	// MarshallJSON function to be called again
	return json.Marshal(*resource)
}