// NoAutomaticIDFields applies to a `Store` or `Model` type.  It allows you
// to turn off the default behavior that will automatically create
// an ID/int Primary Key for each model.
343694
func NoAutomaticIDFields() {
	if s, ok := relationalStoreDefinition(false); ok {
		s.NoAutoIDFields = true
	} else if m, ok := relationalModelDefinition(false); ok {
		delete(m.RelationalFields, "ID")
	}
}
766478
func (s *GetAutomationExecutionInput) SetAutomationExecutionId(v string) *GetAutomationExecutionInput {
	s.AutomationExecutionId = &v
	return s
}
1051779
func (s *UpdateUserPoolInput) SetAutoVerifiedAttributes(v []*string) *UpdateUserPoolInput {
	s.AutoVerifiedAttributes = v
	return s
}
233657
func (bldr *TodoQueryBuilder) KeysOnly() *TodoQueryBuilder {
	bldr.q = bldr.q.KeysOnly()
	if bldr.plugin != nil {
		bldr.plugin.KeysOnly()
	}
	return bldr
}
877576
func (nDB *NetworkDB) SetPrimaryKey(key []byte) {
	logrus.Debugf("Primary Key %.5s", hex.EncodeToString(key))
	nDB.RLock()
	defer nDB.RUnlock()
	for _, dbKey := range nDB.config.Keys {
		if bytes.Equal(key, dbKey) {
			if nDB.keyring != nil {
				nDB.keyring.UseKey(dbKey)
			}
			break
		}
	}
}
253437
func (s *AutoScaleService) NewDeleteAutoScaleVmProfileParams(id string) *DeleteAutoScaleVmProfileParams {
	p := &DeleteAutoScaleVmProfileParams{}
	p.p = make(map[string]interface{})
	p.p["id"] = id
	return p
}
940033
func onlyIDQuery(q *protocol.KontrolQuery) bool {
	fields := q.Fields()

	// check if any other key exist, if yes return a false
	for _, k := range keyOrder {
		v := fields[k]
		if k != "id" && v != "" {
			return false
		}
	}

	// now all other keys are empty, check finally for our ID
	if fields["id"] != "" {
		return true
	}

	// ID is empty too!
	return false
}
717706
func (ssa *SQLStorageAuthority) RevokeAuthorizationsByDomain(ctx context.Context, ident core.AcmeIdentifier) (int64, int64, error) {
	identifierJSON, err := json.Marshal(ident)
	if err != nil {
		return 0, 0, err
	}
	identifier := string(identifierJSON)
	results := []int64{0, 0}

	now := ssa.clk.Now()
	for i, table := range authorizationTables {
		for {
			authz, err := getAuthorizationIDsByDomain(ssa.dbMap.WithContext(ctx), table, identifier, now)
			if err != nil {
				return results[0], results[1], err
			}
			numAuthz := len(authz)
			if numAuthz == 0 {
				break
			}

			numRevoked, err := revokeAuthorizations(ssa.dbMap.WithContext(ctx), table, authz)
			if err != nil {
				return results[0], results[1], err
			}
			results[i] += numRevoked
			if numRevoked < int64(numAuthz) {
				return results[0], results[1], fmt.Errorf("Didn't revoke all found authorizations")
			}
		}
	}

	return results[0], results[1], nil
}
1285479
func (s *ScanOp) Fields(fields []string) *ScanOp {
	s.fieldsToRead = fields
	return s
}
735441
func (bldr *aeDataQueryBuilder) KeysOnly() *aeDataQueryBuilder {
	bldr.q = bldr.q.KeysOnly()
	if bldr.plugin != nil {
		bldr.plugin.KeysOnly()
	}
	return bldr
}
946761
func (m *Meta) GetAutoTableID(dbID int64, tableID int64) (int64, error) {
	return m.txn.HGetInt64(m.dbKey(dbID), m.autoTableIDKey(tableID))
}
134291
func (ssa *SQLStorageAuthority) RevokeAuthorizationsByDomain2(ctx context.Context, req *sapb.RevokeAuthorizationsByDomainRequest) (*corepb.Empty, error) {
	finalRevoked, pendingRevoked, err := ssa.RevokeAuthorizationsByDomain(
		ctx,
		core.AcmeIdentifier{
			Type:  core.IdentifierDNS,
			Value: *req.Domain,
		})
	if err != nil {
		return nil, err
	}

	var revokedTotal int64 = finalRevoked + pendingRevoked
	for {
		var ids []int64
		ids, err := ssa.getAuthorizationIDsByDomain2(ctx, *req.Domain)
		if err != nil {
			if err == sql.ErrNoRows {
				break
			}
			return nil, err
		}
		if len(ids) == 0 {
			break
		}
		if err = ssa.revokeAuthorizations2(ctx, ids); err != nil {
			return nil, err
		}
		revokedTotal += int64(len(ids))
	}
	// If no authorizations were revoked return a NotFoundError so that the caller
	// can decide whether that was an expected result or not. Some callers (e.g.
	// the admin-revoker tool) may wish to handle this case specifically.
	if revokedTotal == 0 {
		return nil, berrors.NotFoundError(
			"no authorizations to revoke for %q", *req.Domain)
	}
	return &corepb.Empty{}, nil
}
956722
func (s *AutoScaleService) GetAutoScalePolicyByID(id string, opts ...OptionFunc) (*AutoScalePolicy, int, error) {
	p := &ListAutoScalePoliciesParams{}
	p.p = make(map[string]interface{})

	p.p["id"] = id

	for _, fn := range append(s.cs.options, opts...) {
		if err := fn(s.cs, p); err != nil {
			return nil, -1, err
		}
	}

	l, err := s.ListAutoScalePolicies(p)
	if err != nil {
		if strings.Contains(err.Error(), fmt.Sprintf(
			"Invalid parameter id value=%s due to incorrect long value format, "+
				"or entity does not exist", id)) {
			return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
		}
		return nil, -1, err
	}

	if l.Count == 0 {
		return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
	}

	if l.Count == 1 {
		return l.AutoScalePolicies[0], l.Count, nil
	}
	return nil, l.Count, fmt.Errorf("There is more then one result for AutoScalePolicy UUID: %s!", id)
}
36910
func (t *Transaction) deleteFieldIndexes(c *Collection, id string) {
	for _, fs := range c.spec.fields {
		switch fs.indexKind {
		case noIndex:
			continue
		case numericIndex, booleanIndex:
			t.deleteNumericOrBooleanIndex(fs, c.spec, id)
		case stringIndex:
			// NOTE: this invokes a lua script which is defined in scripts/delete_string_index.lua
			t.deleteStringIndex(c.Name(), id, fs.redisName)
		}
	}
}
687586
func (s *AutoScaleService) NewDeleteAutoScalePolicyParams(id string) *DeleteAutoScalePolicyParams {
	p := &DeleteAutoScalePolicyParams{}
	p.p = make(map[string]interface{})
	p.p["id"] = id
	return p
}
1195282
func (s *InventoryConfiguration) SetOptionalFields(v []*string) *InventoryConfiguration {
	s.OptionalFields = v
	return s
}
747295
func (a *ActiveDevice) AllFields() (uv keybase1.UserVersion, deviceID keybase1.DeviceID, deviceName string, sigKey GenericKey, encKey GenericKey) {
	a.RLock()
	defer a.RUnlock()

	return a.uv, a.deviceID, a.deviceName, a.signingKey, a.encryptionKey
}