Merged in feature/textExtractionsPart2 (pull request #193)
Continue finishing the parts of the text extraction plan * add missing fields
This commit is contained in:
@@ -246,6 +246,7 @@ type ArrayFieldItem struct {
|
||||
AareteDerivedClaimTypeCd *string `json:"aareteDerivedClaimTypeCd,omitempty"`
|
||||
AareteDerivedFeeSchedule *string `json:"aareteDerivedFeeSchedule,omitempty"`
|
||||
AareteDerivedFeeScheduleVersion *string `json:"aareteDerivedFeeScheduleVersion,omitempty"`
|
||||
AareteDerivedGrouperVersion *string `json:"aareteDerivedGrouperVersion,omitempty"`
|
||||
AareteDerivedLob *string `json:"aareteDerivedLob,omitempty"`
|
||||
AareteDerivedNetwork *string `json:"aareteDerivedNetwork,omitempty"`
|
||||
AareteDerivedProduct *string `json:"aareteDerivedProduct,omitempty"`
|
||||
@@ -270,19 +271,48 @@ type ArrayFieldItem struct {
|
||||
DefaultInd *bool `json:"defaultInd,omitempty"`
|
||||
DiagCd *string `json:"diagCd,omitempty"`
|
||||
DiagCdDesc *string `json:"diagCdDesc,omitempty"`
|
||||
DshFeeRate *float64 `json:"dshFeeRate,omitempty"`
|
||||
DshInd *bool `json:"dshInd,omitempty"`
|
||||
DshPctRate *float64 `json:"dshPctRate,omitempty"`
|
||||
ExhibitPage *string `json:"exhibitPage,omitempty"`
|
||||
ExhibitTitle *string `json:"exhibitTitle,omitempty"`
|
||||
FacilityAdjustmentTerm *string `json:"facilityAdjustmentTerm,omitempty"`
|
||||
GmeFeeRate *float64 `json:"gmeFeeRate,omitempty"`
|
||||
GmeInd *bool `json:"gmeInd,omitempty"`
|
||||
GmePctRate *float64 `json:"gmePctRate,omitempty"`
|
||||
GreaterOfInd *bool `json:"greaterOfInd,omitempty"`
|
||||
GrouperAlternativeLevelOfCare *string `json:"grouperAlternativeLevelOfCare,omitempty"`
|
||||
GrouperBaseRate *float64 `json:"grouperBaseRate,omitempty"`
|
||||
GrouperCd *string `json:"grouperCd,omitempty"`
|
||||
GrouperCdDesc *string `json:"grouperCdDesc,omitempty"`
|
||||
GrouperHacInd *bool `json:"grouperHacInd,omitempty"`
|
||||
GrouperPctRate *float64 `json:"grouperPctRate,omitempty"`
|
||||
GrouperReadmissionsInd *bool `json:"grouperReadmissionsInd,omitempty"`
|
||||
GrouperRiskOfMortalitySubclass *string `json:"grouperRiskOfMortalitySubclass,omitempty"`
|
||||
GrouperSeverity *string `json:"grouperSeverity,omitempty"`
|
||||
GrouperSeverityInd *bool `json:"grouperSeverityInd,omitempty"`
|
||||
GrouperTransferInd *bool `json:"grouperTransferInd,omitempty"`
|
||||
GrouperType *string `json:"grouperType,omitempty"`
|
||||
ImeFeeRate *float64 `json:"imeFeeRate,omitempty"`
|
||||
ImeInd *bool `json:"imeInd,omitempty"`
|
||||
ImePctRate *float64 `json:"imePctRate,omitempty"`
|
||||
LesserOfInd *bool `json:"lesserOfInd,omitempty"`
|
||||
LobProductRelationship *string `json:"lobProductRelationship,omitempty"`
|
||||
LobProgramRelationship *string `json:"lobProgramRelationship,omitempty"`
|
||||
NdcCd *string `json:"ndcCd,omitempty"`
|
||||
NdcCdDesc *string `json:"ndcCdDesc,omitempty"`
|
||||
NtapFeeRate *float64 `json:"ntapFeeRate,omitempty"`
|
||||
NtapInd *bool `json:"ntapInd,omitempty"`
|
||||
NtapPctRate *float64 `json:"ntapPctRate,omitempty"`
|
||||
OutlierExclusionCd *string `json:"outlierExclusionCd,omitempty"`
|
||||
OutlierExclusionCdDesc *string `json:"outlierExclusionCdDesc,omitempty"`
|
||||
OutlierFirstDollarInd *bool `json:"outlierFirstDollarInd,omitempty"`
|
||||
OutlierFixedLossNbrDaysThreshold *float64 `json:"outlierFixedLossNbrDaysThreshold,omitempty"`
|
||||
OutlierFixedLossThreshold *float64 `json:"outlierFixedLossThreshold,omitempty"`
|
||||
OutlierMaximum *float64 `json:"outlierMaximum,omitempty"`
|
||||
OutlierMaximumFrequency *float64 `json:"outlierMaximumFrequency,omitempty"`
|
||||
OutlierPctRate *float64 `json:"outlierPctRate,omitempty"`
|
||||
OutlierTerm *string `json:"outlierTerm,omitempty"`
|
||||
PatientAgeMax *string `json:"patientAgeMax,omitempty"`
|
||||
PatientAgeMin *string `json:"patientAgeMin,omitempty"`
|
||||
PlaceOfServiceCd *string `json:"placeOfServiceCd,omitempty"`
|
||||
@@ -291,6 +321,11 @@ type ArrayFieldItem struct {
|
||||
ProvSpecialtyCdDesc *string `json:"provSpecialtyCdDesc,omitempty"`
|
||||
ProvTaxonomyCd *string `json:"provTaxonomyCd,omitempty"`
|
||||
ProvTaxonomyCdDesc *string `json:"provTaxonomyCdDesc,omitempty"`
|
||||
RangeNbrDays *string `json:"rangeNbrDays,omitempty"`
|
||||
RateEscalatorDesc *string `json:"rateEscalatorDesc,omitempty"`
|
||||
RateEscalatorInd *bool `json:"rateEscalatorInd,omitempty"`
|
||||
RateEscalatorMaxRateIncPct *float64 `json:"rateEscalatorMaxRateIncPct,omitempty"`
|
||||
RateEscalatorRateChangeTimeline *float64 `json:"rateEscalatorRateChangeTimeline,omitempty"`
|
||||
ReimbConversionFactor *float64 `json:"reimbConversionFactor,omitempty"`
|
||||
ReimbEffectiveDt *openapi_types.Date `json:"reimbEffectiveDt,omitempty"`
|
||||
ReimbFeeRate *float64 `json:"reimbFeeRate,omitempty"`
|
||||
@@ -303,8 +338,21 @@ type ArrayFieldItem struct {
|
||||
RevenueCd *string `json:"revenueCd,omitempty"`
|
||||
RevenueCdDesc *string `json:"revenueCdDesc,omitempty"`
|
||||
ServiceTerm *string `json:"serviceTerm,omitempty"`
|
||||
StopLossDailyMaxRate *float64 `json:"stopLossDailyMaxRate,omitempty"`
|
||||
StopLossExclusionCd *string `json:"stopLossExclusionCd,omitempty"`
|
||||
StopLossExclusionDesc *string `json:"stopLossExclusionDesc,omitempty"`
|
||||
StopLossFirstDollarInd *bool `json:"stopLossFirstDollarInd,omitempty"`
|
||||
StopLossFixedLossThreshold *float64 `json:"stopLossFixedLossThreshold,omitempty"`
|
||||
StopLossMaximum *float64 `json:"stopLossMaximum,omitempty"`
|
||||
StopLossMaximumFrequency *float64 `json:"stopLossMaximumFrequency,omitempty"`
|
||||
StopLossPctRateOnExcessCharges *float64 `json:"stopLossPctRateOnExcessCharges,omitempty"`
|
||||
StopLossRangeNbrDays *float64 `json:"stopLossRangeNbrDays,omitempty"`
|
||||
StopLossTerm *string `json:"stopLossTerm,omitempty"`
|
||||
TriggerBaseThreshold *float64 `json:"triggerBaseThreshold,omitempty"`
|
||||
TriggerCapThresholdAmt *float64 `json:"triggerCapThresholdAmt,omitempty"`
|
||||
UcFeeRate *float64 `json:"ucFeeRate,omitempty"`
|
||||
UcInd *bool `json:"ucInd,omitempty"`
|
||||
UcPctRate *float64 `json:"ucPctRate,omitempty"`
|
||||
UnitOfMeasure *string `json:"unitOfMeasure,omitempty"`
|
||||
}
|
||||
|
||||
@@ -430,6 +478,15 @@ type ClientIDBody struct {
|
||||
Id ClientID `json:"id"`
|
||||
}
|
||||
|
||||
// ClientListResponse Response containing a list of all clients.
|
||||
type ClientListResponse struct {
|
||||
// Clients List of clients in the system.
|
||||
Clients []DocClient `json:"clients"`
|
||||
|
||||
// TotalCount Total number of clients.
|
||||
TotalCount int32 `json:"totalCount"`
|
||||
}
|
||||
|
||||
// ClientName The client name
|
||||
type ClientName = string
|
||||
|
||||
@@ -993,6 +1050,15 @@ type GetFieldExtractionHistoryParams struct {
|
||||
DocumentId openapi_types.UUID `form:"documentId" json:"documentId"`
|
||||
}
|
||||
|
||||
// GetFieldExtractionByVersionParams defines parameters for GetFieldExtractionByVersion.
|
||||
type GetFieldExtractionByVersionParams struct {
|
||||
// DocumentId The document ID
|
||||
DocumentId openapi_types.UUID `form:"documentId" json:"documentId"`
|
||||
|
||||
// Version The version number to retrieve
|
||||
Version int64 `form:"version" json:"version"`
|
||||
}
|
||||
|
||||
// GetDocumentsByLabelParams defines parameters for GetDocumentsByLabel.
|
||||
type GetDocumentsByLabelParams struct {
|
||||
// ClientId The client ID to filter documents
|
||||
@@ -1204,6 +1270,9 @@ type ClientInterface interface {
|
||||
// GetStatusByClientId request
|
||||
GetStatusByClientId(ctx context.Context, id ClientID, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
|
||||
// ListClients request
|
||||
ListClients(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
|
||||
// GetDocument request
|
||||
GetDocument(ctx context.Context, id DocumentID, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
|
||||
@@ -1229,6 +1298,9 @@ type ClientInterface interface {
|
||||
// GetFieldExtractionHistory request
|
||||
GetFieldExtractionHistory(ctx context.Context, params *GetFieldExtractionHistoryParams, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
|
||||
// GetFieldExtractionByVersion request
|
||||
GetFieldExtractionByVersion(ctx context.Context, params *GetFieldExtractionByVersionParams, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
|
||||
// CreateFolderWithBody request with any body
|
||||
CreateFolderWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
|
||||
@@ -1618,6 +1690,18 @@ func (c *Client) GetStatusByClientId(ctx context.Context, id ClientID, reqEditor
|
||||
return c.Client.Do(req)
|
||||
}
|
||||
|
||||
func (c *Client) ListClients(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
||||
req, err := NewListClientsRequest(c.Server)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req = req.WithContext(ctx)
|
||||
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return c.Client.Do(req)
|
||||
}
|
||||
|
||||
func (c *Client) GetDocument(ctx context.Context, id DocumentID, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
||||
req, err := NewGetDocumentRequest(c.Server, id)
|
||||
if err != nil {
|
||||
@@ -1726,6 +1810,18 @@ func (c *Client) GetFieldExtractionHistory(ctx context.Context, params *GetField
|
||||
return c.Client.Do(req)
|
||||
}
|
||||
|
||||
func (c *Client) GetFieldExtractionByVersion(ctx context.Context, params *GetFieldExtractionByVersionParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
||||
req, err := NewGetFieldExtractionByVersionRequest(c.Server, params)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req = req.WithContext(ctx)
|
||||
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return c.Client.Do(req)
|
||||
}
|
||||
|
||||
func (c *Client) CreateFolderWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
||||
req, err := NewCreateFolderRequestWithBody(c.Server, contentType, body)
|
||||
if err != nil {
|
||||
@@ -2935,6 +3031,33 @@ func NewGetStatusByClientIdRequest(server string, id ClientID) (*http.Request, e
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// NewListClientsRequest generates requests for ListClients
|
||||
func NewListClientsRequest(server string) (*http.Request, error) {
|
||||
var err error
|
||||
|
||||
serverURL, err := url.Parse(server)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
operationPath := fmt.Sprintf("/clients")
|
||||
if operationPath[0] == '/' {
|
||||
operationPath = "." + operationPath
|
||||
}
|
||||
|
||||
queryURL, err := serverURL.Parse(operationPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
req, err := http.NewRequest("GET", queryURL.String(), nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// NewGetDocumentRequest generates requests for GetDocument
|
||||
func NewGetDocumentRequest(server string, id DocumentID) (*http.Request, error) {
|
||||
var err error
|
||||
@@ -3214,6 +3337,63 @@ func NewGetFieldExtractionHistoryRequest(server string, params *GetFieldExtracti
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// NewGetFieldExtractionByVersionRequest generates requests for GetFieldExtractionByVersion
|
||||
func NewGetFieldExtractionByVersionRequest(server string, params *GetFieldExtractionByVersionParams) (*http.Request, error) {
|
||||
var err error
|
||||
|
||||
serverURL, err := url.Parse(server)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
operationPath := fmt.Sprintf("/field-extractions/version")
|
||||
if operationPath[0] == '/' {
|
||||
operationPath = "." + operationPath
|
||||
}
|
||||
|
||||
queryURL, err := serverURL.Parse(operationPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if params != nil {
|
||||
queryValues := queryURL.Query()
|
||||
|
||||
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "documentId", runtime.ParamLocationQuery, params.DocumentId); err != nil {
|
||||
return nil, err
|
||||
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
for k, v := range parsed {
|
||||
for _, v2 := range v {
|
||||
queryValues.Add(k, v2)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "version", runtime.ParamLocationQuery, params.Version); err != nil {
|
||||
return nil, err
|
||||
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
for k, v := range parsed {
|
||||
for _, v2 := range v {
|
||||
queryValues.Add(k, v2)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
queryURL.RawQuery = queryValues.Encode()
|
||||
}
|
||||
|
||||
req, err := http.NewRequest("GET", queryURL.String(), nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// NewCreateFolderRequest calls the generic CreateFolder builder with application/json body
|
||||
func NewCreateFolderRequest(server string, body CreateFolderJSONRequestBody) (*http.Request, error) {
|
||||
var bodyReader io.Reader
|
||||
@@ -3875,6 +4055,9 @@ type ClientWithResponsesInterface interface {
|
||||
// GetStatusByClientIdWithResponse request
|
||||
GetStatusByClientIdWithResponse(ctx context.Context, id ClientID, reqEditors ...RequestEditorFn) (*GetStatusByClientIdResponse, error)
|
||||
|
||||
// ListClientsWithResponse request
|
||||
ListClientsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListClientsResponse, error)
|
||||
|
||||
// GetDocumentWithResponse request
|
||||
GetDocumentWithResponse(ctx context.Context, id DocumentID, reqEditors ...RequestEditorFn) (*GetDocumentResponse, error)
|
||||
|
||||
@@ -3900,6 +4083,9 @@ type ClientWithResponsesInterface interface {
|
||||
// GetFieldExtractionHistoryWithResponse request
|
||||
GetFieldExtractionHistoryWithResponse(ctx context.Context, params *GetFieldExtractionHistoryParams, reqEditors ...RequestEditorFn) (*GetFieldExtractionHistoryResponse, error)
|
||||
|
||||
// GetFieldExtractionByVersionWithResponse request
|
||||
GetFieldExtractionByVersionWithResponse(ctx context.Context, params *GetFieldExtractionByVersionParams, reqEditors ...RequestEditorFn) (*GetFieldExtractionByVersionResponse, error)
|
||||
|
||||
// CreateFolderWithBodyWithResponse request with any body
|
||||
CreateFolderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateFolderResponse, error)
|
||||
|
||||
@@ -4540,6 +4726,32 @@ func (r GetStatusByClientIdResponse) StatusCode() int {
|
||||
return 0
|
||||
}
|
||||
|
||||
type ListClientsResponse struct {
|
||||
Body []byte
|
||||
HTTPResponse *http.Response
|
||||
JSON200 *ClientListResponse
|
||||
JSON400 *InvalidRequest
|
||||
JSON401 *Unauthorized
|
||||
JSON429 *TooManyRequests
|
||||
JSON500 *InternalError
|
||||
}
|
||||
|
||||
// Status returns HTTPResponse.Status
|
||||
func (r ListClientsResponse) Status() string {
|
||||
if r.HTTPResponse != nil {
|
||||
return r.HTTPResponse.Status
|
||||
}
|
||||
return http.StatusText(0)
|
||||
}
|
||||
|
||||
// StatusCode returns HTTPResponse.StatusCode
|
||||
func (r ListClientsResponse) StatusCode() int {
|
||||
if r.HTTPResponse != nil {
|
||||
return r.HTTPResponse.StatusCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type GetDocumentResponse struct {
|
||||
Body []byte
|
||||
HTTPResponse *http.Response
|
||||
@@ -4731,6 +4943,33 @@ func (r GetFieldExtractionHistoryResponse) StatusCode() int {
|
||||
return 0
|
||||
}
|
||||
|
||||
type GetFieldExtractionByVersionResponse struct {
|
||||
Body []byte
|
||||
HTTPResponse *http.Response
|
||||
JSON200 *FieldExtractionResponse
|
||||
JSON400 *InvalidRequest
|
||||
JSON401 *Unauthorized
|
||||
JSON404 *NotFound
|
||||
JSON429 *TooManyRequests
|
||||
JSON500 *InternalError
|
||||
}
|
||||
|
||||
// Status returns HTTPResponse.Status
|
||||
func (r GetFieldExtractionByVersionResponse) Status() string {
|
||||
if r.HTTPResponse != nil {
|
||||
return r.HTTPResponse.Status
|
||||
}
|
||||
return http.StatusText(0)
|
||||
}
|
||||
|
||||
// StatusCode returns HTTPResponse.StatusCode
|
||||
func (r GetFieldExtractionByVersionResponse) StatusCode() int {
|
||||
if r.HTTPResponse != nil {
|
||||
return r.HTTPResponse.StatusCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type CreateFolderResponse struct {
|
||||
Body []byte
|
||||
HTTPResponse *http.Response
|
||||
@@ -5343,6 +5582,15 @@ func (c *ClientWithResponses) GetStatusByClientIdWithResponse(ctx context.Contex
|
||||
return ParseGetStatusByClientIdResponse(rsp)
|
||||
}
|
||||
|
||||
// ListClientsWithResponse request returning *ListClientsResponse
|
||||
func (c *ClientWithResponses) ListClientsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListClientsResponse, error) {
|
||||
rsp, err := c.ListClients(ctx, reqEditors...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ParseListClientsResponse(rsp)
|
||||
}
|
||||
|
||||
// GetDocumentWithResponse request returning *GetDocumentResponse
|
||||
func (c *ClientWithResponses) GetDocumentWithResponse(ctx context.Context, id DocumentID, reqEditors ...RequestEditorFn) (*GetDocumentResponse, error) {
|
||||
rsp, err := c.GetDocument(ctx, id, reqEditors...)
|
||||
@@ -5422,6 +5670,15 @@ func (c *ClientWithResponses) GetFieldExtractionHistoryWithResponse(ctx context.
|
||||
return ParseGetFieldExtractionHistoryResponse(rsp)
|
||||
}
|
||||
|
||||
// GetFieldExtractionByVersionWithResponse request returning *GetFieldExtractionByVersionResponse
|
||||
func (c *ClientWithResponses) GetFieldExtractionByVersionWithResponse(ctx context.Context, params *GetFieldExtractionByVersionParams, reqEditors ...RequestEditorFn) (*GetFieldExtractionByVersionResponse, error) {
|
||||
rsp, err := c.GetFieldExtractionByVersion(ctx, params, reqEditors...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ParseGetFieldExtractionByVersionResponse(rsp)
|
||||
}
|
||||
|
||||
// CreateFolderWithBodyWithResponse request with arbitrary body returning *CreateFolderResponse
|
||||
func (c *ClientWithResponses) CreateFolderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateFolderResponse, error) {
|
||||
rsp, err := c.CreateFolderWithBody(ctx, contentType, body, reqEditors...)
|
||||
@@ -6881,6 +7138,60 @@ func ParseGetStatusByClientIdResponse(rsp *http.Response) (*GetStatusByClientIdR
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// ParseListClientsResponse parses an HTTP response from a ListClientsWithResponse call
|
||||
func ParseListClientsResponse(rsp *http.Response) (*ListClientsResponse, error) {
|
||||
bodyBytes, err := io.ReadAll(rsp.Body)
|
||||
defer func() { _ = rsp.Body.Close() }()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
response := &ListClientsResponse{
|
||||
Body: bodyBytes,
|
||||
HTTPResponse: rsp,
|
||||
}
|
||||
|
||||
switch {
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
||||
var dest ClientListResponse
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON200 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
|
||||
var dest InvalidRequest
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON400 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
|
||||
var dest Unauthorized
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON401 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
|
||||
var dest TooManyRequests
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON429 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
|
||||
var dest InternalError
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON500 = &dest
|
||||
|
||||
}
|
||||
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// ParseGetDocumentResponse parses an HTTP response from a GetDocumentWithResponse call
|
||||
func ParseGetDocumentResponse(rsp *http.Response) (*GetDocumentResponse, error) {
|
||||
bodyBytes, err := io.ReadAll(rsp.Body)
|
||||
@@ -7298,6 +7609,67 @@ func ParseGetFieldExtractionHistoryResponse(rsp *http.Response) (*GetFieldExtrac
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// ParseGetFieldExtractionByVersionResponse parses an HTTP response from a GetFieldExtractionByVersionWithResponse call
|
||||
func ParseGetFieldExtractionByVersionResponse(rsp *http.Response) (*GetFieldExtractionByVersionResponse, error) {
|
||||
bodyBytes, err := io.ReadAll(rsp.Body)
|
||||
defer func() { _ = rsp.Body.Close() }()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
response := &GetFieldExtractionByVersionResponse{
|
||||
Body: bodyBytes,
|
||||
HTTPResponse: rsp,
|
||||
}
|
||||
|
||||
switch {
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
||||
var dest FieldExtractionResponse
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON200 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
|
||||
var dest InvalidRequest
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON400 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
|
||||
var dest Unauthorized
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON401 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
||||
var dest NotFound
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON404 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
|
||||
var dest TooManyRequests
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON429 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
|
||||
var dest InternalError
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON500 = &dest
|
||||
|
||||
}
|
||||
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// ParseCreateFolderResponse parses an HTTP response from a CreateFolderWithResponse call
|
||||
func ParseCreateFolderResponse(rsp *http.Response) (*CreateFolderResponse, error) {
|
||||
bodyBytes, err := io.ReadAll(rsp.Body)
|
||||
|
||||
Reference in New Issue
Block a user