SevenShores\Hubspot\Resources\Timeline::updateEventTypeProperty PHP Method

updateEventTypeProperty() public method

Update Property for Timeline Event Type
See also: http://developers.hubspot.com/docs/methods/timeline/udpate-timeline-event-type-property
public updateEventTypeProperty ( integer $appId, integer $eventTypeId, integer $eventTypePropertyId, string $name, string $label, string $propertyType, array | null $options = null ) : mixed
$appId integer
$eventTypeId integer
$eventTypePropertyId integer
$name string
$label string
$propertyType string
$options array | null
return mixed
    public function updateEventTypeProperty($appId, $eventTypeId, $eventTypePropertyId, $name, $label, $propertyType, $options = null)
    {
        $endpoint = "https://api.hubapi.com/integrations/v1/{$appId}/timeline/event-types/{$eventTypeId}/properties";
        $data['json'] = ['id' => $eventTypePropertyId, 'name' => $name, 'label' => $label, 'propertyType' => $propertyType];
        if (isset($options)) {
            $data['json']['options'] = $options;
        }
        return $this->client->request('put', $endpoint, $data);
    }

Usage Example

Example #1
0
 /**
  * @test
  */
 public function updateEventTypeProperty()
 {
     $response = $this->createEventTypeProperty();
     $eventTypeProperty = json_decode((string) $response->getBody());
     $label = 'New Property Label';
     $propertyType = 'String';
     $response = $this->timeline->updateEventTypeProperty(self::APP_ID, $this->eventTypeId, $eventTypeProperty->id, $eventTypeProperty->name, $label, $propertyType);
     $eventTypeProperty = json_decode((string) $response->getBody());
     $this->assertEquals($label, $eventTypeProperty->label);
     $this->assertEquals($propertyType, $eventTypeProperty->propertyType);
     $this->assertEquals(200, $response->getStatusCode());
     return $response;
 }