28 lines
718 B
Go
28 lines
718 B
Go
package example
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
|
|
"github.com/go-openapi/runtime/client"
|
|
"src.dualinventive.com/go/companies-service/rest/client/companies"
|
|
|
|
apiclient "src.dualinventive.com/go/companies-service/rest/client"
|
|
)
|
|
|
|
func Example_rest() {
|
|
params := companies.NewGetCompanyByIDParams()
|
|
params.CompanyID = 1 // Change CompanyID to be requested here
|
|
|
|
authinfo := client.APIKeyAuth("Authorization", "header", "[token]")
|
|
|
|
resp, err := apiclient.Default.Companies.GetCompanyByID(params, authinfo)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
fmt.Printf("%#v\n", resp.Payload)
|
|
|
|
// Prefix the line below with 'Output: ' to actually run the test and check the output
|
|
// &models.Company{Code:"system", ID:1, Name:"SYSTEM"}
|
|
}
|