Delete email address(es)

@link https://developer.github.com/v3/users/emails/#delete-email-addresses

@param array $addresses

@return bool
@throws \Exception
480469
public function deleteEmailAddress(array $addresses = []): bool
    {
        $this->getApi()->request($this->getApi()->sprintf('/user/emails'), Request::METHOD_DELETE, $addresses);

        if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
            return true;
        }

        return false;
    }
130903
public function deleteShippingAddress()
    {
        $request = oxNew(Request::class);
        $addressId = $request->getRequestParameter('oxaddressid');

        $address = oxNew(Address::class);
        $address->load($addressId);
        if ($this->canUserDeleteShippingAddress($address) && $this->getSession()->checkSessionChallenge()) {
            $address->delete($addressId);
        }
    }
151367
public function removeAddress(AddressInterface $address)
    {
        if (!$this->hasAddress($address)) {
            throw new \InvalidArgumentException('Trying to remove an address that does not belong to this contact');
        }

        $this->addresses->removeElement($address);

        if ($address === $this->defaultAddress) {
            if ($this->addresses->count() > 0) {
                $this->defaultAddress = $this->addresses->first();

                return;
            }

            $this->defaultAddress = null;
        }
    }
674021
public function setAddress(array $address)
    {
        if (!empty($address) && is_array($address)) {
            $this->address = $address;
        }

        return $this;
    }
1130495
public function removeContacts(array $contacts): SecurityTxt
    {
        if (!$this->hasContacts($contacts)) {
            throw new Exception('Cannot remove contacts that do not exist.');
        }

        foreach ($contacts as $contact) {
            unset($this->contacts[$contact]);
        }

        return $this;
    }
869782
public function delete($params)
    {
        if (is_array($params)) {
            if (!empty($params['wheres'])) {
                $wheres = $this->prepareWhere($params['wheres']);
            } else {
                return false;
            }
            $query = "DELETE FROM `{$params['table']}` {$wheres};";
            if (isset($params['debug']) and strtolower($params['debug']) === 'on') {
                var_dump($query);
            }

            return $query;
        } else {
            return false;
        }
    }
524070
private function cleanAddress($address, $updatableFields)
    {
        if (is_array($address)) {
            /** @var UpdatableFieldsConstructor $updatableFieldsConstructor */
            $updatableFieldsConstructor = oxNew(UpdatableFieldsConstructor::class);
            $cleaner = $updatableFieldsConstructor->getAllowedFieldsCleaner($updatableFields);
            return $cleaner->filterByUpdatableFields($address);
        }

        return $address;
    }
1085790
public function deleteMultiple($keys): bool
    {
        if (
            !\is_array($keys)
            &&
            !($keys instanceof \Traversable)
        ) {
            throw new InvalidArgumentException('$keys is not iterable:' . \print_r($keys, true));
        }

        $results = [];
        foreach ((array) $keys as $key) {
            $results[] = $this->delete($key);
        }

        return !\in_array(false, $results, true);
    }
1066004
public function emailOutputTo($addresses)
    {
        if (is_null($this->_output) || $this->_output == $this->getDefaultOutput()) {
            throw new InvalidCallException("Must direct output to a file in order to e-mail results.");
        }
        $addresses = is_array($addresses) ? $addresses : func_get_args();
        return $this->then(function (Application $app) use ($addresses) {
            $this->emailOutput($app->mailer, $addresses);
        });
    }
674912
public function filterEmailArray(array $emails)
    {
        foreach ($emails as $email => $name) {
            if ($this->filterEmail($email)) {
                unset($emails[$email]);
            }
        }

        return $emails;
    }
279457
public function delete($models)
    {
        $params['body'] = [];

        $models->each(function($model) use (&$params)
        {
            $params['body'][] = [
                'delete' => [
                    '_id' => $model->getKey(),
                    '_index' => $this->index,
                    '_type' => $model->searchableAs(),
                ]
            ];
        });

        $this->elastic->bulk($params);
    }
1144839
public function deleteIndex($keys)
    {
        if (is_string($keys)) {
            $indexName = $keys;
            if (! preg_match('#_-?1$#', $indexName)) {
                $indexName .= '_1';
            }
        } elseif (is_array($keys)) {
            $indexName = \MongoDB\generate_index_name($keys);
        } else {
            throw new \InvalidArgumentException();
        }

        try {
            return TypeConverter::toLegacy($this->collection->dropIndex($indexName));
        } catch (\MongoDB\Driver\Exception\Exception $e) {
            return ExceptionConverter::toResultArray($e) + ['nIndexesWas' => count($this->getIndexInfo())];
        }
    }
394874
def delete_email_addresses(self, addresses=[]):
        
        url = self._build_url('user', 'emails')
        return self._boolean(self._delete(url, data=dumps(addresses)),
                             204, 404)
1344917
public function delete(array $keys) {
		if (count($keys) > 1) {
			return $this->connection->deleteMulti($keys);
		}
		return $this->connection->delete(current($keys));
	}
1329752
public function setFrom(array $addresses): Email
    {
        $addresses = $this->transformAddressesToArray($addresses);
        $this->message->setFrom($addresses);

        return $this;
    }
1313690
public function deleteMultiple($keys): bool
    {
        if (!is_iterable($keys)) {
            throw new CacheException('Argument $keys is not iterable.');
        }
        if (!count($keys)) {
            return true;
        }
        $keys = array_unique($keys);
        $this->validateKeys($keys);
        $this->client->evalsha(
            $this->scripts[self::SCRIPT_DELETE],
            count($keys),
            ...$keys,
            ...[self::PREFIX_TAG, self::PREFIX_KEY_TAGS]
        );
        $this->client->del(
            ...array_map(function ($key) {
                return self::PREFIX_KEY_VALUE . $key;
            }, $keys),
            ...array_map(function ($key) {
                return self::PREFIX_KEY_TAGS . $key;
            }, $keys)
        );
        return true;
    }
926014
public function delete(string $domain, string $address)
    {
        Assert::stringNotEmpty($domain);
        Assert::stringNotEmpty($address);

        $response = $this->httpDelete(sprintf('/v3/%s/unsubscribes/%s', $domain, $address));

        return $this->hydrateResponse($response, DeleteResponse::class);
    }