// MustMarshal will try to convert the given object to JSON or panic if there's an error.
426257
func MustMarshal(object interface{}, options JSONOptions) []byte {
	output, err := json.Marshal(&object)

	if err != nil {
		panic(err)
	}

	switch {
	case options.Indent:
		buffer := bytes.Buffer{}

		// TODO(@kobolog): Expose indentation options via JSONOptions.
		json.Indent(&buffer, output, "", "\t")

		return buffer.Bytes()

	default:
		return output
	}
}
1069357
func (l *OpsWorksLayerVolumeConfigurationList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := OpsWorksLayerVolumeConfiguration{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = OpsWorksLayerVolumeConfigurationList{item}
		return nil
	}
	list := []OpsWorksLayerVolumeConfiguration{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = OpsWorksLayerVolumeConfigurationList(list)
		return nil
	}
	return err
}
94512
func (l *S3BucketRoutingRuleList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := S3BucketRoutingRule{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = S3BucketRoutingRuleList{item}
		return nil
	}
	list := []S3BucketRoutingRule{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = S3BucketRoutingRuleList(list)
		return nil
	}
	return err
}
22455
func (l *EMRClusterApplicationList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := EMRClusterApplication{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = EMRClusterApplicationList{item}
		return nil
	}
	list := []EMRClusterApplication{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = EMRClusterApplicationList(list)
		return nil
	}
	return err
}
791521
func (l *IoTTopicRuleActionList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := IoTTopicRuleAction{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = IoTTopicRuleActionList{item}
		return nil
	}
	list := []IoTTopicRuleAction{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = IoTTopicRuleActionList(list)
		return nil
	}
	return err
}
1295814
func (l *SESReceiptRuleRuleList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := SESReceiptRuleRule{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = SESReceiptRuleRuleList{item}
		return nil
	}
	list := []SESReceiptRuleRule{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = SESReceiptRuleRuleList(list)
		return nil
	}
	return err
}
1287578
func (h *HTMLElement) Unmarshal(v interface{}) error {
	return UnmarshalHTML(v, h.DOM, nil)
}
448348
func Unmarshal(data []byte, v interface{}) (err error) {
	var value interface{}
	parser := &hjsonParser{data, 0, ' '}
	parser.resetAt()
	value, err = parser.rootValue()
	if err != nil {
		return err
	}

	rv := reflect.ValueOf(v)
	if rv.Kind() != reflect.Ptr || rv.IsNil() {
		return errors.New("non-pointer " + reflect.TypeOf(v).String())
	}
	for rv.Kind() == reflect.Ptr {
		rv = rv.Elem()
	}
	defer func() {
		if e := recover(); e != nil {
			err = fmt.Errorf("%v", e)
		}
	}()
	rv.Set(reflect.ValueOf(value))
	return err
}
351789
func (r *Redis) Unmarshal(key string, object interface{}) error {
	value, err := r.Get(key)
	if err == nil {
		err = json.Unmarshal([]byte(value), object)
	}
	return err
}
1127591
func Unmarshal(r *request.Request) {
	if r.DataFilled() {
		v := reflect.Indirect(reflect.ValueOf(r.Data))
		unmarshalBody(r, v)
	}
}
871584
func (l *EMRClusterScalingTriggerList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := EMRClusterScalingTrigger{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = EMRClusterScalingTriggerList{item}
		return nil
	}
	list := []EMRClusterScalingTrigger{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = EMRClusterScalingTriggerList(list)
		return nil
	}
	return err
}
293582
func MustAst(x interface{}) []byte {
	bs, err := Ast(x)
	if err != nil {
		panic(err)
	}
	return bs
}
1039260
func (configMgr *ConfigurationManager) Unmarshal(obj interface{}) error {
	rv := reflect.ValueOf(obj)
	// only pointers are accepted
	if rv.Kind() != reflect.Ptr || rv.IsNil() {
		err := errors.New("invalid object supplied")
		openlogging.GetLogger().Error("invalid object supplied: " + err.Error())
		return err
	}

	return configMgr.unmarshal(rv, doNotConsiderTag)
}
522819
func (r *Reader) MustBool(name string) bool {
	b, err := r.readBool(name)
	if err != nil {
		panic(err)
	}
	return b
}
491984
func (l *S3BucketRoutingRuleConditionList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := S3BucketRoutingRuleCondition{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = S3BucketRoutingRuleConditionList{item}
		return nil
	}
	list := []S3BucketRoutingRuleCondition{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = S3BucketRoutingRuleConditionList(list)
		return nil
	}
	return err
}
134716
func (bm *BlockMeta) Unmarshal(bs []byte) error {
	return cdc.UnmarshalBinaryBare(bs, bm)
}
1234086
func (schema *Schema) Unmarshal(message []byte, s interface{}) error {
	v := reflect.ValueOf(s)
	vp := reflect.ValueOf(s)

	if v.Kind() == reflect.PtrTo(reflect.TypeOf(s)).Kind() {
		v = reflect.Indirect(v)
	}

	// Only structs are supported so return an empty result if the passed object
	// isn't a struct.
	if v.Kind() != reflect.Struct {
		return ErrUnsupportedType(v.Kind())
	}

	// If a pointer to a struct is passed, get the type of the dereferenced object.
	typ := reflect.TypeOf(s)
	if typ.Kind() == reflect.Ptr {
		typ = typ.Elem()
	}

	return populateStructFromSchema(schema.Definition, message, typ, v, vp)
}