client

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

README

Go API client for client

ISO 20022 is an ISO standard for electronic data interchange between financial institutions. It describes a metadata repository containing descriptions of messages and business processes, and a maintenance process for the repository content. The metadata is stored in UML models with a special ISO 20022 UML Profile. The metadata is transformed into the syntax of messages used in financial networks. The first syntax supported for messages was XML Schema. Package ISO20022 implements a message reader and writer written in Go decorated with a HTTP API for creating, parsing, and validating meta data messages. Package ISO20022 supported xml and json format for message

Input Output
JSON JSON
XML XML

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 0.0.1
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
go get github.com/antihax/optional

Put the package under your project folder and add the following in import:

import "./client"

Documentation for API Endpoints

All URIs are relative to https://local.moov.io:8208

Class Method HTTP request Description
Iso20022MessageApi Convert Post /convert Convert iso20022 message
Iso20022MessageApi Health Get /health health iso8583 service
Iso20022MessageApi Print Post /print Print iso20022 message with specific format
Iso20022MessageApi Validator Post /validator Validate iso20022 message

Documentation For Models

Documentation For Authorization

GatewayAuth

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
    UserName: "username",
    Password: "password",
})
r, err := client.Service.Operation(auth, args)

Author

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
	ContextOAuth2 = contextKey("token")

	// ContextBasicAuth takes BasicAuth as authentication for the request.
	ContextBasicAuth = contextKey("basic")

	// ContextAccessToken takes a string oauth2 access token as authentication for the request.
	ContextAccessToken = contextKey("accesstoken")

	// ContextAPIKey takes an APIKey as authentication for the request
	ContextAPIKey = contextKey("apikey")
)

Functions

func CacheExpires

func CacheExpires(r *http.Response) time.Time

CacheExpires helper function to determine remaining time before repeating a request.

Types

type APIClient

type APIClient struct {
	Iso20022MessageApi *Iso20022MessageApiService
	// contains filtered or unexported fields
}

APIClient manages communication with the ISO20022 API API v0.0.1 In most cases there should be only one, shared, APIClient.

func NewAPIClient

func NewAPIClient(cfg *Configuration) *APIClient

NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.

func (*APIClient) ChangeBasePath

func (c *APIClient) ChangeBasePath(path string)

ChangeBasePath changes base path to allow switching to mocks

func (*APIClient) GetConfig

func (c *APIClient) GetConfig() *Configuration

Allow modification of underlying config for alternate implementations and testing Caution: modifying the configuration while live can cause data races and potentially unwanted behavior

type APIKey

type APIKey struct {
	Key    string
	Prefix string
}

APIKey provides API key based authentication to a request passed via context using ContextAPIKey

type APIResponse

type APIResponse struct {
	*http.Response `json:"-"`
	Message        string `json:"message,omitempty"`
	// Operation is the name of the OpenAPI operation.
	Operation string `json:"operation,omitempty"`
	// RequestURL is the request URL. This value is always available, even if the
	// embedded *http.Response is nil.
	RequestURL string `json:"url,omitempty"`
	// Method is the HTTP method used for the request.  This value is always
	// available, even if the embedded *http.Response is nil.
	Method string `json:"method,omitempty"`
	// Payload holds the contents of the response body (which may be nil or empty).
	// This is provided here as the raw response.Body() reader will have already
	// been drained.
	Payload []byte `json:"-"`
}

APIResponse stores the API response returned by the server.

func NewAPIResponse

func NewAPIResponse(r *http.Response) *APIResponse

NewAPIResponse returns a new APIResonse object.

func NewAPIResponseWithError

func NewAPIResponseWithError(errorMessage string) *APIResponse

NewAPIResponseWithError returns a new APIResponse object with the provided error message.

type BasicAuth

type BasicAuth struct {
	UserName string `json:"userName,omitempty"`
	Password string `json:"password,omitempty"`
}

BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth

type Configuration

type Configuration struct {
	BasePath      string            `json:"basePath,omitempty"`
	Host          string            `json:"host,omitempty"`
	Scheme        string            `json:"scheme,omitempty"`
	DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
	UserAgent     string            `json:"userAgent,omitempty"`
	Debug         bool              `json:"debug,omitempty"`
	Servers       []ServerConfiguration
	HTTPClient    *http.Client
}

Configuration stores the configuration of the API client

func NewConfiguration

func NewConfiguration() *Configuration

NewConfiguration returns a new Configuration object

func (*Configuration) AddDefaultHeader

func (c *Configuration) AddDefaultHeader(key string, value string)

AddDefaultHeader adds a new HTTP header to the default header in the request

func (*Configuration) ServerUrl

func (c *Configuration) ServerUrl(index int, variables map[string]string) (string, error)

ServerUrl returns URL based on server settings

type ConvertOpts

type ConvertOpts struct {
	Format optional.String
	Input  optional.Interface
}

ConvertOpts Optional parameters for the method 'Convert'

type Error

type Error struct {
	Error string `json:"error,omitempty"`
}

Error struct for Error

type GenericOpenAPIError

type GenericOpenAPIError struct {
	// contains filtered or unexported fields
}

GenericOpenAPIError Provides access to the body, error and model on returned errors.

func (GenericOpenAPIError) Body

func (e GenericOpenAPIError) Body() []byte

Body returns the raw bytes of the response

func (GenericOpenAPIError) Error

func (e GenericOpenAPIError) Error() string

Error returns non-empty string if there was an error.

func (GenericOpenAPIError) Model

func (e GenericOpenAPIError) Model() interface{}

Model returns the unpacked model of the error

type Iso20022Document

type Iso20022Document struct {
	Xmlns         string                 `json:"Xmlns"`
	RequestObject map[string]interface{} `json:"RequestObject"`
}

Iso20022Document https://www.iso20022.org/iso-20022-message-definitions?business-domain=1

type Iso20022MessageApiService

type Iso20022MessageApiService service

Iso20022MessageApiService Iso20022MessageApi service

func (*Iso20022MessageApiService) Convert

func (a *Iso20022MessageApiService) Convert(ctx _context.Context, localVarOptionals *ConvertOpts) (*os.File, *_nethttp.Response, error)

Convert Convert iso20022 message Convert from original iso20022 message to new iso20022 message

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param optional nil or *ConvertOpts - Optional Parameters:
  • @param "Format" (optional.String) - converting message type
  • @param "Input" (optional.Interface of *os.File) - iso20022 message file

@return *os.File

func (*Iso20022MessageApiService) Health

Health health iso8583 service Check the iso8583 service to check if running

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return Success

func (*Iso20022MessageApiService) Print

func (a *Iso20022MessageApiService) Print(ctx _context.Context, localVarOptionals *PrintOpts) (string, *_nethttp.Response, error)

Print Print iso20022 message with specific format Print iso20022 message with requested format.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param optional nil or *PrintOpts - Optional Parameters:
  • @param "Format" (optional.String) - print iso20022 type
  • @param "Input" (optional.Interface of *os.File) - iso20022 message file

@return string

func (*Iso20022MessageApiService) Validator

func (a *Iso20022MessageApiService) Validator(ctx _context.Context, localVarOptionals *ValidatorOpts) (Success, *_nethttp.Response, error)

Validator Validate iso20022 message Validation iso20022 message.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param optional nil or *ValidatorOpts - Optional Parameters:
  • @param "Input" (optional.Interface of *os.File) - iso8583 message file

@return Success

type PrintOpts

type PrintOpts struct {
	Format optional.String
	Input  optional.Interface
}

PrintOpts Optional parameters for the method 'Print'

type ServerConfiguration

type ServerConfiguration struct {
	Url         string
	Description string
	Variables   map[string]ServerVariable
}

ServerConfiguration stores the information about a server

type ServerVariable

type ServerVariable struct {
	Description  string
	DefaultValue string
	EnumValues   []string
}

ServerVariable stores the information about a server variable

type Success

type Success struct {
	Status string `json:"status,omitempty"`
}

Success struct for Success

type ValidatorOpts

type ValidatorOpts struct {
	Input optional.Interface
}

ValidatorOpts Optional parameters for the method 'Validator'

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL