// ObjectResponseFromIter get all objects for an iterator.
558969
func ObjectResponseFromIter(iter ObjectIterator) (*ObjectsResponse, error) {
	objs, err := ObjectsAll(iter)
	if err != nil {
		return nil, err
	}
	return &ObjectsResponse{Objects: objs}, nil
}
1275235
func (ListISOs) Each(resp interface{}, callback IterateItemFunc) {
	items, ok := resp.(*ListISOsResponse)
	if !ok {
		callback(nil, fmt.Errorf("wrong type, ListISOsResponse was expected, got %T", resp))
		return
	}

	for i := range items.ISO {
		if !callback(&items.ISO[i], nil) {
			break
		}
	}
}
927872
func (ListOSCategories) Each(resp interface{}, callback IterateItemFunc) {
	items, ok := resp.(*ListOSCategoriesResponse)
	if !ok {
		callback(nil, fmt.Errorf("wrong type, ListOSCategoriesResponse was expected, got %T", resp))
		return
	}

	for i := range items.OSCategory {
		if !callback(&items.OSCategory[i], nil) {
			break
		}
	}
}
853861
func getResponseFromJSON(ctx context.Context, r *httpRequest, v interface{}) error {
	r.addHeader("User-Agent", MailgunGoUserAgent)
	response, err := r.makeGetRequest(ctx)
	if err != nil {
		return err
	}
	if notGood(response.Code, expected) {
		return newError(r.URL, expected, response)
	}
	return response.parseFromJSON(v)
}
154632
func (c *Collector) OnResponse(f ResponseCallback) {
	c.lock.Lock()
	if c.responseCallbacks == nil {
		c.responseCallbacks = make([]ResponseCallback, 0, 4)
	}
	c.responseCallbacks = append(c.responseCallbacks, f)
	c.lock.Unlock()
}
336616
func asyncCreationRespondDecorator(original autorest.RespondDecorator) autorest.RespondDecorator {
	return func(r autorest.Responder) autorest.Responder {
		return autorest.ResponderFunc(func(resp *http.Response) error {
			if resp.Body != nil {
				if err := overrideProvisioningState(resp); err != nil {
					return err
				}
			}
			return original(r).Respond(resp)
		})
	}
}
105699
func (f *FS) Objects(ctx context.Context, q cloudstorage.Query) (cloudstorage.ObjectIterator, error) {
	return cloudstorage.NewObjectPageIterator(ctx, f, q), nil
}
1128825
func (c *Client) MultipleGetObjects(requests []IndexedGetObject, objects interface{}, opts ...interface{}) (err error) {
	if len(requests) == 0 {
		return
	}
	res := getObjectsRes{objects}
	body := map[string]interface{}{"requests": requests}
	path := c.path("/indexes/*/objects")
	err = c.transport.Request(&res, http.MethodPost, path, body, call.Read, opts...)
	return
}
500972
func (r Brand) GetAllTicketSubjects(account *datatypes.Account) (resp []datatypes.Ticket_Subject, err error) {
	params := []interface{}{
		account,
	}
	err = r.Session.DoRequest("SoftLayer_Brand", "getAllTicketSubjects", params, &r.Options, &resp)
	return
}
914571
func GetResponseWriter(ctx context.Context) (http.ResponseWriter, error) {
	v := ctx.Value("http.response")

	rw, ok := v.(http.ResponseWriter)
	if !ok || rw == nil {
		return nil, ErrNoResponseWriterContext
	}

	return rw, nil
}
326109
func (j *JsonQuery) ArrayOfObjects(s ...string) ([]map[string]interface{}, error) {
	array, err := j.Array(s...)
	if err != nil {
		return []map[string]interface{}{}, err
	}
	toReturn := make([]map[string]interface{}, len(array))
	for index, val := range array {
		toReturn[index], err = objectFromInterface(val)
		if err != nil {
			return toReturn, err
		}
	}
	return toReturn, nil
}
646841
func (p *parser) parseObjectRemainder(tok *token) (ast.Node, *token, error) {
	var fields ast.ObjectFields
	literalFields := make(LiteralFieldSet)
	binds := make(ast.IdentifierSet)

	gotComma := false
	first := true

	for {
		next := p.pop()
		if !gotComma && !first {
			if next.kind == tokenComma {
				next = p.pop()
				gotComma = true
			}
		}

		if next.kind == tokenBraceR {
			return &ast.Object{
				NodeBase:      ast.NewNodeBaseLoc(locFromTokens(tok, next)),
				Fields:        fields,
				TrailingComma: gotComma,
			}, next, nil
		}

		if next.kind == tokenFor {
			// It's a comprehension
			numFields := 0
			numAsserts := 0
			var field ast.ObjectField
			for _, f := range fields {
				if f.Kind == ast.ObjectLocal {
					continue
				}
				if f.Kind == ast.ObjectAssert {
					numAsserts++
					continue
				}
				numFields++
				field = f
			}

			if numAsserts > 0 {
				return nil, nil, MakeStaticError("Object comprehension cannot have asserts.", next.loc)
			}
			if numFields != 1 {
				return nil, nil, MakeStaticError("Object comprehension can only have one field.", next.loc)
			}
			if field.Hide != ast.ObjectFieldInherit {
				return nil, nil, MakeStaticError("Object comprehensions cannot have hidden fields.", next.loc)
			}
			if field.Kind != ast.ObjectFieldExpr {
				return nil, nil, MakeStaticError("Object comprehensions can only have [e] fields.", next.loc)
			}
			spec, last, err := p.parseComprehensionSpecs(tokenBraceR)
			if err != nil {
				return nil, nil, err
			}
			return &ast.ObjectComp{
				NodeBase:      ast.NewNodeBaseLoc(locFromTokens(tok, last)),
				Fields:        fields,
				TrailingComma: gotComma,
				Spec:          *spec,
			}, last, nil
		}

		if !gotComma && !first {
			return nil, nil, MakeStaticError("Expected a comma before next field.", next.loc)
		}
		first = false

		switch next.kind {
		case tokenBracketL, tokenIdentifier, tokenStringDouble, tokenStringSingle,
			tokenStringBlock, tokenVerbatimStringDouble, tokenVerbatimStringSingle:
			var kind ast.ObjectFieldKind
			var expr1 ast.Node
			var id *ast.Identifier
			switch next.kind {
			case tokenIdentifier:
				kind = ast.ObjectFieldID
				id = (*ast.Identifier)(&next.data)
			case tokenStringDouble, tokenStringSingle,
				tokenStringBlock, tokenVerbatimStringDouble, tokenVerbatimStringSingle:
				kind = ast.ObjectFieldStr
				expr1 = tokenStringToAst(next)
			default:
				kind = ast.ObjectFieldExpr
				var err error
				expr1, err = p.parse(maxPrecedence)
				if err != nil {
					return nil, nil, err
				}
				_, err = p.popExpect(tokenBracketR)
				if err != nil {
					return nil, nil, err
				}
			}

			isMethod := false
			methComma := false
			var params *ast.Parameters
			if p.peek().kind == tokenParenL {
				p.pop()
				var err error
				params, methComma, err = p.parseParameters("method parameter")
				if err != nil {
					return nil, nil, err
				}
				isMethod = true
			}

			plusSugar, hide, err := p.parseObjectAssignmentOp()
			if err != nil {
				return nil, nil, err
			}

			if plusSugar && isMethod {
				return nil, nil, MakeStaticError(
					fmt.Sprintf("Cannot use +: syntax sugar in a method: %v", next.data), next.loc)
			}

			if kind != ast.ObjectFieldExpr {
				if !literalFields.Add(LiteralField(next.data)) {
					return nil, nil, MakeStaticError(
						fmt.Sprintf("Duplicate field: %v", next.data), next.loc)
				}
			}

			body, err := p.parse(maxPrecedence)
			if err != nil {
				return nil, nil, err
			}

			var method *ast.Function
			if isMethod {
				method = &ast.Function{
					Parameters:    *params,
					TrailingComma: methComma,
					Body:          body,
				}
			}

			fields = append(fields, ast.ObjectField{
				Kind:          kind,
				Hide:          hide,
				SuperSugar:    plusSugar,
				MethodSugar:   isMethod,
				Method:        method,
				Expr1:         expr1,
				Id:            id,
				Params:        params,
				TrailingComma: methComma,
				Expr2:         body,
			})

		case tokenLocal:
			varID, err := p.popExpect(tokenIdentifier)
			if err != nil {
				return nil, nil, err
			}

			id := ast.Identifier(varID.data)

			if binds.Contains(id) {
				return nil, nil, MakeStaticError(fmt.Sprintf("Duplicate local var: %v", id), varID.loc)
			}

			// TODO(sbarzowski) Can we reuse regular local bind parsing here?

			isMethod := false
			funcComma := false
			var params *ast.Parameters
			if p.peek().kind == tokenParenL {
				p.pop()
				isMethod = true
				params, funcComma, err = p.parseParameters("function parameter")
				if err != nil {
					return nil, nil, err
				}
			}
			_, err = p.popExpectOp("=")
			if err != nil {
				return nil, nil, err
			}

			body, err := p.parse(maxPrecedence)
			if err != nil {
				return nil, nil, err
			}

			var method *ast.Function
			if isMethod {
				method = &ast.Function{
					Parameters:    *params,
					TrailingComma: funcComma,
					Body:          body,
				}
			}

			binds.Add(id)

			fields = append(fields, ast.ObjectField{
				Kind:          ast.ObjectLocal,
				Hide:          ast.ObjectFieldVisible,
				SuperSugar:    false,
				MethodSugar:   isMethod,
				Method:        method,
				Id:            &id,
				Params:        params,
				TrailingComma: funcComma,
				Expr2:         body,
			})

		case tokenAssert:
			cond, err := p.parse(maxPrecedence)
			if err != nil {
				return nil, nil, err
			}
			var msg ast.Node
			if p.peek().kind == tokenOperator && p.peek().data == ":" {
				p.pop()
				msg, err = p.parse(maxPrecedence)
				if err != nil {
					return nil, nil, err
				}
			}

			fields = append(fields, ast.ObjectField{
				Kind:  ast.ObjectAssert,
				Hide:  ast.ObjectFieldVisible,
				Expr2: cond,
				Expr3: msg,
			})
		default:
			return nil, nil, makeUnexpectedError(next, "parsing field definition")
		}
		gotComma = false
	}
}
577029
func (RPCResponse *RPCResponse) GetObject(toType interface{}) error {
	js, err := json.Marshal(RPCResponse.Result)
	if err != nil {
		return err
	}

	err = json.Unmarshal(js, toType)
	if err != nil {
		return err
	}

	return nil
}
150986
func AllFuncs(fns ...ObjectFunc) ObjectFunc {
	return func(obj runtime.Object) error {
		for _, fn := range fns {
			if fn == nil {
				continue
			}
			if err := fn(obj); err != nil {
				return err
			}
		}
		return nil
	}
}
152463
func NewObjectIterator(s Slice, allowRandomIteration ...bool) (*ObjectIterator, error) {
	if !s.IsObject() {
		return nil, InvalidTypeError{"Expected Object slice"}
	}
	size, err := s.Length()
	if err != nil {
		return nil, WithStack(err)
	}
	i := &ObjectIterator{
		s:        s,
		position: 0,
		size:     size,
	}
	if size > 0 {
		if h := s.head(); h == 0x14 {
			i.current, err = s.KeyAt(0, false)
		} else if optionalBool(allowRandomIteration, false) {
			i.current = s[s.findDataOffset(h):]
		}
	}
	return i, nil
}
1359424
func (d *domainClient) QueryObjects(ctx context.Context, args *QueryObjectsArgs) (reply *QueryObjectsReply, err error) {
	reply = new(QueryObjectsReply)
	if args != nil {
		err = rpcc.Invoke(ctx, "Runtime.queryObjects", args, reply, d.conn)
	} else {
		err = rpcc.Invoke(ctx, "Runtime.queryObjects", nil, reply, d.conn)
	}
	if err != nil {
		err = &internal.OpError{Domain: "Runtime", Op: "QueryObjects", Err: err}
	}
	return
}
807190
func (ListNetworkOfferings) Each(resp interface{}, callback IterateItemFunc) {
	items, ok := resp.(*ListNetworkOfferingsResponse)
	if !ok {
		callback(nil, fmt.Errorf("wrong type, ListNetworkOfferingsResponse was expected, got %T", resp))
		return
	}

	for i := range items.NetworkOffering {
		if !callback(&items.NetworkOffering[i], nil) {
			break
		}
	}
}