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.11.0"
".": "0.12.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: 21
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser/cas-parser-902b4d5af31c8c6bab33a08d9cea10f3444be221abf735466eb9fd58a14e0a87.yml
openapi_spec_hash: e333f46097f3a3a452cb4d6564a3db67
configured_endpoints: 20
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser/cas-parser-26d0931f3488af784c16303683cbf24225c727615fd32ee071144974e7c59670.yml
openapi_spec_hash: 242a5f4d982645a25e0d66ef088940a5
config_hash: 5509bb7a961ae2e79114b24c381606d4
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.12.0 (2026-07-26)

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

### Features

* **api:** api update ([bc6ef6a](https://github.com/CASParser/cas-parser-go/commit/bc6ef6abd5b762edadc057f32a953181a463bd5a))

## 0.11.0 (2026-07-18)

Full Changelog: [v0.10.0...v0.11.0](https://github.com/CASParser/cas-parser-go/compare/v0.10.0...v0.11.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

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

<!-- x-release-please-end -->
Expand Down
8 changes: 0 additions & 8 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,6 @@ Methods:

# Kfintech

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#KfintechGenerateCasResponse">KfintechGenerateCasResponse</a>

Methods:

- <code title="post /v4/kfintech/generate">client.Kfintech.<a href="https://pkg.go.dev/github.com/CASParser/cas-parser-go#KfintechService.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#KfintechGenerateCasParams">KfintechGenerateCasParams</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#KfintechGenerateCasResponse">KfintechGenerateCasResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

# Nsdl

Methods:
Expand Down
3 changes: 1 addition & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ type Client struct {
// - Read-only access (we cannot send emails)
// - Tokens are encrypted with server-side secret
// - User can revoke access anytime via `/v4/inbox/disconnect`
Inbox InboxService
// Endpoints for generating new CAS documents via email mailback (KFintech).
Inbox InboxService
Kfintech KfintechService
// Endpoints for parsing CAS PDF files from different sources.
Nsdl NsdlService
Expand Down
2 changes: 1 addition & 1 deletion internal/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

package internal

const PackageVersion = "0.11.0" // x-release-please-version
const PackageVersion = "0.12.0" // x-release-please-version
62 changes: 0 additions & 62 deletions kfintech.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,9 @@
package casparser

import (
"context"
"net/http"
"slices"

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

// Endpoints for generating new CAS documents via email mailback (KFintech).
//
// KfintechService contains methods and other services that help with interacting
// with the cas-parser API.
//
Expand All @@ -34,55 +24,3 @@ func NewKfintechService(opts ...option.RequestOption) (r KfintechService) {
r.Options = opts
return
}

// Generate CAS via KFintech mailback. The CAS PDF will be sent to the investor's
// email.
//
// This is an async operation - the investor receives the CAS via email within a
// few minutes. For instant CAS retrieval, use CDSL Fetch (`/v4/cdsl/fetch`).
func (r *KfintechService) GenerateCas(ctx context.Context, body KfintechGenerateCasParams, opts ...option.RequestOption) (res *KfintechGenerateCasResponse, err error) {
opts = slices.Concat(r.Options, opts)
path := "v4/kfintech/generate"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
return res, err
}

type KfintechGenerateCasResponse 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 KfintechGenerateCasResponse) RawJSON() string { return r.JSON.raw }
func (r *KfintechGenerateCasResponse) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}

type KfintechGenerateCasParams struct {
// Email address to receive the CAS document
Email string `json:"email" api:"required"`
// Start date (YYYY-MM-DD)
FromDate string `json:"from_date" api:"required"`
// Password for the PDF
Password string `json:"password" api:"required"`
// End date (YYYY-MM-DD)
ToDate string `json:"to_date" api:"required"`
// PAN number (optional)
PanNo param.Opt[string] `json:"pan_no,omitzero"`
paramObj
}

func (r KfintechGenerateCasParams) MarshalJSON() (data []byte, err error) {
type shadow KfintechGenerateCasParams
return param.MarshalObject(r, (*shadow)(&r))
}
func (r *KfintechGenerateCasParams) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
43 changes: 0 additions & 43 deletions kfintech_test.go

This file was deleted.

Loading