Delete a community avatar image

@param string $communityId
@param string $accessToken
@throws EndpointNotSupportedByApiVersionException
@return null|array|json
549100
public function deleteCommunityAvatar($communityId, $accessToken)
    {
        if (!$this->apiVersionIsGreaterThanV3()) {
            throw new EndpointNotSupportedByApiVersionException();
        }

        return $this->delete(sprintf('communities/%s/images/avatar', $communityId), [], $accessToken);
    }
286316
public function validateAccessToken($accessToken = null)
	{
		try
		{
			$this->getOpenID($accessToken);
			return true;
		}
		catch(ApiException $e)
		{
			return false;
		}
	}
430609
public function deleteChannelFromCommunity($channelIdentifier, $accessToken)
    {
        if (!$this->apiVersionIsGreaterThanV3()) {
            throw new EndpointNotSupportedByApiVersionException();
        }

        if (!is_numeric($channelIdentifier)) {
            throw new InvalidIdentifierException('channel');
        }

        return $this->delete(sprintf('channels/%s/community', $channelIdentifier), [], $accessToken);
    }
462039
public function getCommunityPermissions($communityId, $accessToken)
    {
        if (!$this->apiVersionIsGreaterThanV3()) {
            throw new EndpointNotSupportedByApiVersionException();
        }

        return $this->get(sprintf('communities/%s/permissions', $communityId), [], $accessToken);
    }
232891
public function createCollectionThumbnail($collectionId, $itemId, $accessToken)
    {
        if (!$this->apiVersionIsGreaterThanV3()) {
            throw new EndpointNotSupportedByApiVersionException();
        }

        if (!is_string($itemId)) {
            throw new InvalidTypeException('Item ID', 'string', gettype($itemId));
        }

        $params = [
            'item_id' => $itemId,
        ];

        return $this->put(sprintf('collections/%s/thumbnail', $collectionId), $params, $accessToken);
    }
909473
public function setAccessToken(AccessToken $accessToken)
    {
        if (!$accessToken->isValid()) {
            $accessToken->refresh();
        }

        $this->accessToken = $accessToken;
    }
651795
protected function getUserImageUrl(array $response, AccessToken $token)
    {
        $image = $this->getUserImage($response, $token);

        if (isset($image['image']['imageUrl'])) {
            return $image['image']['imageUrl'];
        }
        return null;
    }
1197815
public function persistClientToken($clientId, $accessToken, $expiration, $role)
    {
        /** @var \Illuminate\Database\Query\Builder $table */
        $table = app('db')->connection()->table('clients');

        // If the record doesn't already exist, add it.
        if (! $table->where(['client_id' => $clientId])->exists()) {
            $table->insert(['client_id' => $clientId]);
        }

        // Update record with the new access token & expiration.
        $table->where(['client_id' => $clientId])->update([
            'access_token' => $accessToken,
            'access_token_expiration' => $expiration,
        ]);
    }
1359544
public function accessTokenIsValid($accessToken, $openId)
    {
        $params = [
            'openid'       => $openId,
            'access_token' => $accessToken,
        ];

        $this->apitype = 'sns';
        $this->module  = 'auth';

        $res = $this->_get('', $params);

        return $res;
    }
21066
public function removeCommunityModerator($communityId, $userId, $accessToken)
    {
        if (!$this->apiVersionIsGreaterThanV3()) {
            throw new EndpointNotSupportedByApiVersionException();
        }

        if (!is_numeric($userId)) {
            throw new InvalidIdentifierException('user');
        }

        return $this->delete(sprintf('communities/%s/moderators/%s', $communityId, $userId), [], $accessToken);
    }
1311229
public function deleteAccessToken($userId, AccessToken $accessToken)
    {
        self::requireSession();
        foreach ($this->getAccessTokenList($userId) as $k => $v) {
            if ($accessToken->getProviderId() === $v->getProviderId()) {
                if ($accessToken->getToken() === $v->getToken()) {
                    unset($_SESSION[\sprintf('_oauth2_token_%s', $userId)][$k]);
                }
            }
        }
    }
390036
public function deleteToAPI($endpoint, array $params = [], $accessToken = null)
    {
        return $this->sendRequest("DELETE", $endpoint, 'api', $params, $accessToken);
    }
172539
public static base_responses delete(nitro_service client, String communityname[]) throws Exception {
		base_responses result = null;
		if (communityname != null && communityname.length > 0) {
			snmpcommunity deleteresources[] = new snmpcommunity[communityname.length];
			for (int i=0;i<communityname.length;i++){
				deleteresources[i] = new snmpcommunity();
				deleteresources[i].communityname = communityname[i];
			}
			result = delete_bulk_request(client, deleteresources);
		}
		return result;
	}
298124
public function deleteFeedPost($channelIdentifier, $postId, $accessToken)
    {
        if ($this->apiVersionIsGreaterThanV3() && !is_numeric($channelIdentifier)) {
            throw new InvalidIdentifierException('channel');
        }

        if (!is_string($postId)) {
            throw new InvalidTypeException('Post ID', 'string', gettype($postId));
        }

        return $this->delete(sprintf('feed/%s/posts/%s', $channelIdentifier, $postId), [], $accessToken);
    }
852582
public function refreshAccessToken(AccessToken $token = null):AccessToken{

		if($token === null){
			$token = $this->storage->getAccessToken($this->serviceName);
		}

		$refreshToken = $token->refreshToken;

		if(empty($refreshToken)){

			if(!$this instanceof AccessTokenForRefresh){
				throw new ProviderException(sprintf('no refresh token available, token expired [%s]', date('Y-m-d h:i:s A', $token->expires)));
			}

			$refreshToken = $token->accessToken;
		}

		$body = [
			'client_id'     => $this->options->key,
			'client_secret' => $this->options->secret,
			'grant_type'    => 'refresh_token',
			'refresh_token' => $refreshToken,
			'type'          => 'web_server',
		];

		$request = $this->requestFactory
			->createRequest('POST', $this->refreshTokenURL ?? $this->accessTokenURL)
			->withHeader('Content-Type', 'application/x-www-form-urlencoded')
			->withHeader('Accept-Encoding', 'identity')
			->withBody($this->streamFactory->createStream(http_build_query($body, '', '&', PHP_QUERY_RFC1738)))
		;

		foreach($this->authHeaders as $header => $value){
			$request = $request->withAddedHeader($header, $value);
		}

		$newToken = $this->parseTokenResponse($this->http->sendRequest($request));

		if(empty($newToken->refreshToken)){
			$newToken->refreshToken = $refreshToken;
		}

		$this->storage->storeAccessToken($this->serviceName, $newToken);

		return $newToken;
	}
244694
protected function getUserImage(array $response, AccessToken $token)
    {
        $guid = $token->getResourceOwnerId();

        $url = 'https://social.yahooapis.com/v1/user/' . $guid . '/profile/image/' . $this->imageSize . '?format=json';

        $request = $this->getAuthenticatedRequest('get', $url, $token);

        $response = $this->getResponse($request);

        return $response;
    }
790048
public final B accessToken(String accessToken) {
        requireNonNull(accessToken, "accessToken");
        checkArgument(!accessToken.isEmpty(), "accessToken is empty.");
        this.accessToken = accessToken;
        return self();
    }