Delete a collection

@param string $collectionId
@param string $accessToken
@throws EndpointNotSupportedByApiVersionException
@throws InvalidTypeException
@return null
516220
public function deleteCollection($collectionId, $accessToken)
    {
        if (!$this->apiVersionIsGreaterThanV3()) {
            throw new EndpointNotSupportedByApiVersionException();
        }

        return $this->delete(sprintf('collections/%s', $collectionId), [], $accessToken);
    }
241180
public function deleteConsumerAccessToken ( $token, $user_id, $user_is_admin = false )
	{
		if ($user_is_admin)
		{
			$this->query('
						DELETE FROM oauth_server_token
						WHERE ost_token 	 = \'%s\'
						  AND ost_token_type = \'access\'
						', $token);
		}
		else
		{
			$this->query('
						DELETE FROM oauth_server_token
						WHERE ost_token 	 = \'%s\'
						  AND ost_token_type = \'access\'
						  AND ost_usa_id_ref = %d
						', $token, $user_id);
		}
	}
1021963
private function getAccessToken(AccessToken $invalid = null)
    {
        if (!isset($this->accessToken) || $this->accessToken->hasExpired() || ($invalid && $this->accessToken === $invalid)) {
            $this->accessToken = $this->acquireAccessToken();
            if (is_callable($this->tokenSave)) {
                call_user_func($this->tokenSave, $this->accessToken);
            }
        }

        return $this->accessToken;
    }
308218
public function revoke(AccessToken $accessToken)
    {
        $options = $this->getAccessTokenOptions([]);
        $uri = $this->appendQuery(
            self::BASE_FITBIT_API_URL.'/oauth2/revoke',
            $this->buildQueryString(['token' => $accessToken->getToken()])
        );
        $request = $this->getRequest(self::METHOD_POST, $uri, $options);

        return $this->getResponse($request);
    }
390036
public function deleteToAPI($endpoint, array $params = [], $accessToken = null)
    {
        return $this->sendRequest("DELETE", $endpoint, 'api', $params, $accessToken);
    }
655839
public function setOAuthToken(AccessToken $token)
    {
        $this->access_token = $token->getToken();
        $this->access_token_expiration = $token->getExpires();
        $this->refresh_token = $token->getRefreshToken();
        $this->role = $token->getValues()['role'];
    }
462039
public function getCommunityPermissions($communityId, $accessToken)
    {
        if (!$this->apiVersionIsGreaterThanV3()) {
            throw new EndpointNotSupportedByApiVersionException();
        }

        return $this->get(sprintf('communities/%s/permissions', $communityId), [], $accessToken);
    }
1112696
public function deleteClientAuthorization($clientId, $subject)
    {
        ValidationUtility::ensureStringOrInteger('$clientId', $clientId);
        ValidationUtility::ensureString('$subject', $subject);

        $request = new ClientAuthorizationDeleteRequest();
        $request->setSubject($subject);

        return $this->callServicePostApi(
            '\Authlete\Dto\ApiResponse::fromJson',
            self::$CLIENT_AUTHORIZATION_DELETE_API_PATH . $clientId,
            null, $request);
    }
366930
public function storeAccessToken($userId, AccessToken $accessToken)
    {
        self::requireSession();
        $_SESSION[\sprintf('_oauth2_token_%s', $userId)][] = $accessToken;
    }
1267698
public function refreshToken(AccessToken $accessToken)
    {
        // request data
        $refreshToken = $accessToken->getRefreshToken();
        $scope        = $accessToken->getScope();

        if (empty($refreshToken)) {
            throw new RuntimeException('No refresh token was set');
        }

        $data = array(
            'grant_type'    => 'refresh_token',
            'refresh_token' => $refreshToken,
        );

        if (!empty($scope)) {
            $data['scope'] = $scope;
        }

        // authentication
        $header = array();

        if ($this->type == self::AUTH_BASIC) {
            $header['Authorization'] = 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret);
        }

        if ($this->type == self::AUTH_POST) {
            $data['client_id']     = $this->clientId;
            $data['client_secret'] = $this->clientSecret;
        }

        $request  = new PostRequest($this->url, $header, $data);
        $response = $this->httpClient->request($request);

        $data = Json\Parser::decode($response->getBody());

        if ($response->getStatusCode() == 200) {
            return $this->newToken($data);
        } else {
            throw new RuntimeException('Could not refresh access token');
        }
    }
381283
public function deleteAccessEntity(AccessEntity $accessEntity)
    {
        try {
            $em = $this->entityManager->getDoctrineEntityManager();
            $em->remove($accessEntity);
            $em->flush();
            
            return true;
        } catch (\Exception $e) {
            throw new Exception('Cannot delete the access entitiy "' . $uuid . '".', 0, $e);
        }
    }
88779
public function setAccessToken(array $accessToken)
    {
        if (!isset($accessToken['access_token'])) {
            throw new InvalidParamException('The wechat access_token must be set.');
        } elseif(!isset($accessToken['expire'])) {
            throw new InvalidParamException('Wechat access_token expire time must be set.');
        }
        $this->_accessToken = $accessToken;
    }
723209
public function deleteCollectorRecipient($collectorId, $recipientId)
	{
		return $this->sendRequest(
			$this->createRequest('DELETE', sprintf('collectors/%s/recipients/%s', $collectorId,  $recipientId))
		);
	}
163190
public function findByAccessToken($accessToken)
    {
        if ($accessToken === '') {
            $client = new AnonymousClient();

            $this->clients[$client->getAccessToken()] = $client;

            return $client;
        }

        if (! isset($this->clients[$accessToken])) {

            return null;
        }

        return $this->clients[$accessToken];
    }
898437
public function deleteAccount(IdentityToolkit_IdentitytoolkitRelyingpartyDeleteAccountRequest $postBody, $optParams = array())
  {
    $params = array('postBody' => $postBody);
    $params = array_merge($params, $optParams);
    return $this->call('deleteAccount', array($params), "IdentityToolkit_DeleteAccountResponse");
  }
369736
public void delete(Collection collection) {
        pm.currentTransaction().begin();
        pm.deletePersistentAll(collection);
        pm.currentTransaction().commit();
    }
1202943
public function deleteCommunityCoverImage($communityId, $accessToken)
    {
        if (!$this->apiVersionIsGreaterThanV3()) {
            throw new EndpointNotSupportedByApiVersionException();
        }

        return $this->delete(sprintf('communities/%s/images/cover', $communityId), [], $accessToken);
    }