Code Duplication    Length = 8-11 lines in 8 locations

src/Resources/BlogPosts.php 1 location

@@ 149-156 (lines=8) @@
146
     * @param  string $action The publish action
147
     * @return \SevenShores\Hubspot\Http\Response
148
     */
149
    function publishAction($id, $action)
150
    {
151
        $endpoint = "https://api.hubapi.com/content/api/v2/blog-posts/{$id}/publish-action";
152
153
        $options['json'] = ['action' => $action];
154
155
        return $this->client->request('post', $endpoint, $options);
156
    }
157
158
    /**
159
     * Copies the contents of the auto-save buffer into the live blog post.

src/Resources/BlogTopics.php 1 location

@@ 62-71 (lines=10) @@
59
     * @param  array $params Optional Parameters.
60
     * @return \SevenShores\Hubspot\Http\Response
61
     */
62
    function create($name, $params = [])
63
    {
64
        $endpoint = 'https://api.hubapi.com/blogs/v3/topics';
65
66
        $params['name'] = $name;
67
68
        $options['json'] = $params;
69
70
        return $this->client->request('post', $endpoint, $options);
71
    }
72
73
    /**
74
     * Update a blog topic.

src/Resources/ContactLists.php 1 location

@@ 29-36 (lines=8) @@
26
     * @param array $list The contact list properties to update.
27
     * @return \SevenShores\Hubspot\Http\Response
28
     */
29
    function update($id, $list)
30
    {
31
        $endpoint = "https://api.hubapi.com/contacts/v1/lists/{$id}";
32
33
        $options['json'] = $list;
34
35
        return $this->client->request('post', $endpoint, $options);
36
    }
37
38
    /**
39
     * Delete a contact list.

src/Resources/Deals.php 1 location

@@ 27-34 (lines=8) @@
24
     * @param array $deal The deal properties to update.
25
     * @return mixed
26
     */
27
    function update($id, array $deal)
28
    {
29
        $endpoint = "https://api.hubapi.com/deals/v1/deal/{$id}";
30
31
        $options['json'] = $deal;
32
33
        return $this->client->request('put', $endpoint, $options);
34
    }
35
36
    /**
37
     * @param int $id

src/Resources/Files.php 1 location

@@ 140-150 (lines=11) @@
137
     * @param int    $parent_folder_id
138
     * @return \SevenShores\Hubspot\Http\Response
139
     */
140
    function createFolder($folder_name, $parent_folder_id)
141
    {
142
        $endpoint = "https://api.hubapi.com/filemanager/api/v2/folders";
143
144
        $options['json'] = [
145
            'folder_name'      => $folder_name,
146
            'parent_folder_id' => $parent_folder_id,
147
        ];
148
149
        return $this->client->request('post', $endpoint, $options);
150
    }
151
152
    /**
153
     * List folders metadata.

src/Resources/ContactProperties.php 1 location

@@ 72-80 (lines=9) @@
69
     * @param array  $property
70
     * @return \SevenShores\Hubspot\Http\Response
71
     */
72
    function update($name, $property)
73
    {
74
        $endpoint = "https://api.hubapi.com/contacts/v2/properties/named/{$name}";
75
76
        $property['name'] = $name;
77
        $options['json'] = $property;
78
79
        return $this->client->request('put', $endpoint, $options);
80
    }
81
82
    /**
83
     * Delete a contact property.

src/Resources/DealProperties.php 1 location

@@ 36-44 (lines=9) @@
33
     * @param array  $property
34
     * @return \SevenShores\Hubspot\Http\Response
35
     */
36
    function update($name, $property)
37
    {
38
        $endpoint = "https://api.hubapi.com/deals/v1/properties/named/{$name}";
39
40
        $property['name'] = $name;
41
        $options['json'] = $property;
42
43
        return $this->client->request('put', $endpoint, $options);
44
    }
45
46
}
47

src/Resources/Engagements.php 1 location

@@ 34-44 (lines=11) @@
31
     * @param array $metadata The engagement metadata to update.
32
     * @return \SevenShores\Hubspot\Http\Response
33
     */
34
    function update($id, $engagement, $metadata)
35
    {
36
        $endpoint = "https://api.hubapi.com/engagements/v1/engagements/{$id}";
37
38
        $options['json'] = [
39
            'engagement' => $engagement,
40
            'metadata' => $metadata,
41
        ];
42
43
        return $this->client->request('put', $endpoint, $options);
44
    }
45
46
    /**
47
     * @param int $id