/** * @param ClientProductConfigurationProperties[] $config * * @return array|\Guzzle\Http\EntityBodyInterface|string * @throws \Exception */ public function updateMany($config) { try { $formatter = Formatter::create(\MsiClient\Client::Formart_Request); return $this->perform(['data' => $formatter->encode(['client_product_config' => $config])], \MsiClient\Client::PUT_REQUEST, $this->getUrl() . '/update-many'); } catch (\Exception $e) { throw $e; } }
public function setConfig(ProductConfigurationProperties $config) { try { $formatter = Formatter::create(\MsiClient\Client::Formart_Request); return $this->perform(['data' => $formatter->encode(['sci-online' => $config->toArray()])], Client::POST_REQUEST, $this->getUrl() . '/set-config'); } catch (\Exception $e) { throw $e; } }
public function save(BranchProperties $branch) { try { $formatter = Formatter::create(\MsiClient\Client::Formart_Request); $retorno = $this->perform(['data' => $formatter->encode(['branch' => $branch->toArray()])], \MsiClient\Client::POST_REQUEST); return $branch->fromStdClass($retorno->branch); } catch (\Exception $e) { throw $e; } }
/** * @param ClientPlanProperties $planProperties * * @return Properties\ClientPlanProperties * @throws \Exception */ public function save(ClientPlanProperties $planProperties) { try { $formatter = Formatter::create(\MsiClient\Client::Formart_Request); $result = $this->perform(['data' => $formatter->encode(['client_plan' => $planProperties->toArray()])], \MsiClient\Client::POST_REQUEST, $this->getUrl())->data; $plan = new ClientPlanProperties(); return $plan->fromStdClass($result); } catch (\Exception $e) { throw $e; } }
public function save(ClientProperties $client) { try { $formatter = Formatter::create(\MsiClient\Client::Formart_Request); if (!is_null($client->id)) { return $this->perform(['data' => $formatter->encode(['client' => $client->toArray()])], \MsiClient\Client::PUT_REQUEST, $this->getUrl() . '/' . $client->id); } else { return $this->perform(['data' => $formatter->encode(['client' => $client->toArray()])], \MsiClient\Client::POST_REQUEST); } } catch (ServerException $e) { throw $e; } }
public function save(ClientProductProperties $properties) { try { $formatter = Formatter::create(\MsiClient\Client::Formart_Request); if (!is_null($properties->id)) { $result = $this->perform(['data' => $formatter->encode(['client_product' => $properties->toArray()])], \MsiClient\Client::PUT_REQUEST, $this->getUrl() . '/' . $properties->id); } else { $result = $this->perform(['data' => $formatter->encode(['client_product' => $properties->toArray()])], \MsiClient\Client::POST_REQUEST); } $clientProduct = new ClientProductProperties(); return $clientProduct->fromStdClass($result->data); } catch (\Exception $e) { throw $e; } }
private function _parse(ResponseInterface $response) { $contentType = $response->getHeader('Content-Type'); if (is_null($contentType)) { return $response->getBody(); } $formatter = Formatter::create($contentType[0]); if (is_null($formatter)) { return $response->getBody()->getContents(); } return $formatter->decode($response->getBody()); }
public function syncPermissions($userId, $permissions) { $formatter = \MsiClient\Central\Factory\Formatter::create(\MsiClient\Client::Formart_Request); return $this->perform(['data' => $formatter->encode(['permission' => $permissions])], \MsiClient\Client::POST_REQUEST, $this->getUrl() . "/{$userId}/permission/sync"); }
protected function getSendData(PropertiesAbstract $type) { $formatter = Formatter::create(\MsiClient\Client::Formart_Request); return ['data' => $formatter->encode([$type->getContainer() => $type->toArray()])]; }
public function __construct() { $this->formatter = Formatter::create(Client::Mysuite_Request); }
public function save(ClientUserProperties $clientUser) { $formatter = Formatter::create(\MsiClient\Client::Formart_Request); $retorno = $this->perform(['data' => $formatter->encode(['client-user' => $clientUser->toArray()])], \MsiClient\Client::POST_REQUEST); return $retorno; }