(FieldMappings)
- GetFieldMappingValues - Retrieve field mappings values
- GetFieldMappingsEntities - Retrieve field mapping entities
- GetFieldMappings - Retrieve field mappings
- Definitions - Define target Field
- DefineCustomField - Create Custom Field
- Map - Map Custom Field
Retrieve field mappings values
package main
import(
gosdk "github.com/panoratech/go-sdk"
"context"
"log"
)
func main() {
s := gosdk.New(
gosdk.WithSecurity("<YOUR_API_KEY_HERE>"),
)
ctx := context.Background()
res, err := s.FieldMappings.GetFieldMappingValues(ctx)
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetFieldMappingValuesResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4XX, 5XX | */* |
Retrieve field mapping entities
package main
import(
gosdk "github.com/panoratech/go-sdk"
"context"
"log"
)
func main() {
s := gosdk.New(
gosdk.WithSecurity("<YOUR_API_KEY_HERE>"),
)
ctx := context.Background()
res, err := s.FieldMappings.GetFieldMappingsEntities(ctx)
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetFieldMappingsEntitiesResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4XX, 5XX | */* |
Retrieve field mappings
package main
import(
gosdk "github.com/panoratech/go-sdk"
"context"
"log"
)
func main() {
s := gosdk.New(
gosdk.WithSecurity("<YOUR_API_KEY_HERE>"),
)
ctx := context.Background()
res, err := s.FieldMappings.GetFieldMappings(ctx)
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetFieldMappingsResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4XX, 5XX | */* |
Define target Field
package main
import(
gosdk "github.com/panoratech/go-sdk"
"context"
"github.com/panoratech/go-sdk/models/components"
"log"
)
func main() {
s := gosdk.New(
gosdk.WithSecurity("<YOUR_API_KEY_HERE>"),
)
ctx := context.Background()
res, err := s.FieldMappings.Definitions(ctx, components.DefineTargetFieldDto{
ObjectTypeOwner: components.ObjectTypeOwnerCompany.ToPointer(),
Name: gosdk.String("fav_dish"),
Description: gosdk.String("My favorite dish"),
DataType: components.DataTypeString.ToPointer(),
})
if err != nil {
log.Fatal(err)
}
if res.CustomFieldResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
components.DefineTargetFieldDto | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.DefinitionsResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4XX, 5XX | */* |
Create Custom Field
package main
import(
gosdk "github.com/panoratech/go-sdk"
"context"
"github.com/panoratech/go-sdk/models/components"
"log"
)
func main() {
s := gosdk.New(
gosdk.WithSecurity("<YOUR_API_KEY_HERE>"),
)
ctx := context.Background()
res, err := s.FieldMappings.DefineCustomField(ctx, components.CustomFieldCreateDto{
ObjectTypeOwner: components.CustomFieldCreateDtoObjectTypeOwnerCompany.ToPointer(),
Name: gosdk.String("my_favorite_dish"),
Description: gosdk.String("Favorite Dish"),
DataType: components.CustomFieldCreateDtoDataTypeString.ToPointer(),
SourceCustomFieldID: gosdk.String("id_1"),
SourceProvider: gosdk.String("hubspot"),
LinkedUserID: gosdk.String("801f9ede-c698-4e66-a7fc-48d19eebaa4f"),
})
if err != nil {
log.Fatal(err)
}
if res.CustomFieldResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
components.CustomFieldCreateDto | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.DefineCustomFieldResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4XX, 5XX | */* |
Map Custom Field
package main
import(
gosdk "github.com/panoratech/go-sdk"
"context"
"github.com/panoratech/go-sdk/models/components"
"log"
)
func main() {
s := gosdk.New(
gosdk.WithSecurity("<YOUR_API_KEY_HERE>"),
)
ctx := context.Background()
res, err := s.FieldMappings.Map(ctx, components.MapFieldToProviderDto{
AttributeID: gosdk.String("801f9ede-c698-4e66-a7fc-48d19eebaa4f"),
SourceCustomFieldID: gosdk.String("id_1"),
SourceProvider: gosdk.String("hubspot"),
LinkedUserID: gosdk.String("801f9ede-c698-4e66-a7fc-48d19eebaa4f"),
})
if err != nil {
log.Fatal(err)
}
if res.CustomFieldResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
components.MapFieldToProviderDto | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.MapResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4XX, 5XX | */* |