package main
import(
"context"
pearset "github.com/pearset/pearset-go"
"github.com/pearset/pearset-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := pearset.New(
pearset.WithSecurity("DUB_API_KEY"),
)
res, err := s.EmbedTokens.Referrals(ctx, &operations.CreateReferralsEmbedTokenRequestBody{
Partner: &operations.Partner{
Email: "Letha_Wuckert2@yahoo.com",
LinkProps: &operations.CreateReferralsEmbedTokenLinkProps{
ExternalID: pearset.Pointer("123456"),
TagIds: pearset.Pointer(operations.CreateCreateReferralsEmbedTokenTagIdsArrayOfStr(
[]string{
"clux0rgak00011...",
},
)),
TestVariants: []operations.CreateReferralsEmbedTokenTestVariants{
operations.CreateReferralsEmbedTokenTestVariants{
URL: "https://example.com/variant-1",
Percentage: 50.0,
},
operations.CreateReferralsEmbedTokenTestVariants{
URL: "https://example.com/variant-2",
Percentage: 50.0,
},
},
},
},
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}