Skip to content

Latest commit

 

History

History
325 lines (244 loc) · 14.1 KB

README.md

File metadata and controls

325 lines (244 loc) · 14.1 KB

FieldMappings

(FieldMappings)

Overview

Available Operations

GetFieldMappingValues

Retrieve field mappings values

Example Usage

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
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
opts []operations.Option The options for this request.

Response

*operations.GetFieldMappingValuesResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.SDKError 4XX, 5XX */*

GetFieldMappingsEntities

Retrieve field mapping entities

Example Usage

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
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
opts []operations.Option The options for this request.

Response

*operations.GetFieldMappingsEntitiesResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.SDKError 4XX, 5XX */*

GetFieldMappings

Retrieve field mappings

Example Usage

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
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
opts []operations.Option The options for this request.

Response

*operations.GetFieldMappingsResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.SDKError 4XX, 5XX */*

Definitions

Define target Field

Example Usage

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
    }
}

Parameters

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.

Response

*operations.DefinitionsResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.SDKError 4XX, 5XX */*

DefineCustomField

Create Custom Field

Example Usage

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
    }
}

Parameters

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.

Response

*operations.DefineCustomFieldResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.SDKError 4XX, 5XX */*

Map

Map Custom Field

Example Usage

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
    }
}

Parameters

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.

Response

*operations.MapResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.SDKError 4XX, 5XX */*