Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.0.3"
".": "0.1.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 5
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-b7fdba3d3f97c7debc22c7ca30b828bce81bcd64648df8c94029b27a3321ebb9.yml
openapi_spec_hash: 03f1315f1d32ada42445ca920f047dff
configured_endpoints: 4
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-7e6397bddc220d1a59b5e2c7e7c3ff38f1a6eb174f4e383e03bc49cf78c8c44f.yml
openapi_spec_hash: cb852eeb4ce89c80f4246815cbe21f72
config_hash: cb5d75abef6264b5d86448caf7295afa
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Changelog

## 0.1.0 (2026-01-05)

Full Changelog: [v0.0.3...v0.1.0](https://github.com/CASParser/cas-parser-go/compare/v0.0.3...v0.1.0)

### Features

* **api:** api update ([4de0c4b](https://github.com/CASParser/cas-parser-go/commit/4de0c4b7936cbe00370980ab20aad02586090fcd))
* **api:** api update ([c4b3ed4](https://github.com/CASParser/cas-parser-go/commit/c4b3ed40ff9e5d6ad1ac4ca57e0219d184038d20))
* **api:** api update ([4cafc4e](https://github.com/CASParser/cas-parser-go/commit/4cafc4e634e376310e635eeeacd9c6bc1656d7ca))


### Bug Fixes

* bugfix for setting JSON keys with special characters ([48f9ffd](https://github.com/CASParser/cas-parser-go/commit/48f9ffda3a0053adcf1a68c5378bbeac9de9027c))
* use slices.Concat instead of sometimes modifying r.Options ([c30d79a](https://github.com/CASParser/cas-parser-go/commit/c30d79aa4eb1f8b4d793fe5e641db7d0f385a9dc))


### Chores

* bump minimum go version to 1.22 ([54f1ae1](https://github.com/CASParser/cas-parser-go/commit/54f1ae1bedb207621a92b70a64220456781a8e37))
* do not install brew dependencies in ./scripts/bootstrap by default ([a665c6a](https://github.com/CASParser/cas-parser-go/commit/a665c6aa0d14754a7f4ea644b2b53ac49dec0f0c))
* **internal:** codegen related update ([b0d066b](https://github.com/CASParser/cas-parser-go/commit/b0d066be8e48533c4e0bf3f004c3c6ad96af0008))
* **internal:** grammar fix (it's -> its) ([0af28e9](https://github.com/CASParser/cas-parser-go/commit/0af28e95581cfd4c2d9f729ee59f8213253da54a))
* update more docs for 1.22 ([fc3b56e](https://github.com/CASParser/cas-parser-go/commit/fc3b56e861603f65fd1a61d6c843b220e94154cc))

## 0.0.3 (2025-09-06)

Full Changelog: [v0.0.2...v0.0.3](https://github.com/CASParser/cas-parser-go/compare/v0.0.2...v0.0.3)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $ ./scripts/lint

This will install all the required dependencies and build the SDK.

You can also [install go 1.18+ manually](https://go.dev/doc/install).
You can also [install go 1.22+ manually](https://go.dev/doc/install).

## Modifying/Adding code

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2025 Cas Parser
Copyright 2026 Cas Parser

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/CASParser/cas-parser-go@v0.0.3'
go get -u 'github.com/CASParser/cas-parser-go@v0.1.0'
```

<!-- x-release-please-end -->

## Requirements

This library requires Go 1.18+.
This library requires Go 1.22+.

## Usage

Expand Down Expand Up @@ -128,7 +128,7 @@ custom := param.Override[casparser.FooParams](12)

### Request unions

Unions are represented as a struct with fields prefixed by "Of" for each of it's variants,
Unions are represented as a struct with fields prefixed by "Of" for each of its variants,
only one field can be non-zero. The non-zero field will be serialized.

Sub-properties of the union can be accessed via methods on the union struct.
Expand Down
8 changes: 0 additions & 8 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,3 @@ Methods:
- <code title="post /v4/smart/parse">client.CasParser.<a href="https://pkg.go.dev/github.com/CASParser/cas-parser-go#CasParserService.SmartParse">SmartParse</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/CASParser/cas-parser-go">casparser</a>.<a href="https://pkg.go.dev/github.com/CASParser/cas-parser-go#CasParserSmartParseParams">CasParserSmartParseParams</a>) (<a href="https://pkg.go.dev/github.com/CASParser/cas-parser-go">casparser</a>.<a href="https://pkg.go.dev/github.com/CASParser/cas-parser-go#UnifiedResponse">UnifiedResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

# CasGenerator

Response Types:

- <a href="https://pkg.go.dev/github.com/CASParser/cas-parser-go">casparser</a>.<a href="https://pkg.go.dev/github.com/CASParser/cas-parser-go#CasGeneratorGenerateCasResponse">CasGeneratorGenerateCasResponse</a>

Methods:

- <code title="post /v4/generate">client.CasGenerator.<a href="https://pkg.go.dev/github.com/CASParser/cas-parser-go#CasGeneratorService.GenerateCas">GenerateCas</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/CASParser/cas-parser-go">casparser</a>.<a href="https://pkg.go.dev/github.com/CASParser/cas-parser-go#CasGeneratorGenerateCasParams">CasGeneratorGenerateCasParams</a>) (<a href="https://pkg.go.dev/github.com/CASParser/cas-parser-go">casparser</a>.<a href="https://pkg.go.dev/github.com/CASParser/cas-parser-go#CasGeneratorGenerateCasResponse">CasGeneratorGenerateCasResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
73 changes: 0 additions & 73 deletions casgenerator.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,7 @@
package casparser

import (
"context"
"net/http"

"github.com/CASParser/cas-parser-go/internal/apijson"
"github.com/CASParser/cas-parser-go/internal/requestconfig"
"github.com/CASParser/cas-parser-go/option"
"github.com/CASParser/cas-parser-go/packages/param"
"github.com/CASParser/cas-parser-go/packages/respjson"
)

// CasGeneratorService contains methods and other services that help with
Expand All @@ -31,69 +24,3 @@ func NewCasGeneratorService(opts ...option.RequestOption) (r CasGeneratorService
r.Options = opts
return
}

// This endpoint generates CAS (Consolidated Account Statement) documents by
// submitting a mailback request to the specified CAS authority. Currently only
// supports KFintech, with plans to support CAMS, CDSL, and NSDL in the future.
func (r *CasGeneratorService) GenerateCas(ctx context.Context, body CasGeneratorGenerateCasParams, opts ...option.RequestOption) (res *CasGeneratorGenerateCasResponse, err error) {
opts = append(r.Options[:], opts...)
path := "v4/generate"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
return
}

type CasGeneratorGenerateCasResponse struct {
Msg string `json:"msg"`
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Msg respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}

// Returns the unmodified JSON received from the API
func (r CasGeneratorGenerateCasResponse) RawJSON() string { return r.JSON.raw }
func (r *CasGeneratorGenerateCasResponse) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}

type CasGeneratorGenerateCasParams struct {
// Email address to receive the CAS document
Email string `json:"email,required"`
// Start date for the CAS period (format YYYY-MM-DD)
FromDate string `json:"from_date,required"`
// Password to protect the generated CAS PDF
Password string `json:"password,required"`
// End date for the CAS period (format YYYY-MM-DD)
ToDate string `json:"to_date,required"`
// PAN number (optional for some CAS authorities)
PanNo param.Opt[string] `json:"pan_no,omitzero"`
// CAS authority to generate the document from (currently only kfintech is
// supported)
//
// Any of "kfintech", "cams", "cdsl", "nsdl".
CasAuthority CasGeneratorGenerateCasParamsCasAuthority `json:"cas_authority,omitzero"`
paramObj
}

func (r CasGeneratorGenerateCasParams) MarshalJSON() (data []byte, err error) {
type shadow CasGeneratorGenerateCasParams
return param.MarshalObject(r, (*shadow)(&r))
}
func (r *CasGeneratorGenerateCasParams) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}

// CAS authority to generate the document from (currently only kfintech is
// supported)
type CasGeneratorGenerateCasParamsCasAuthority string

const (
CasGeneratorGenerateCasParamsCasAuthorityKfintech CasGeneratorGenerateCasParamsCasAuthority = "kfintech"
CasGeneratorGenerateCasParamsCasAuthorityCams CasGeneratorGenerateCasParamsCasAuthority = "cams"
CasGeneratorGenerateCasParamsCasAuthorityCdsl CasGeneratorGenerateCasParamsCasAuthority = "cdsl"
CasGeneratorGenerateCasParamsCasAuthorityNsdl CasGeneratorGenerateCasParamsCasAuthority = "nsdl"
)
44 changes: 0 additions & 44 deletions casgenerator_test.go

This file was deleted.

Loading