@@ -39,6 +39,33 @@ func NewToMarkdownService(opts ...option.RequestOption) (r *ToMarkdownService) {
3939 return
4040}
4141
42+ // Get all converted formats supported
43+ func (r * ToMarkdownService ) Supported (ctx context.Context , query ToMarkdownSupportedParams , opts ... option.RequestOption ) (res * pagination.SinglePage [ToMarkdownSupportedResponse ], err error ) {
44+ var raw * http.Response
45+ opts = slices .Concat (r .Options , opts )
46+ opts = append ([]option.RequestOption {option .WithResponseInto (& raw )}, opts ... )
47+ if query .AccountID .Value == "" {
48+ err = errors .New ("missing required account_id parameter" )
49+ return
50+ }
51+ path := fmt .Sprintf ("accounts/%s/ai/tomarkdown/supported" , query .AccountID )
52+ cfg , err := requestconfig .NewRequestConfig (ctx , http .MethodGet , path , nil , & res , opts ... )
53+ if err != nil {
54+ return nil , err
55+ }
56+ err = cfg .Execute ()
57+ if err != nil {
58+ return nil , err
59+ }
60+ res .SetPageConfig (cfg , raw )
61+ return res , nil
62+ }
63+
64+ // Get all converted formats supported
65+ func (r * ToMarkdownService ) SupportedAutoPaging (ctx context.Context , query ToMarkdownSupportedParams , opts ... option.RequestOption ) * pagination.SinglePageAutoPager [ToMarkdownSupportedResponse ] {
66+ return pagination .NewSinglePageAutoPager (r .Supported (ctx , query , opts ... ))
67+ }
68+
4269// Convert Files into Markdown
4370func (r * ToMarkdownService ) Transform (ctx context.Context , file io.Reader , body ToMarkdownTransformParams , opts ... option.RequestOption ) (res * pagination.SinglePage [ToMarkdownTransformResponse ], err error ) {
4471 var raw * http.Response
@@ -66,6 +93,29 @@ func (r *ToMarkdownService) TransformAutoPaging(ctx context.Context, file io.Rea
6693 return pagination .NewSinglePageAutoPager (r .Transform (ctx , file , body , opts ... ))
6794}
6895
96+ type ToMarkdownSupportedResponse struct {
97+ Extension string `json:"extension,required"`
98+ MimeType string `json:"mimeType,required"`
99+ JSON toMarkdownSupportedResponseJSON `json:"-"`
100+ }
101+
102+ // toMarkdownSupportedResponseJSON contains the JSON metadata for the struct
103+ // [ToMarkdownSupportedResponse]
104+ type toMarkdownSupportedResponseJSON struct {
105+ Extension apijson.Field
106+ MimeType apijson.Field
107+ raw string
108+ ExtraFields map [string ]apijson.Field
109+ }
110+
111+ func (r * ToMarkdownSupportedResponse ) UnmarshalJSON (data []byte ) (err error ) {
112+ return apijson .UnmarshalRoot (data , r )
113+ }
114+
115+ func (r toMarkdownSupportedResponseJSON ) RawJSON () string {
116+ return r .raw
117+ }
118+
69119type ToMarkdownTransformResponse struct {
70120 Data string `json:"data,required"`
71121 Format string `json:"format,required"`
@@ -95,6 +145,10 @@ func (r toMarkdownTransformResponseJSON) RawJSON() string {
95145 return r .raw
96146}
97147
148+ type ToMarkdownSupportedParams struct {
149+ AccountID param.Field [string ] `path:"account_id,required"`
150+ }
151+
98152type ToMarkdownTransformParams struct {
99153 AccountID param.Field [string ] `path:"account_id,required"`
100154}
0 commit comments