Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Latest commit

 

History

History
148 lines (96 loc) · 3.9 KB

File metadata and controls

148 lines (96 loc) · 3.9 KB

\MappingApi

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

GetMapping

MappingResponse GetMapping(ctx, ledger).Execute()

Get the mapping of a ledger

Example

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
ledger string Name of the ledger.

Other Parameters

Other parameters are passed through a pointer to a apiGetMappingRequest struct via the builder pattern

Name Type Description Notes

Return type

MappingResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json; charset=utf-8

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateMapping

MappingResponse UpdateMapping(ctx, ledger).Mapping(mapping).Execute()

Update the mapping of a ledger

Example

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
ledger string Name of the ledger.

Other Parameters

Other parameters are passed through a pointer to a apiUpdateMappingRequest struct via the builder pattern

Name Type Description Notes

mapping | Mapping | |

Return type

MappingResponse

Authorization

No authorization required

HTTP request headers

  • 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]