Skip to content

onliseguros/onli-sdk-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

onli-sdk-go

GitHubAction Status


Onli Seguros API Client enabling Go programs to interact with our services in a simple and uniform way.

Coverage

This API client package covers most of the existing Onli Seguros API calls and is updated regularly to add new and/or missing endpoints. Currently the following services are supported:

Brokers

  • Merchant
  • Channel
  • Product
  • Lead
  • Quote
  • Sale
  • Charge

Customers

  • Recommendation

Insurers

  • Effect
  • Proposal
  • Claim
  • Policy

Usage

import "github.com/onliseguros/onli-sdk-go/onli"

Initialize a new Onli Seguros client using default environment variables, then use the various services to access different parts of the API:

client, err := onli.NewClient()
if err != nil {
    panic(err)
}

You can also construct a client using options:

client, err := onli.NewClient(
    onli.Config().WithAudience("yourAudience"),
    onli.Config().WithClientID("clientId"),
    onli.Config().WithClientSecret("clientSecret"),
    onli.Config().WithEnv(onli.EnvStaging),
    onli.Config().WithScopes([]string{"scope1","scope2"}),
)

Here is an example of how to use services with the above created client:

import "github.com/onliseguros/onli-sdk-go/service/merchant"
svc := merchant.New(client)

resp, err := svc.GetStore(ctx, "yourBrokerChannelId")
if err != nil {
    panic(err)
}

Issues

If you have an issue: report it on the issue tracker

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

About

Client SDK for Onli Seguros services made in Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages