// GetPrivacy returns the Privacy field if it's non-nil, zero value otherwise.
10782
func (t *TeamLDAPMapping) GetPrivacy() string {
	if t == nil || t.Privacy == nil {
		return ""
	}
	return *t.Privacy
}
938845
func (e *Entity) SerializePrivate(w io.Writer, config *packet.Config) (err error) {
	err = e.PrivateKey.Serialize(w)
	if err != nil {
		return
	}
	for _, ident := range e.Identities {
		err = ident.UserId.Serialize(w)
		if err != nil {
			return
		}
		err = ident.SelfSignature.SignUserId(ident.UserId.Id, e.PrimaryKey, e.PrivateKey, config)
		if err != nil {
			return
		}
		err = ident.SelfSignature.Serialize(w)
		if err != nil {
			return
		}
	}
	for _, subkey := range e.Subkeys {
		err = subkey.PrivateKey.Serialize(w)
		if err != nil {
			return
		}
		err = subkey.Sig.SignKey(subkey.PublicKey, e.PrivateKey, config)
		if err != nil {
			return
		}
		err = subkey.Sig.Serialize(w)
		if err != nil {
			return
		}
	}
	return nil
}
533839
func (a *APIMeta) GetVerifiablePasswordAuthentication() bool {
	if a == nil || a.VerifiablePasswordAuthentication == nil {
		return false
	}
	return *a.VerifiablePasswordAuthentication
}
228853
func isPrivateIP(ipStr string) bool {
	ip := net.ParseIP(ipStr)
	for _, priv := range privateBlocks {
		if priv.Contains(ip) {
			return true
		}
	}
	return false
}
956617
func (vm *VM) getPrivateIP(authorizer autorest.Authorizer) (net.IP, error) {
	interfaceClient := network.NewInterfacesClient(vm.Creds.SubscriptionID)
	interfaceClient.Authorizer = authorizer

	iface, err := interfaceClient.Get(vm.ResourceGroup, vm.Nic, "")
	if err != nil {
		return nil, err
	}

	if iface.InterfacePropertiesFormat == nil || iface.InterfacePropertiesFormat.IPConfigurations == nil ||
		len(*iface.InterfacePropertiesFormat.IPConfigurations) == 0 {
		return nil, fmt.Errorf("VM has no private IP address")
	}
	ipConfigs := *iface.InterfacePropertiesFormat.IPConfigurations
	if len(ipConfigs) > 1 {
		return nil, fmt.Errorf("VM has multiple private IP addresses")
	}
	return net.ParseIP(*ipConfigs[0].InterfaceIPConfigurationPropertiesFormat.PrivateIPAddress), nil
}
217887
func (s *DeveloperInfo) SetPrivacyPolicy(v string) *DeveloperInfo {
	s.PrivacyPolicy = &v
	return s
}
808036
func (wc *WhisperClient) GetPrivateKey(ctx *Context, id string) ([]byte, error) {
	return wc.client.PrivateKey(ctx.context, id)
}
712586
func (t *Type) GetProperty(name string) Property {
	propInterface, ok := t.Properties[name]
	if !ok {
		panic(fmt.Errorf("property %v not exist", name))
	}

	prop := toProperty(name, propInterface)
	prop._type = t

	return prop
}
446755
func (s *cachedKeyService) GetPrivateKey(keyID string) (data.PrivateKey, data.RoleName, error) {
	s.lock.RLock()
	cachedKeyEntry, ok := s.cachedKeys[keyID]
	s.lock.RUnlock()
	if ok {
		return cachedKeyEntry.key, cachedKeyEntry.role, nil
	}

	// retrieve the key from the underlying store and put it into the cache
	privKey, role, err := s.CryptoService.GetPrivateKey(keyID)
	if err == nil {
		s.lock.Lock()
		defer s.lock.Unlock()
		// Add the key to cache
		s.cachedKeys[privKey.ID()] = &cachedKey{key: privKey, role: role}
		return privKey, role, nil
	}
	return nil, "", err
}
780084
func (api *PublicWhisperAPI) GetPublicKey(ctx context.Context, id string) (hexutil.Bytes, error) {
	key, err := api.w.GetPrivateKey(id)
	if err != nil {
		return hexutil.Bytes{}, err
	}
	return crypto.FromECDSAPub(&key.PublicKey), nil
}
857354
func getPrivateKey(keyBytes []byte, passphrase string) ([]byte, error) {
	// this section makes some small changes to code from notary/tuf/utils/x509.go
	pemBlock, _ := pem.Decode(keyBytes)
	if pemBlock == nil {
		return nil, fmt.Errorf("no valid private key found")
	}

	var err error
	if x509.IsEncryptedPEMBlock(pemBlock) {
		keyBytes, err = x509.DecryptPEMBlock(pemBlock, []byte(passphrase))
		if err != nil {
			return nil, errors.Wrap(err, "private key is encrypted, but could not decrypt it")
		}
		keyBytes = pem.EncodeToMemory(&pem.Block{Type: pemBlock.Type, Bytes: keyBytes})
	}

	return keyBytes, nil
}
364487
func (c Client) GetPrimaryUUID() (uuid string, err error) {
	states, err := c.ListNodes()
	if err != nil {
		return "", err
	}

	for _, s := range states {
		if s.Host == c.clientIP {
			return s.UUID, nil
		}
	}
	return "", fmt.Errorf("No node found with IP '%s', available nodes %+v", c.clientIP, states)
}
1190574
func (p Property) GetJSONPrimitiveType() string {

	if p.IsPrimitive() {
		return convertTypeToJSON(p.PrimitiveType)
	}

	if p.IsMap() && p.IsMapOfPrimitives() {
		return convertTypeToJSON(p.PrimitiveItemType)
	}

	if p.IsList() && p.IsListOfPrimitives() {
		return convertTypeToJSON(p.PrimitiveItemType)
	}

	return "unknown"

}
261225
func (c *Client) GetPluginPrivileges(name string, ctx context.Context) ([]PluginPrivilege, error) {
	resp, err := c.do("GET", "/plugins/privileges?remote="+name, doOptions{
		context: ctx,
	})
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	var pluginPrivileges []PluginPrivilege
	if err := json.NewDecoder(resp.Body).Decode(&pluginPrivileges); err != nil {
		return nil, err
	}
	return pluginPrivileges, nil
}
253140
func (whisper *Whisper) GetPrivateKey(id string) (*ecdsa.PrivateKey, error) {
	whisper.keyMu.RLock()
	defer whisper.keyMu.RUnlock()
	key := whisper.privateKeys[id]
	if key == nil {
		return nil, fmt.Errorf("invalid id")
	}
	return key, nil
}
1032729
func (s *RegisterDomainInput) SetPrivacyProtectRegistrantContact(v bool) *RegisterDomainInput {
	s.PrivacyProtectRegistrantContact = &v
	return s
}
714036
func (p *Plan) GetPrivateRepos() int {
	if p == nil || p.PrivateRepos == nil {
		return 0
	}
	return *p.PrivateRepos
}