All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| GetMapping | Get /{ledger}/mapping | Get the mapping of a ledger |
| UpdateMapping | Put /{ledger}/mapping | Update the mapping of a ledger |
MappingResponse GetMapping(ctx, ledger).Execute()
Get the mapping of a ledger
package main
import (
"context"
"fmt"
"os"
client "github.com/formancehq/numary-sdk-go"
)
func main() {
ledger := "ledger001" // string | Name of the ledger.
configuration := client.NewConfiguration()
apiClient := client.NewAPIClient(configuration)
resp, r, err := apiClient.MappingApi.GetMapping(context.Background(), ledger).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MappingApi.GetMapping``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetMapping`: MappingResponse
fmt.Fprintf(os.Stdout, "Response from `MappingApi.GetMapping`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| ledger | string | Name of the ledger. |
Other parameters are passed through a pointer to a apiGetMappingRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
No authorization required
- Content-Type: Not defined
- Accept: application/json; charset=utf-8
[Back to top] [Back to API list] [Back to Model list] [Back to README]
MappingResponse UpdateMapping(ctx, ledger).Mapping(mapping).Execute()
Update the mapping of a ledger
package main
import (
"context"
"fmt"
"os"
client "github.com/formancehq/numary-sdk-go"
)
func main() {
ledger := "ledger001" // string | Name of the ledger.
mapping := *client.NewMapping([]client.Contract{*client.NewContract(map[string]interface{}(123))}) // Mapping |
configuration := client.NewConfiguration()
apiClient := client.NewAPIClient(configuration)
resp, r, err := apiClient.MappingApi.UpdateMapping(context.Background(), ledger).Mapping(mapping).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MappingApi.UpdateMapping``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateMapping`: MappingResponse
fmt.Fprintf(os.Stdout, "Response from `MappingApi.UpdateMapping`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| ledger | string | Name of the ledger. |
Other parameters are passed through a pointer to a apiUpdateMappingRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
mapping | Mapping | |
No authorization required
- Content-Type: application/json; charset=utf-8
- Accept: application/json; charset=utf-8
[Back to top] [Back to API list] [Back to Model list] [Back to README]