Set the addon for a subscription.

@param SetAddon\RequestData $requestData The request data.
@return SetAddon\ApiResponse
559803
public function setSubscriptionAddon(SetAddon\RequestData $requestData)
    {
        $request = new SetAddon\Request($requestData);

        return $this->sendRequest($request, SetAddon\ApiResponse::class);
    }
807410
public function setRequestData($requestData)
    {
        if (is_array($requestData)) {
            $this->requestData = http_build_query($requestData);
        } else {
            $this->requestData = $requestData;
        }
        return $this;
    }
111229
public function modifyResponse(Request $request, ResponseInterface $response)
    {
        if (!$this->isEnabled() || $response instanceof JsonResponse) {
            return $response;
        }

        return $this->injectDebugBar($response);
    }
971457
public function setBodyEntity($bodyEntity, $requestFormat = null)
    {
        $this->bodyEntity = $bodyEntity;
        if ($requestFormat !== null) {
            $this->setRequestFormat($requestFormat);
        }

        return $this;
    }
246546
private function addCustomerLink($eventData)
    {
        // The customerId is set in session if the Magento_Persistent module is enabled and a persistent session exists.
        if ($this->customerSession->getCustomerId() !== null) {
            $customerId = $this->customerSession->getCustomerId();
            $sessionId  = $eventData['session']['uid'] ?? null;
            $visitorId  = $eventData['session']['vid'] ?? null;

            if ($sessionId && $visitorId) {
                $data = [
                    'customer_id' => $customerId,
                    'session_id'  => $sessionId,
                    'visitor_id'  => $visitorId,
                ];

                if ($this->helper->isAnonymizationEnabled()) {
                    $date = new \DateTime();
                    $date->modify(sprintf('+ %d days', $this->helper->getAnonymizationDelay()));
                    $data['delete_after'] = $date;
                }

                $this->customerLinkResource->saveLink($data);
            }
        }
    }
759764
public function createAddress(RequestDataBag $requestData, SalesChannelContext $context): JsonResponse
    {
        $addressId = $this->addressService->create($requestData, $context);

        $this->salesChannelContextService->refresh(
            $context->getSalesChannel()->getId(),
            $context->getToken(),
            $context->getContext()->getLanguageId()
        );

        return new JsonResponse($this->serialize($addressId));
    }
819341
public function modifyResponse(Request $request, Response $response)
    {
        $app = $this->app;

        if (is_admin_panel() || $app->runningInConsole() || $this->isDebugbarRequest() || $request->ajax()) {
            return $response;
        }

        $this->injectAdminBar($response);

        return $response;
    }
392183
public function createPaymentReference(Structure\RequestReferenceDetails $paymentData)
    {
        $this->response = parent::createPaymentReference($this->entity, $paymentData);

        /**
         * Checks the state of the platform integration.
         */
        if (Exception\IntegrationState::check($this->response->integrationState)) {
            throw new Exception\IntegrationState($this->response->integrationState);
        }

        /**
         * In case an error code is returned not related to the integration state.
         * (eg.: maximum daily amount exceeded, maximum reference amount, etc.)
         */
        if ($this->response->state == 0) {
            throw new Exception\IntegrationResponse(
                $this->response->err_msg,
                $this->response->err_code
            );
        }

        return $this->response;
    }
408511
public function setRequestUri(string $requestUri) : Request
    {
        $pos = strpos($requestUri, '?');

        if ($pos === false) {
            $this->path = $requestUri;
            $this->queryString = '';
            $this->query = [];
        } else {
            $this->path        = substr($requestUri, 0, $pos);
            $this->queryString = substr($requestUri, $pos + 1);

            if ($this->queryString === '') {
                $this->query = [];
            } else {
                parse_str($this->queryString, $this->query);
            }
        }

        $this->requestUri = $requestUri;

        return $this;
    }
942316
protected function getAddDatasetCode($requestId, $data, $suffix = null)
    {
        $js = sprintf("%s.addDataSet(%s, \"%s\"%s);\n",
            $this->variableName,
            json_encode($data),
            $requestId,
            $suffix ? ", " . json_encode($suffix) : ''
        );
        return $js;
    }
166079
private function set(array $postData)
    {
        return $this->putJson(sprintf(self::COMMUNITY_ENDPOINT . 'communities/%s', $this->id()), $postData);
    }
1269164
public function submitForm($buttonText, $formData = null)
    {
        $this->client()->submit(
            $this->fillForm($buttonText, $formData)
        );

        $this->currentPage = $this->client()->getHistory()->current()->getUri();

        $this->clearInputs()->assertPageLoaded($this->currentPage());

        return $this;
    }
276985
public static function createFromResponse($responseData)
    {
        $verifyCode = new self(null, null);
        $verifyCode->setRawResponseData($responseData)
            ->processResponse();

        if ($verifyCode['status'] !== 0 && $verifyCode['status'] !== '0') {
            throw new Exception($verifyCode['err_msg']);
        }

        return $verifyCode;
    }
523175
public function get($requestPath, array $getData = [])
    {
        $requestUri = sprintf('%s/%s', $this->baseUri, $requestPath);
        if (0 !== \count($getData)) {
            $requestUri = sprintf('%s?%s', $requestUri, http_build_query($getData));
        }

        return $this->responseHandler(
            'GET',
            $requestPath,
            $this->httpClient->get($requestUri)
        );
    }
499282
public RequestResponse setResponseData(byte[] responseData) {
        this.responseData = responseData;
        try {
            responseJson = responseData != null ? SerializationUtils.readJson(responseData) : null;
        } catch (Exception e) {
            responseJson = null;
            LOGGER.error(e.getMessage(), e);
        }
        return this;
    }
907068
public function addFromResponse(ResponseInterface $response, RequestInterface $request)
    {
        $uri = $request->getUri();
        $host = $uri->getHost();
        $path = $uri->getPath() ?: '/';

        $cookies = static::parseSetCookieHeader($response->getHeader('Set-Cookie'));
        $cookies = $this->setRequestDefaults($cookies, $host, $path);
        $new = clone $this;
        foreach ($cookies as $cookie) {
            $new->cookies[$cookie->getId()] = $cookie;
        }
        $new->removeExpiredCookies($host, $path);

        return $new;
    }
1002062
public function renewSubscription($subscriptionId)
    {
        $requestData = new Renew\RequestData($subscriptionId);
        $request = new Renew\Request($requestData);

        return $this->sendRequest($request, Renew\ApiResponse::class);
    }