Ejemplo n.º 1
0
 public function update($calendarId, $params = [], $headers = [])
 {
     $params = ParamsBuilder::merge(["calendar_id" => $calendarId], $params);
     $method = new ApiMethod("put", "/calendars/:calendar_id", $params, $headers, $this->parent);
     $json = $this->client->execute($method);
     return new Calendar($json, $method, $this->client);
 }
 public function update($siteEnvironmentId, $params = [], $headers = [])
 {
     $params = ParamsBuilder::merge(["site_environment_id" => $siteEnvironmentId], $params);
     $method = new ApiMethod("put", "/site_environments/:site_environment_id", $params, $headers, $this->parent);
     $json = $this->client->execute($method);
     return new SiteEnvironment($json, $method, $this->client);
 }
Ejemplo n.º 3
0
 public function resetPassword($email, $params = [], $headers = [])
 {
     $params = ParamsBuilder::merge(["email" => $email], $params);
     $method = new ApiMethod("post", "/users/reset_password", $params, $headers, $this->parent);
     $json = $this->client->execute($method);
     return $json;
 }
 public function update($integrationId, $params = [], $headers = [])
 {
     $params = ParamsBuilder::merge(["integration_id" => $integrationId], $params);
     $method = new ApiMethod("put", "/integrations/:integration_id", $params, $headers, $this->parent);
     $json = $this->client->execute($method);
     return new Integration($json, $method, $this->client);
 }
Ejemplo n.º 5
0
 public function delete($vacancyId, $params = [], $headers = [])
 {
     $params = ParamsBuilder::merge(["vacancy_id" => $vacancyId], $params);
     $method = new ApiMethod("delete", "/vacancies/:vacancy_id", $params, $headers, $this->parent);
     $json = $this->client->execute($method);
     return new Vacancy($json, $method, $this->client);
 }
 public function update($scheduleId, $params = [], $headers = [])
 {
     $params = ParamsBuilder::merge(["schedule_id" => $scheduleId], $params);
     $method = new ApiMethod("put", "/schedules/:schedule_id", $params, $headers, $this->parent);
     $json = $this->client->execute($method);
     return new Schedule($json, $method, $this->client);
 }
 public function __construct()
 {
     // Setup
     $this->params = ["dog" => "dog-value", "string" => "str-value"];
     $this->toMerge = ["cat" => "cat-value", "string" => "str-override"];
     $this->builtParams = ParamsBuilder::merge($this->params, $this->toMerge);
 }
Ejemplo n.º 8
0
 public function history($testId, $params = [], $headers = [])
 {
     $params = ParamsBuilder::merge(["test_id" => $testId], $params);
     $method = new ApiMethod("get", "/tests/:test_id/history", $params, $headers, $this->parent);
     $json = $this->client->execute($method);
     return new ApiList("Run", $json, $method, $this->client);
 }
 public function retrieve($testId, $params = [], $headers = [])
 {
     $params = ParamsBuilder::merge(["test_id" => $testId], $params);
     $method = new ApiMethod("get", "/runs/:id/tests/:test_id", $params, $headers, $this->parent);
     $json = $this->client->execute($method);
     return new Test($json, $method, $this->client);
 }
 public function update($generatorId, $params = [], $headers = [])
 {
     $params = ParamsBuilder::merge(["generator_id" => $generatorId], $params);
     $method = new ApiMethod("put", "/generators/:generator_id", $params, $headers, $this->parent);
     $json = $this->client->execute($method);
     return new Generator($json, $method, $this->client);
 }
Ejemplo n.º 11
0
 public function update($bookingId, $params = [], $headers = [])
 {
     $params = ParamsBuilder::merge(["booking_id" => $bookingId], $params);
     $method = new ApiMethod("put", "/bookings/:booking_id", $params, $headers, $this->parent);
     $json = $this->client->execute($method);
     return new Booking($json, $method, $this->client);
 }
Ejemplo n.º 12
0
 public function abort($runId, $params = [], $headers = [])
 {
     $params = ParamsBuilder::merge(["run_id" => $runId], $params);
     $method = new ApiMethod("delete", "/runs/:run_id", $params, $headers, $this->parent);
     $json = $this->client->execute($method);
     return new Run($json, $method, $this->client);
 }
Ejemplo n.º 13
0
 public function __construct($method, $path, $params, $headers, $object)
 {
     $this->apiBase = $this->apiBase ? $this->apiBase : Alman::getApiBase();
     $this->method = $method;
     $this->path = PathBuilder::build($path, $object, $params);
     $this->params = ParamsBuilder::build($params);
     $this->headers = HeadersBuilder::build($headers);
 }
Ejemplo n.º 14
0
 public function testShouldUseParamsBuilder()
 {
     // Setup
     $method = "get";
     $path = "/testing";
     $params = ["param_a" => "1"];
     $headers = ["header_a" => "a"];
     $object = new \stdClass();
     $apiMethod = new ApiMethod($method, $path, $params, $headers, $object);
     // Assert Equals
     $this->assertSame(ParamsBuilder::build($params), $apiMethod->params);
 }
Ejemplo n.º 15
0
 public function execute($apiMethod)
 {
     $apiMethod->headers = ParamsBuilder::merge($apiMethod->headers, $this->headers);
     $apiMethod->params = ParamsBuilder::merge($apiMethod->params, $this->params);
     return $apiMethod->execute();
 }
Ejemplo n.º 16
0
 public function save($params = [], $headers = [])
 {
     $params = ParamsBuilder::merge($this->apiAttributes(), $params);
     $res = $this->client->generators->update($this->id, $params, $headers);
     $this->refreshFrom($res->json, $res->apiMethod, $res->client);
 }