// Save - Sends event directly without persisting.
342694
func (target *NATSTarget) Save(eventData event.Event) error {
	return target.send(eventData)
}
1867
func (api *API) Save(metadata params.MetadataSaveParams) (params.ErrorResults, error) {
	all, err := imagecommon.Save(api.metadata, metadata)
	if err != nil {
		return params.ErrorResults{}, errors.Trace(err)
	}
	return params.ErrorResults{Results: all}, nil
}
887856
func (g *Generator) Save(w io.Writer, exportOpts ExportOptions) (err error) {
	var data []byte

	if g.Config.Linux != nil {
		buf, err := json.Marshal(g.Config.Linux)
		if err != nil {
			return err
		}
		if string(buf) == "{}" {
			g.Config.Linux = nil
		}
	}

	if exportOpts.Seccomp {
		data, err = json.MarshalIndent(g.Config.Linux.Seccomp, "", "\t")
	} else {
		data, err = json.MarshalIndent(g.Config, "", "\t")
	}
	if err != nil {
		return err
	}

	_, err = w.Write(data)
	if err != nil {
		return err
	}

	return nil
}
827018
func (e *Networking) Save() error {

	if e.podNS != nil {
		if err := e.podNSPathSave(); err != nil {
			return err
		}
	}

	var nis []netinfo.NetInfo
	for _, n := range e.nets {
		nis = append(nis, *n.runtime)
	}

	return netinfo.Save(e.podRoot, nis)
}
85065
func Save(filename string, img image.Image, encoder Encoder) error {
	// filename = strings.TrimSuffix(filename, filepath.Ext(filename))
	f, err := os.Create(filename)
	if err != nil {
		return err
	}
	defer f.Close()
	return encoder(f, img)
}
1230942
func (s *DB) Save(value interface{}) *DB {
	scope := s.NewScope(value)
	if !scope.PrimaryKeyZero() {
		newDB := scope.callCallbacks(s.parent.callbacks.updates).db
		if newDB.Error == nil && newDB.RowsAffected == 0 {
			return s.New().FirstOrCreate(value)
		}
		return newDB
	}
	return scope.callCallbacks(s.parent.callbacks.creates).db
}
389787
func (s *EventStore) Save(ctx context.Context, events []eh.Event, originalVersion int) error {
	if err := s.EventStore.Save(ctx, events, originalVersion); err != nil {
		return err
	}

	// Only trace events that are successfully saved.
	s.traceMu.Lock()
	defer s.traceMu.Unlock()
	if s.tracing {
		s.trace = append(s.trace, events...)
	}

	return nil
}
80184
func (p *Pubring) Save() error {
	buf, err := proto.Marshal(p.data)
	if err != nil {
		return err
	}
	return ioutil.WriteFile(p.File, buf, 0600)
}
330864
func Save(r *http.Request, w http.ResponseWriter) error {
	return GetRegistry(r).Save(w)
}
377236
func (lss *FilePVLastSignState) Save() {
	outFile := lss.filePath
	if outFile == "" {
		panic("cannot save FilePVLastSignState: filePath not set")
	}
	jsonBytes, err := cdc.MarshalJSONIndent(lss, "", "  ")
	if err != nil {
		panic(err)
	}
	err = cmn.WriteFileAtomic(outFile, jsonBytes, 0600)
	if err != nil {
		panic(err)
	}
}
987169
func (o *FileSystemSaver) Save(store uuid.Store) {

	if store.Timestamp >= o.Timestamp {
		err := o.openAndDo(o.encode, &store)
		if err == nil {
			if o.Report {
				o.Println("file system saver saved", store)
			}
		}
		o.Timestamp = store.Add(o.Duration)
	}
}
495794
func (m *EventStore) Save(ctx context.Context, events []eh.Event, originalVersion int) error {
	if m.Err != nil {
		return m.Err
	}
	for _, event := range events {
		m.Events = append(m.Events, event)
	}
	m.Context = ctx
	return nil
}
993527
func save(filename, passphrase string, data map[string]string) error {
	buf, err := seal(data, passphrase)
	if err != nil {
		return err
	}
	return ioutil.WriteFile(filename, buf, 0600)
}
167193
func (property *Property) Save() error {
	req, err := client.NewJSONRequest(
		Config,
		"POST",
		fmt.Sprintf(
			"/papi/v1/properties?contractId=%s&groupId=%s",
			property.Contract.ContractID,
			property.Group.GroupID,
		),
		property,
	)
	if err != nil {
		return err
	}

	res, err := client.Do(Config, req)
	if err != nil {
		return err
	}

	if client.IsError(res) {
		return client.NewAPIError(res)
	}

	var location client.JSONBody
	if err = client.BodyJSON(res, &location); err != nil {
		return err
	}

	req, err = client.NewRequest(
		Config,
		"GET",
		location["propertyLink"].(string),
		nil,
	)
	if err != nil {
		return err
	}

	res, err = client.Do(Config, req)
	if err != nil {
		return err
	}

	if client.IsError(res) {
		return client.NewAPIError(res)
	}

	properties := NewProperties()
	if err = client.BodyJSON(res, properties); err != nil {
		return err
	}

	property.AccountID = properties.Properties.Items[0].AccountID
	property.Contract = properties.Properties.Items[0].Contract
	property.Group = properties.Properties.Items[0].Group
	property.ContractID = properties.Properties.Items[0].ContractID
	property.GroupID = properties.Properties.Items[0].GroupID
	property.PropertyID = properties.Properties.Items[0].PropertyID
	property.PropertyName = properties.Properties.Items[0].PropertyName
	property.LatestVersion = properties.Properties.Items[0].LatestVersion
	property.StagingVersion = properties.Properties.Items[0].StagingVersion
	property.ProductionVersion = properties.Properties.Items[0].ProductionVersion
	property.Note = properties.Properties.Items[0].Note
	property.ProductID = properties.Properties.Items[0].ProductID
	property.CloneFrom = properties.Properties.Items[0].CloneFrom

	return nil
}
1161914
func (dm *DjangoMigration) Save(db XODB) error {
	if dm.Exists() {
		return dm.Update(db)
	}

	return dm.Insert(db)
}
1109782
func (s *FileSystemStorage) Save(filepath string, file File) error {
	return s.SaveWithPermissions(filepath, file, DefaultFilePermissions)
}
1194506
func (o *InvitationManager) Save(invite *JoinOrganizationInvitation) error {

	_, err := o.collection.Upsert(
		bson.M{
			"user":         invite.User,
			"organization": invite.Organization,
			"role":         invite.Role,
			"emailaddress": invite.EmailAddress,
			"phonenumber":  invite.PhoneNumber,
		}, invite)

	return err
}