Operation deleteSenderAsyncWithHttpInfo

Delete a sender

@param  int $senderId Id of the sender (required)

@throws \InvalidArgumentException
@return \GuzzleHttp\Promise\PromiseInterface
492648
public function deleteSenderAsyncWithHttpInfo($senderId)
    {
        $returnType = '';
        $request = $this->deleteSenderRequest($senderId);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    return [null, $response->getStatusCode(), $response->getHeaders()];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        $response->getBody()
                    );
                }
            );
    }
41470
protected function send(PromiseInterface $promise)
    {
        if (!$promise->isPending())
        {
            return $promise;
        }

        $this->channel->send(
            $this->name,
            $this->message,
            Channel::MODE_STANDARD,
            function($value) use($promise) {
                $promise->resolve($value);
            },
            function($ex) use($promise) {
                $promise->reject($ex);
            },
            function($ex) use($promise) {
                $this->retryOrReset($promise, $ex);
            },
            $this->params['timeout']
        );

        return $promise;
    }
620856
public function performApiRequest(TelegramMethods $method): PromiseInterface
    {
        $this->logger->debug('Request for async API call, resetting internal values', [\get_class($method)]);
        $this->resetObjectValues();
        $option = $this->formConstructor->constructOptions($method);
        return $this->sendRequestToTelegram($method, $option)
            ->then(function (TelegramResponse $response) use ($method) {
                return $method::bindToObject($response, $this->logger);
            }, function ($error) {
                $this->logger->error($error);
                throw $error;
            });
    }
103268
public function cancel(string $id, bool $atPeriodEnd)
    {
        // Log Debug
        $this->flow->getLogger()->debug("Cancelling Subscription $id" . ($atPeriodEnd ? ' at period end.' : '.'));

        return $this->make(
            $this->flow->send(
                'post',
                $this->endpoint . '/cancel',
                [
                    'subscriptionId' => $id,
                    'at_period_end' => (int) $atPeriodEnd,
                ]
            )
        );
    }
710707
public function deleteDeliveryReceiptNotificationUrl($id, $sender = null)
    {
        return $this->client->executeRequest(
            new SMSDRDeleteCallbackRequest($id, $sender ?: $this->senderNumber)
        );
    }
1147818
public function destroyAction($sessionId, $clientIdentifier = NULL) {
		if ($this->request->getHttpRequest()->getMethod() !== 'DELETE') {
			$this->response->setStatus(405);
			$this->response->setHeader('Allow', 'DELETE');
			return;
		}

		// TODO Move the actual logic of destroying and notification to a service
		$session = $this->sessionManager->getSession($sessionId);
		if ($session !== NULL) {
			$ssoClients = $this->singleSignOnSessionManager->getRegisteredSsoClients($session);

			$message = 'Destroyed by SSO server REST service';
			if ($clientIdentifier !== NULL) {
				$message .= ' from client "' . $clientIdentifier . '"';
			}
			$session->destroy($message);

			if ($this->ssoLogger !== NULL) {
				$this->ssoLogger->log('Session service: Destroyed session "' . $sessionId . '"' . ($clientIdentifier !== NULL ? ' from client ' . $clientIdentifier : '') , LOG_INFO);
			}

			$ssoServer = $this->ssoServerFactory->create();
			$this->ssoClientNotifier->destroySession($ssoServer, $sessionId, $ssoClients);

			$this->view->assign('value', array('success' => TRUE));
		} else {
			$this->response->setStatus(404);

			$this->view->assign('value', array('error' => 'SessionNotFound'));
		}
	}
1073341
public function deleteCustomer($customerId)
    {
        $requestData = new Delete\RequestData($customerId);
        $request = new Delete\Request($requestData);

        return $this->sendRequest($request, Delete\ApiResponse::class);
    }
555685
public function deleteGrantedScopes($clientId, $subject)
    {
        ValidationUtility::ensureStringOrInteger('$clientId', $clientId);
        ValidationUtility::ensureString('$subject', $subject);

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

        return $this->callServicePostApi(
            '\Authlete\Dto\ApiResponse::fromJson',
            self::$GRANTED_SCOPES_DELETE_API_PATH . $clientId,
            null, $request);
    }
582626
function remove($user = null) {
        if($user !== null) {
            $user = $this->client->users->resolve($user);
        }
        
        return (new \React\Promise\Promise(function (callable $resolve, callable $reject) use ($user) {
            $this->client->apimanager()->endpoints->channel
                ->deleteMessageUserReaction($this->message->channel->getId(), $this->message->id, $this->emoji->identifier, ($user !== null ? $user->id : '@me'))
                ->done(function () use ($resolve) {
                    $resolve($this);
                }, $reject);
        }));
    }
714701
public function reject(Throwable $reason)
    {
        if (self::PENDING !== $this->state) {
            throw new PromiseAlreadyResolvedException('This promise is already resolved, and you\'re not allowed to resolve a promise more than once');
        }
        $this->state = self::REJECTED;
        $this->value = $reason;
        foreach ($this->subscribers as $subscriber) {
            $this->invokeCallback($subscriber[0], $subscriber[2]);
        }
    }
134122
public function UserModel_BeforeDeleteUser_Handler($Sender) {
      $UserID = GetValue('UserID', $Sender->EventArguments);
      $Options = GetValue('Options', $Sender->EventArguments, array());
      $Options = is_array($Options) ? $Options : array();
      $Content =& $Sender->EventArguments['Content'];
      
      $this->DeleteUserData($UserID, $Options, $Content);
   }
1235865
public function deleteAction($pseId)
    {
        $this->checkAuth(AdminResources::PRODUCT, [], AccessManager::VIEW);

        $results = $this->getProductSaleElements([
            'id' => $pseId
        ]);

        if ($results->getCount() == 0) {
            return new JsonResponse(
                sprintf(
                    "The product sale elements id '%d' doesn't exist",
                    $pseId
                ),
                404
            );
        }

        $event = new ProductSaleElementDeleteEvent($pseId, null);

        try {
            $this->dispatch(TheliaEvents::PRODUCT_DELETE_PRODUCT_SALE_ELEMENT, $event);
        } catch (\Exception $e) {
            return new JsonResponse(array("error" => $e->getMessage()), 500);
        }

        return $this->nullResponse(204);
    }
267399
public static function delete(
        int $cashRegisterId,
        string $tabUuid,
        int $tabItemShopId,
        int $monetaryAccountId = null,
        array $customHeaders = []
    ): BunqResponseNull {
        $apiClient = new ApiClient(static::getApiContext());
        $responseRaw = $apiClient->delete(
            vsprintf(
                self::ENDPOINT_URL_DELETE,
                [
                    static::determineUserId(),
                    static::determineMonetaryAccountId($monetaryAccountId),
                    $cashRegisterId,
                    $tabUuid,
                    $tabItemShopId,
                ]
            ),
            $customHeaders
        );

        return BunqResponseNull::castFromBunqResponse(
            new BunqResponse(null, $responseRaw->getHeaders())
        );
    }
1263441
public function delete($orderId, $fulfillmentId, FulfillmentEvent $fulfillmentEvent)
    {
        $endpoint = '/admin/orders/'.$orderId.'/fulfillments/'.$fulfillmentId.'/events/'.$fulfillmentEvent->id.'.json';
        $response = $this->request($endpoint, 'DELETE');
        return;
    }
965593
public function destroy($id, $translationId)
    {
        $content = $this->getContent($id);
        if (!empty($content)) {
            $this->authorize('delete', $content);
            $translation = $this->repository->getContentTranslationById($content, $translationId);
            if (!empty($translation)) {
                $this->repository->deleteTranslation($translation);
                return $this->respondWithSimpleSuccess(['success' => true]);
            }
        }
        return $this->respondNotFound();
    }
754504
public function deleteFeedComment($channelIdentifier, $postId, $commentId, $accessToken)
    {
        if ($this->apiVersionIsGreaterThanV3() && !is_numeric($channelIdentifier)) {
            throw new InvalidIdentifierException('channel');
        }

        return $this->delete(sprintf('feed/%s/posts/%s/comments/%s', $channelIdentifier, $postId, $commentId), [], $accessToken);
    }
826453
public function delete(MessageDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        if (null !== ($message = MessageQuery::create()->findPk($event->getMessageId()))) {
            $message
                ->setDispatcher($dispatcher)
                ->delete()
            ;

            $event->setMessage($message);
        }
    }