// objectItem returns the printable HCL form of an object item. An object type
// starts with one/multiple keys and has a value. The value might be of any
// type.
160069
func (p *printer) objectItem(o *ast.ObjectItem) []byte {
	defer un(trace(p, fmt.Sprintf("ObjectItem: %s", o.Keys[0].Token.Text)))
	var buf bytes.Buffer

	if o.LeadComment != nil {
		for _, comment := range o.LeadComment.List {
			buf.WriteString(comment.Text)
			buf.WriteByte(newline)
		}
	}

	// If key and val are on different lines, treat line comments like lead comments.
	if o.LineComment != nil && o.Val.Pos().Line != o.Keys[0].Pos().Line {
		for _, comment := range o.LineComment.List {
			buf.WriteString(comment.Text)
			buf.WriteByte(newline)
		}
	}

	for i, k := range o.Keys {
		buf.WriteString(k.Token.Text)
		buf.WriteByte(blank)

		// reach end of key
		if o.Assign.IsValid() && i == len(o.Keys)-1 && len(o.Keys) == 1 {
			buf.WriteString("=")
			buf.WriteByte(blank)
		}
	}

	buf.Write(p.output(o.Val))

	if o.LineComment != nil && o.Val.Pos().Line == o.Keys[0].Pos().Line {
		buf.WriteByte(blank)
		for _, comment := range o.LineComment.List {
			buf.WriteString(comment.Text)
		}
	}

	return buf.Bytes()
}
407533
func (s *Store) deleteItem(ident Ident) (err error) {
	var variants []string
	variants, err = s.Variants(ident.Location)
	switch {
	case err == ErrNotFound:
		return nil
	case err != nil:
		return
	}
	// delete each variant of the specified item
	for _, v := range variants {
		variant := ident
		variant.Variant = v
		variant.Version = Version{} // force delete it no matter the zk version
		if err = s.deleteVariant(variant); err != nil {
			return
		}
	}
	// and then delete the actual parent node
	identPath, err := s.identPath(ident)
	if err != nil {
		return
	}
	err = s.conn.Delete(identPath, ident.actualVersion())
	switch err {
	case zk.ErrNoNode:
		return nil
	case zk.ErrBadVersion:
		return ErrVersionConflict
	}
	return
}
894986
func SetItem(key, item string) (err error) {
	if localStorage == nil || localStorage == js.Undefined {
		return ErrLocalStorageNotSupported
	}
	defer func() {
		if r := recover(); r != nil {
			var ok bool
			err, ok = r.(error)
			if !ok {
				err = fmt.Errorf("could not use local storage: %v", r)
			}
		}
	}()

	localStorage.Call("setItem", key, item)
	return nil
}
860657
func (collection *Collection) CreateItem(label string, secret *Secret, replace bool) (*Item, error) {
  properties := make(map[string]dbus.Variant)
  attributes := make(map[string]string)

  attributes["profile"] = label
  properties["org.freedesktop.Secret.Item.Label"] = dbus.MakeVariant(label)
  properties["org.freedesktop.Secret.Item.Attributes"] = dbus.MakeVariant(attributes)

  var path   dbus.ObjectPath
  var prompt dbus.ObjectPath

  err := collection.dbus.Call("org.freedesktop.Secret.Collection.CreateItem", 0, properties, secret, replace).Store(&path, &prompt)
  if err != nil {
    return &Item{}, err
  }

  if isPrompt(prompt) {
    prompt := NewPrompt(collection.conn, prompt)

    result, err := prompt.Prompt()
    if err != nil {
      return &Item{}, err
    }

    path = result.Value().(dbus.ObjectPath)
  }

  return NewItem(collection.conn, path), nil
}
750405
func (s *SegmentsResponse) SetItem(v []*SegmentResponse) *SegmentsResponse {
	s.Item = v
	return s
}
245001
func AddItem(item Item) error {
	cfDict, err := ConvertMapToCFDictionary(item.attr)
	if err != nil {
		return err
	}
	defer Release(C.CFTypeRef(cfDict))

	errCode := C.SecItemAdd(cfDict, nil)
	err = checkError(errCode)
	return err
}
1011871
func (s *GetStagesOutput) SetItem(v []*Stage) *GetStagesOutput {
	s.Item = v
	return s
}
878817
func objectFields(obj valueObject, h Hidden) []string {
	var r []string
	for fieldName, hide := range objectFieldsVisibility(obj) {
		if h == withHidden || hide != ast.ObjectFieldHidden {
			r = append(r, fieldName)
		}
	}
	return r
}
986161
func (g *Grid) RemoveItem(p Primitive) *Grid {
	for index := len(g.items) - 1; index >= 0; index-- {
		if g.items[index].Item == p {
			g.items = append(g.items[:index], g.items[index+1:]...)
		}
	}
	return g
}
479195
func (c *ClusterManager) ObjectStoreInspect(objectstoreID string) (*api.ObjectstoreInfo, error) {
	return c.objstoreManager.ObjectStoreInspect(objectstoreID)
}
1136441
func (s *ExportJobsResponse) SetItem(v []*ExportJobResponse) *ExportJobsResponse {
	s.Item = v
	return s
}
469737
func (d *DataBagService) CreateItem(databagName string, databagItem DataBagItem) (err error) {
	body, err := JSONReader(databagItem)
	if err != nil {
		return
	}
	path := fmt.Sprintf("data/%s", databagName)
	return d.client.magicRequestDecoder("POST", path, body, nil)
}
396578
func (s *Scheme) ObjectKind(obj Object) (unversioned.GroupVersionKind, error) {
	return s.raw.ObjectKind(obj)
}
364872
func (node List) Item(idx int) Node {
	if idx >= 0 && idx < len(node) {
		return node[idx]
	}
	return nil
}
246632
func (d *decodeState) objectInterface() map[string]interface{} {
	m := make(map[string]interface{})
	for {
		// Read opening " of string key or closing }.
		op := d.scanWhile(ScanSkipSpace)
		if op == ScanEndObject {
			// closing } - can only happen on first iteration.
			break
		}
		if op != ScanBeginLiteral {
			d.error(errPhase)
		}

		// Read string key.
		start := d.off - 1
		op = d.scanWhile(ScanContinue)
		item := d.data[start : d.off-1]
		key, ok := unquote(item)
		if !ok {
			d.error(errPhase)
		}

		// Read : before value.
		if op == ScanSkipSpace {
			op = d.scanWhile(ScanSkipSpace)
		}
		if op != ScanObjectKey {
			d.error(errPhase)
		}

		// Read value.
		m[key] = d.valueInterface()

		// Next token must be , or }.
		op = d.scanWhile(ScanSkipSpace)
		if op == ScanEndObject {
			break
		}
		if op != ScanObjectValue {
			d.error(errPhase)
		}
	}
	return m
}
1140830
func (i *Info) ObjectName() string {
	if i.Mapping != nil {
		return fmt.Sprintf("%s/%s", i.Mapping.Resource.Resource, i.Name)
	}
	gvk := i.Object.GetObjectKind().GroupVersionKind()
	if len(gvk.Group) == 0 {
		return fmt.Sprintf("%s/%s", strings.ToLower(gvk.Kind), i.Name)
	}
	return fmt.Sprintf("%s.%s/%s\n", strings.ToLower(gvk.Kind), gvk.Group, i.Name)
}
1288277
func (m *Microdata) addItem(item *Item) {
	m.Items = append(m.Items, item)
}