Skip to content

Commit

Permalink
Merge pull request #51 from moov-io/New-routes
Browse files Browse the repository at this point in the history
New routes
  • Loading branch information
bkmoovio authored Jun 28, 2019
2 parents cb227a7 + f994908 commit d42ad77
Show file tree
Hide file tree
Showing 74 changed files with 1,133 additions and 1,913 deletions.
2 changes: 1 addition & 1 deletion client/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.2
4.0.2-SNAPSHOT
3 changes: 1 addition & 2 deletions client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ All URIs are relative to *http://localhost:8087*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*FEDWireMessageFileApi* | [**AddFEDWireMessageToFile**](docs/FEDWireMessageFileApi.md#addfedwiremessagetofile) | **Post** /files/{file_id}/FEDWireMessage | Add FEDWireMessage to File
*WireFilesApi* | [**CreateWireFile**](docs/WireFilesApi.md#createwirefile) | **Post** /files/create | Create a new File object
*WireFilesApi* | [**DeleteFEDWireMessageFromFile**](docs/WireFilesApi.md#deletefedwiremessagefromfile) | **Delete** /files/{file_id}/FEDWireMessage/{FEDWireMessage_id} | Delete a FEDWireMessage from a File
*WireFilesApi* | [**DeleteWireFileByID**](docs/WireFilesApi.md#deletewirefilebyid) | **Delete** /files/{file_id} | Permanently deletes a File and associated FEDWireMessage. It cannot be undone.
*WireFilesApi* | [**GetFEDWireMessageFromFile**](docs/WireFilesApi.md#getfedwiremessagefromfile) | **Get** /files/{file_id}/FEDWireMessage/{FEDWireMessage_id} | Get a specific FEDWireMessage on a FIle
*WireFilesApi* | [**GetWireFileByID**](docs/WireFilesApi.md#getwirefilebyid) | **Get** /files/{file_id} | Retrieves the details of an existing File. You need only supply the unique File identifier that was returned upon creation.
*WireFilesApi* | [**GetWireFileContents**](docs/WireFilesApi.md#getwirefilecontents) | **Get** /files/{file_id}/contents | Assembles the existing file witha FEDWireMessage, Returns plaintext file.
*WireFilesApi* | [**GetWireFiles**](docs/WireFilesApi.md#getwirefiles) | **Get** /files | Gets a list of Files
Expand Down
72 changes: 16 additions & 56 deletions client/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,9 @@ paths:
that was returned upon creation.
tags:
- Wire Files
/files/{file_id}/FEDWireMessage/{FEDWireMessage_id}:
delete:
operationId: deleteFEDWireMessageFromFile
/files/{file_id}/FEDWireMessage:
post:
operationId: addFEDWireMessageToFile
parameters:
- description: Optional Request ID allows application developer to trace requests
through the systems logs
Expand All @@ -353,44 +353,13 @@ paths:
schema:
type: string
style: simple
- description: File ID
explode: false
in: path
name: file_id
required: true
schema:
example: 3f2d23ee214
type: string
style: simple
- description: FEDWireMessage ID
explode: false
in: path
name: FEDWireMessage_id
required: true
schema:
example: "45758063"
type: string
style: simple
responses:
200:
description: FEDWireMessage deleted
404:
description: FEDWireMessage or File not found
security:
- bearerAuth: []
- cookieAuth: []
summary: Delete a FEDWireMessage from a File
tags:
- Wire Files
get:
operationId: getFEDWireMessageFromFile
parameters:
- description: Optional Request ID allows application developer to trace requests
through the systems logs
example: rs4f9915
- description: Idempotent key in the header which expires after 24 hours. These
strings should contain enough entropy for to not collide with each other
in your requests.
example: a4f88150
explode: false
in: header
name: X-Request-Id
name: X-Idempotency-Key
required: false
schema:
type: string
Expand All @@ -404,30 +373,21 @@ paths:
example: 3f2d23ee214
type: string
style: simple
- description: FEDWireMessage ID
explode: false
in: path
name: FEDWireMessage_id
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/FEDWireMessage'
required: true
schema:
example: "45758063"
type: string
style: simple
responses:
200:
content:
application/json:
schema:
$ref: '#/components/schemas/FEDWireMessage'
description: FEDWireMessage object
404:
description: FEDWireMessage or File not found
description: FEDWireMessage added to File
security:
- bearerAuth: []
- cookieAuth: []
summary: Get a specific FEDWireMessage on a FIle
summary: Add FEDWireMessage to File
tags:
- Wire Files
- FEDWireMessage File
components:
schemas:
CreateFile:
Expand Down
111 changes: 111 additions & 0 deletions client/api_fed_wire_message_file.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/*
* WIRE API
*
* Moov WIRE () implements an HTTP API for creating, parsing and validating WIRE files.
*
* API version: v1
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/

package openapi

import (
"context"
"io/ioutil"
"net/http"
"net/url"
"fmt"
"strings"
"github.com/antihax/optional"
)

// Linger please
var (
_ context.Context
)

type FEDWireMessageFileApiService service

/*
FEDWireMessageFileApiService Add FEDWireMessage to File
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param fileId File ID
* @param fedWireMessage
* @param optional nil or *AddFEDWireMessageToFileOpts - Optional Parameters:
* @param "XRequestId" (optional.String) - Optional Request ID allows application developer to trace requests through the systems logs
* @param "XIdempotencyKey" (optional.String) - Idempotent key in the header which expires after 24 hours. These strings should contain enough entropy for to not collide with each other in your requests.
*/

type AddFEDWireMessageToFileOpts struct {
XRequestId optional.String
XIdempotencyKey optional.String
}

func (a *FEDWireMessageFileApiService) AddFEDWireMessageToFile(ctx context.Context, fileId string, fedWireMessage FedWireMessage, localVarOptionals *AddFEDWireMessageToFileOpts) (*http.Response, error) {
var (
localVarHttpMethod = http.MethodPost
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
)

// create path and map variables
localVarPath := a.client.cfg.BasePath + "/files/{file_id}/FEDWireMessage"
localVarPath = strings.Replace(localVarPath, "{"+"file_id"+"}", fmt.Sprintf("%v", fileId), -1)

localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}

// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}

// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}

// to determine the Accept header
localVarHttpHeaderAccepts := []string{}

// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XRequestId.IsSet() {
localVarHeaderParams["X-Request-Id"] = parameterToString(localVarOptionals.XRequestId.Value(), "")
}
if localVarOptionals != nil && localVarOptionals.XIdempotencyKey.IsSet() {
localVarHeaderParams["X-Idempotency-Key"] = parameterToString(localVarOptionals.XIdempotencyKey.Value(), "")
}
// body params
localVarPostBody = &fedWireMessage
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}

localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}

localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarHttpResponse, err
}

if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
return localVarHttpResponse, newErr
}

return localVarHttpResponse, nil
}
Loading

0 comments on commit d42ad77

Please sign in to comment.