Code Duplication    Length = 8-11 lines in 5 locations

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 2 locations

@@ 170-180 (lines=11) @@
167
     * @param array $emails
168
     * @return \SevenShores\Hubspot\Http\Response
169
     */
170
    function addContact($list_id, $contact_ids, $emails = [])
171
    {
172
        $endpoint = "https://api.hubapi.com/contacts/v1/lists/{$list_id}/add";
173
174
        $options['json'] = [
175
          'vids' => $contact_ids,
176
          'emails' => $emails,
177
        ];
178
179
        return $this->client->request('post', $endpoint, $options);
180
    }
181
182
    /**
183
     * Remove a contact from a list.
@@ 189-196 (lines=8) @@
186
     * @param array $contact_ids
187
     * @return \SevenShores\Hubspot\Http\Response
188
     */
189
    function removeContact($list_id, $contact_ids)
190
    {
191
        $endpoint = "https://api.hubapi.com/contacts/v1/lists/{$list_id}/remove";
192
193
        $options['json'] = ['vids' => $contact_ids];
194
195
        return $this->client->request('post', $endpoint, $options);
196
    }
197
198
}
199

src/Resources/Engagements.php 1 location

@@ 52-62 (lines=11) @@
49
     * @param array $metadata The engagement metadata to update.
50
     * @return \SevenShores\Hubspot\Http\Response
51
     */
52
    function update($id, $engagement, $metadata)
53
    {
54
        $endpoint = "https://api.hubapi.com/engagements/v1/engagements/{$id}";
55
56
        $options['json'] = [
57
            'engagement' => $engagement,
58
            'metadata' => $metadata,
59
        ];
60
61
        return $this->client->request('put', $endpoint, $options);
62
    }
63
64
    /**
65
     * @param int $id

src/Resources/Files.php 1 location

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