Skip to content

Commit 7d78cd8

Browse files
marko-kriskovicmatijapetanjek
authored andcommitted
1278 - added getContacts
1 parent 621a3c6 commit 7d78cd8

5 files changed

Lines changed: 1069 additions & 7 deletions

File tree

server/libs/modules/components/hubspot/openapi.yaml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,27 @@ paths:
5353
application/json:
5454
schema:
5555
$ref: "#/components/schemas/Contact"
56+
get:
57+
summary: "Get Contacts"
58+
description: "Get all contacts."
59+
operationId: "getContacts"
60+
x-ai-agent-tool: true
61+
security:
62+
- "oauth2":
63+
- "crm.objects.contacts.read"
64+
responses:
65+
200:
66+
description: "successful operation"
67+
content:
68+
application/json:
69+
schema:
70+
type: "object"
71+
properties:
72+
results:
73+
type: "array"
74+
items:
75+
$ref: "#/components/schemas/Contact"
76+
/crm/v3/objects/contacts/{contactId}:
5677
get:
5778
summary: "Get Contact"
5879
description: "Get contact details."
@@ -76,7 +97,6 @@ paths:
7697
application/json:
7798
schema:
7899
$ref: "#/components/schemas/Contact"
79-
/crm/v3/objects/contacts/{contactId}:
80100
delete:
81101
summary: "Delete Contact"
82102
description: "Move Contact to the recycling bin."

server/libs/modules/components/hubspot/src/main/java/com/bytechef/component/hubspot/AbstractHubspotComponentHandler.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import com.bytechef.component.hubspot.action.HubspotCreateDealAction;
2626
import com.bytechef.component.hubspot.action.HubspotDeleteContactAction;
2727
import com.bytechef.component.hubspot.action.HubspotGetContactAction;
28+
import com.bytechef.component.hubspot.action.HubspotGetContactsAction;
2829
import com.bytechef.component.hubspot.action.HubspotGetTicketAction;
2930
import com.bytechef.component.hubspot.action.HubspotUpdateContactAction;
3031
import com.bytechef.component.hubspot.connection.HubspotConnection;
@@ -43,13 +44,13 @@ public abstract class AbstractHubspotComponentHandler implements OpenApiComponen
4344
.version(1))
4445
.actions(modifyActions(HubspotCreateContactAction.ACTION_DEFINITION,
4546
HubspotCreateDealAction.ACTION_DEFINITION, HubspotDeleteContactAction.ACTION_DEFINITION,
46-
HubspotGetContactAction.ACTION_DEFINITION, HubspotGetTicketAction.ACTION_DEFINITION,
47-
HubspotUpdateContactAction.ACTION_DEFINITION))
47+
HubspotGetContactAction.ACTION_DEFINITION, HubspotGetContactsAction.ACTION_DEFINITION,
48+
HubspotGetTicketAction.ACTION_DEFINITION, HubspotUpdateContactAction.ACTION_DEFINITION))
4849
.connection(modifyConnection(HubspotConnection.CONNECTION_DEFINITION))
4950
.clusterElements(modifyClusterElements(tool(HubspotCreateContactAction.ACTION_DEFINITION),
5051
tool(HubspotCreateDealAction.ACTION_DEFINITION), tool(HubspotDeleteContactAction.ACTION_DEFINITION),
51-
tool(HubspotGetContactAction.ACTION_DEFINITION), tool(HubspotGetTicketAction.ACTION_DEFINITION),
52-
tool(HubspotUpdateContactAction.ACTION_DEFINITION)))
52+
tool(HubspotGetContactAction.ACTION_DEFINITION), tool(HubspotGetContactsAction.ACTION_DEFINITION),
53+
tool(HubspotGetTicketAction.ACTION_DEFINITION), tool(HubspotUpdateContactAction.ACTION_DEFINITION)))
5354
.triggers(getTriggers());
5455

5556
@Override

server/libs/modules/components/hubspot/src/main/java/com/bytechef/component/hubspot/action/HubspotGetContactAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class HubspotGetContactAction {
4141
.metadata(
4242
Map.of(
4343
"method", "GET",
44-
"path", "/crm/v3/objects/contacts"
44+
"path", "/crm/v3/objects/contacts/{contactId}"
4545

4646
))
4747
.properties(string("contactId").label("Contact ID")
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* Copyright 2025 ByteChef
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.bytechef.component.hubspot.action;
18+
19+
import static com.bytechef.component.definition.ComponentDsl.action;
20+
import static com.bytechef.component.definition.ComponentDsl.array;
21+
import static com.bytechef.component.definition.ComponentDsl.object;
22+
import static com.bytechef.component.definition.ComponentDsl.outputSchema;
23+
import static com.bytechef.component.definition.Context.Http.ResponseType;
24+
25+
import com.bytechef.component.definition.ComponentDsl;
26+
import com.bytechef.component.hubspot.property.HubspotContactProperties;
27+
import java.util.Map;
28+
29+
/**
30+
* Provides a list of the component actions.
31+
*
32+
* @generated
33+
*/
34+
public class HubspotGetContactsAction {
35+
public static final ComponentDsl.ModifiableActionDefinition ACTION_DEFINITION = action("getContacts")
36+
.title("Get Contacts")
37+
.description("Get all contacts.")
38+
.metadata(
39+
Map.of(
40+
"method", "GET",
41+
"path", "/crm/v3/objects/contacts"
42+
43+
))
44+
.properties()
45+
.output(outputSchema(object()
46+
.properties(array("results").items(object().properties(HubspotContactProperties.PROPERTIES))
47+
.required(false))
48+
.metadata(
49+
Map.of(
50+
"responseType", ResponseType.JSON))));
51+
52+
private HubspotGetContactsAction() {
53+
}
54+
}

0 commit comments

Comments
 (0)