@param \PhpSigep\Model\AbstractModel|\PhpSigep\Model\SolicitaEtiquetas $params

@throws \PhpSigep\Services\Exception
@throws InvalidArgument
@return BuscaClienteResult
498249
public function execute(AbstractModel $params)
    {
        if (!$params instanceof \PhpSigep\Model\AccessData) {
            throw new InvalidArgument();
        }

        $soapArgs = array(
            'idContrato'       => $params->getNumeroContrato(),
            'idCartaoPostagem' => $params->getCartaoPostagem(),
            'usuario'          => $params->getUsuario(),
            'senha'            => $params->getSenha(),
        );

        $result = new Result();

        try {
            if (!$params->getUsuario() || !$params->getSenha() || !$params->getNumeroContrato()
                || !$params->getCartaoPostagem()
            ) {
                throw new Exception('Para usar este serviço você precisa setar o nome de usuário, a senha, o numero ' .
                    'do contrato e o número do cartão de postagem.');
            }

            $r = SoapClientFactory::getSoapClient()->buscaCliente($soapArgs);
            if (!$r || !is_object($r) || !isset($r->return) || ($r instanceof \SoapFault)) {
                if ($r instanceof \SoapFault) {
                    throw $r;
                }
                throw new \Exception('Erro ao consultar os dados do cliente. Retorno: "' . $r . '"');
            }

            $result->setResult(new BuscaClienteResult((array)$r->return));
        } catch (\SoapFault $soapFault) {
            $result->setIsSoapFault(true);
            $result->setErrorCode($soapFault->getCode());
            $result->setErrorMsg(SoapClientFactory::convertEncoding($soapFault->getMessage()));
        } catch (\Exception $e) {
            $result->setErrorCode($e->getCode());
            $result->setErrorMsg($e->getMessage());
        }

        return $result;
    }
1220823
public function search($params)
    {
        $searchResult = $this->getRequest()->request(
            'POST',
            $this->getRequestUrl('searches'),
            $this->getSearchQuery($params)
        );

        return $this->getInputsFromSearchResult($searchResult);
    }
1336682
public function send($params)
    {
        $rst = $this->_request->post($this->_url . 'message/mass/send', $params);
        return $this->_client->rst($rst);
    }
332836
public function dispatch(...$params): ResponseInterface
    {
        /**
         * @var RequestInterface $request
         * @var ResponseInterface $response
         */
        list($request, $response) = $params;

        try {
            // before dispatcher
            $this->beforeDispatch($request, $response);

            // request middlewares
            $middlewares = $this->requestMiddleware();
            $request = RequestContext::getRequest();
            $requestHandler = new RequestHandler($middlewares, $this->handlerAdapter);
            $response = $requestHandler->handle($request);

        } catch (\Throwable $throwable) {
            /* @var ErrorHandler $errorHandler */
            $errorHandler = App::getBean(ErrorHandler::class);
            $response = $errorHandler->handle($throwable);
        }

        $this->afterDispatch($response);

        return $response;
    }
794323
public function transactionData($params)
    {
        Util::verifyKeys(
                self::$_transactionSignature,
                $params
                );
        $params["kind"] = TransparentRedirect::CREATE_TRANSACTION;
        $transactionType = isset($params['transaction']['type']) ?
            $params['transaction']['type'] :
            null;
        if ($transactionType != Transaction::SALE && $transactionType != Transaction::CREDIT) {
           throw new InvalidArgumentException(
                   'expected transaction[type] of sale or credit, was: ' .
                   $transactionType
                   );
        }

        return $this->_data($params);
    }
1371452
protected function getQueryFilter($params)
    {
        if (empty($params['FilterClass'])) {
            return null;
        }
        $filterClass = $params['FilterClass'];
        if (!is_subclass_of($filterClass, CMSSiteTreeFilter::class)) {
            throw new InvalidArgumentException("Invalid filter class passed: {$filterClass}");
        }
        return $filterClass::create($params);
    }
1184796
public function withParams(array $params): ParamHolderInterface
    {
        $param_holder = clone $this;
        $param_holder->params = array_merge($param_holder->params, $params);
        return $param_holder;
    }
1341880
public function pay($params)
	{
		$requestParams = $this->initRequestParams('pay', $params);
		$this->request('pay', $requestParams);

		return empty($this->error);
	}
348488
public function getNbResults($params = array())
    {

        if ( isset( $this->nbResults ) )
        {
            return $this->nbResults;
        }
        $this->nbResults = $this->handler->searchCount( $this->form, $this->criteriaBuilder, $params );
        return $this->nbResults;
    }
70552
final public static function execute(Parameters $params) {

        $asked_method = $params->get('method');

        $method = $params->methods()->get($asked_method);

        if ( is_null($method) ) throw new RpcException("Method not found", -32601);

        return $method->getDescription();

    }
159230
public function execute($params = array(), $requestParams = array()){
      
        $deleteParams = $params;
        if(count($requestParams) > 0) {
            $deleteParams = $requestParams;
        }
        $this->beginTransaction();
        $firstResult = null;
        try{
            //first delete the child tables
            $this->deleteI18nLocales($deleteParams); 
            $this->deleteOneToOneRows($deleteParams);

            //now delete the main tables
            $this->getQueryBuilder()->where($deleteParams);
            $query = $this->getQueryBuilder()->getQuery($this->entity, QueryBuilder::DELETE_QUERY);

            $firstResult = $this->query($query);

            $this->commitTransaction();
        }catch(Exception $e){
            $this->logger->addError($e->getMessage());
            $this->rollbackTransaction();
        }
        return $firstResult;

    }
1320992
public function create(array $params = [])
    {
        return $this->executeRequest(
            RequestMethodEnum::POST,
            ResourceMethodEnum::CREATE,
            $params,
            null
        );
    }
1003521
public function getSubmitParams($params) {

    $submitParams = array();
    foreach ($this->paramFields as $k => $mandatory) {
      if (isset($params[$k]) && strlen($params[$k]) > 0) {
        $submitParams[$k] = $params[$k];
      }
      elseif ((!isset($params[$k]) || strlen($params[$k]) == 0) && $mandatory) {
        throw new \Exception('mandatory field ' . $k . ' is unset or empty');
      }
    }

    return $submitParams;
  }
453350
public function listSmsCampaigns(array $params = null)
    {
        $requestResult = $this->sendRequest('/sms/campaigns/list', 'GET', $params);

        return $this->handleResult($requestResult);
    }
153557
public function create($params, $optParams = [])
    {
        if (!$params instanceof SuperBackup) {
            throw new InvalidParamException(SuperBackup::class.' is required!');
        }
        if(!isset($optParams['cloud'])){
            $optParams['cloud'] = [];
        }
        $optParams['cloud']['id'] = $params->cloud->id;

        return $this->sendRequest([], [
            'restAction' => 'create',
            'uri' => '/c/<cloud.id>',
            'postParams' => $params->toArray(),
            'getParams' => $optParams,
        ], function ($response) {
            return isset($response->data) ? new SuperBackup($response->data) : $response;
        });
    }
516100
public static function create($params = [])
    {
        if (\is_array($params)) {
            return new self($params);
        }

        if ($params instanceof self) {
            return $params;
        }

        throw new InvalidException('Invalid data type');
    }
259416
public function discovery($params) {
		if (is_string($params)) {
			$params = array('email' => $params);
		}
		else {
			$params = $this->_filterParams($params, array('email'), array('email'));
			if ($params === false) {
				throw new InvalidArgumentException("params array contains invalid parameters or misses required parameters");
			}
		}
		return $this->get(null, 'discovery?source_type=imap&email=' . rawurlencode($params['email']));
	}