From ea7fa7abb800b0281fd5b7ff2c9cc6035978a717 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Thu, 31 Oct 2024 13:43:01 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.423.5 --- .speakeasy/workflow.lock | 10 +++---- sync-for-payables/.speakeasy/gen.lock | 28 +++++++++++++++---- sync-for-payables/.speakeasy/gen.yaml | 2 +- sync-for-payables/RELEASES.md | 12 +++++++- sync-for-payables/bills.go | 26 +++++++++++++++-- sync-for-payables/codatsyncpayables.go | 6 ++-- .../operations/listbillattachmentsresponse.md | 2 +- .../uploadbillattachmentresponse.md | 3 +- sync-for-payables/docs/sdks/bills/README.md | 4 +-- .../models/operations/listbillattachments.go | 6 ++-- .../models/operations/uploadbillattachment.go | 9 ++++++ 11 files changed, 83 insertions(+), 25 deletions(-) diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index d60400d9..c37865dd 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.423.3 +speakeasyVersion: 1.423.5 sources: accounting-source: sourceNamespace: accounting-source @@ -93,8 +93,8 @@ sources: - main sync-for-payables-source: sourceNamespace: sync-for-payables-source - sourceRevisionDigest: sha256:9417873280d26018f4595b4fb72fd2632491ea18f0a9d5536b63336754509d85 - sourceBlobDigest: sha256:1ffa6da669abbf5bb7fef62b991e1c237af95f876b930288b8ab14994e0ab0b5 + sourceRevisionDigest: sha256:892b8874967cecc96433bb77727c4944a9ddda9c921bcb57da4e87867bda2090 + sourceBlobDigest: sha256:f472244dc98845d90f55da060a2cc4acee05c771a89a0ff55bc5db04108e5693 tags: - latest - main @@ -181,8 +181,8 @@ targets: sync-for-payables-library: source: sync-for-payables-source sourceNamespace: sync-for-payables-source - sourceRevisionDigest: sha256:9417873280d26018f4595b4fb72fd2632491ea18f0a9d5536b63336754509d85 - sourceBlobDigest: sha256:1ffa6da669abbf5bb7fef62b991e1c237af95f876b930288b8ab14994e0ab0b5 + sourceRevisionDigest: sha256:892b8874967cecc96433bb77727c4944a9ddda9c921bcb57da4e87867bda2090 + sourceBlobDigest: sha256:f472244dc98845d90f55da060a2cc4acee05c771a89a0ff55bc5db04108e5693 sync-for-payables-version-1-library: source: sync-for-payables-version-1-source sourceNamespace: sync-for-payables-version-1-source diff --git a/sync-for-payables/.speakeasy/gen.lock b/sync-for-payables/.speakeasy/gen.lock index 2be2bf88..952c6665 100644 --- a/sync-for-payables/.speakeasy/gen.lock +++ b/sync-for-payables/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 402c5670-2c12-44b7-81b8-9ee7a4664285 management: - docChecksum: 16c2aba5060738f14671556b6526c400 + docChecksum: c0f4a56a46c488781ea9be7def894f8c docVersion: 3.0.0 - speakeasyVersion: 1.423.3 - generationVersion: 2.442.11 - releaseVersion: 4.0.0 - configChecksum: 9eef78c4d50dd14f3910f087335269d7 + speakeasyVersion: 1.423.5 + generationVersion: 2.445.1 + releaseVersion: 4.0.1 + configChecksum: b5db3ce48fa12d8fb6a4f6603ae6216c repoURL: https://github.com/codatio/client-sdk-go.git repoSubDirectory: sync-for-payables installationURL: https://github.com/codatio/client-sdk-go/sync-for-payables @@ -709,6 +709,15 @@ examples: responses: "400": application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + Attachment metadata: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + billId: "EILBDVJVNUAGVKRQ" + responses: + "201": + application/json: {"id": "422f093f-e556-4bf3-91c0-93af70c3e850", "name": "receipt.png", "contentType": "image/png", "dateCreated": "2022-10-23T00:00:00.000Z", "fileSize": 100, "includeWhenSent": true, "sourceModifiedDate": "2022-05-26T10:34:10Z"} list-bill-attachments: Info: parameters: @@ -728,6 +737,15 @@ examples: responses: "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + Attachments: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + billId: "EILBDVJVNUAGVKRQ" + responses: + "200": + application/json: [{"id": "422f093f-e556-4bf3-91c0-93af70c3e850", "name": "receipt.png", "contentType": "image/png", "dateCreated": "2022-10-23T00:00:00.000Z", "fileSize": 100, "includeWhenSent": true, "sourceModifiedDate": "2022-05-26T10:34:10Z"}, {"id": "20cfd269-2f0f-44ef-a28c-7b5f725cf1aa", "name": "another_receipt.png", "contentType": "image/png", "dateCreated": "2022-10-24T00:00:00.000Z", "fileSize": 98, "includeWhenSent": true, "sourceModifiedDate": "2022-05-27T12:38:10Z"}] download-bill-attachment: Unauthorized: parameters: diff --git a/sync-for-payables/.speakeasy/gen.yaml b/sync-for-payables/.speakeasy/gen.yaml index 4de5f3a9..03ff3cca 100644 --- a/sync-for-payables/.speakeasy/gen.yaml +++ b/sync-for-payables/.speakeasy/gen.yaml @@ -13,7 +13,7 @@ generation: oAuth2ClientCredentialsEnabled: true telemetryEnabled: true go: - version: 4.0.0 + version: 4.0.1 additionalDependencies: {} allowUnknownFieldsInWeakUnions: false clientServerStatusCodesAsErrors: true diff --git a/sync-for-payables/RELEASES.md b/sync-for-payables/RELEASES.md index ee6d8e57..ac618e06 100644 --- a/sync-for-payables/RELEASES.md +++ b/sync-for-payables/RELEASES.md @@ -38,4 +38,14 @@ Based on: ### Generated - [go v4.0.0] sync-for-payables ### Releases -- [Go v4.0.0] https://github.com/codatio/client-sdk-go/releases/tag/sync-for-payables/v4.0.0 - sync-for-payables \ No newline at end of file +- [Go v4.0.0] https://github.com/codatio/client-sdk-go/releases/tag/sync-for-payables/v4.0.0 - sync-for-payables + +## 2024-10-31 13:42:07 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.423.5 (2.445.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v4.0.1] sync-for-payables +### Releases +- [Go v4.0.1] https://github.com/codatio/client-sdk-go/releases/tag/sync-for-payables/v4.0.1 - sync-for-payables \ No newline at end of file diff --git a/sync-for-payables/bills.go b/sync-for-payables/bills.go index a87c14ea..6c889aa3 100644 --- a/sync-for-payables/bills.go +++ b/sync-for-payables/bills.go @@ -898,6 +898,26 @@ func (s *Bills) UploadAttachment(ctx context.Context, request operations.UploadB switch { case httpRes.StatusCode == 201: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out shared.Attachment + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Attachment = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } case httpRes.StatusCode == 400: fallthrough case httpRes.StatusCode == 401: @@ -978,7 +998,7 @@ func (s *Bills) ListAttachments(ctx context.Context, request operations.ListBill } baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/bills/{billId}/attachments", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -1114,12 +1134,12 @@ func (s *Bills) ListAttachments(ctx context.Context, request operations.ListBill return nil, err } - var out shared.Attachment + var out []shared.Attachment if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Attachment = &out + res.Attachments = out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { diff --git a/sync-for-payables/codatsyncpayables.go b/sync-for-payables/codatsyncpayables.go index 9c0d7f8e..b522de48 100644 --- a/sync-for-payables/codatsyncpayables.go +++ b/sync-for-payables/codatsyncpayables.go @@ -190,9 +190,9 @@ func New(opts ...SDKOption) *CodatSyncPayables { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "3.0.0", - SDKVersion: "4.0.0", - GenVersion: "2.442.11", - UserAgent: "speakeasy-sdk/go 4.0.0 2.442.11 3.0.0 github.com/codatio/client-sdk-go/sync-for-payables", + SDKVersion: "4.0.1", + GenVersion: "2.445.1", + UserAgent: "speakeasy-sdk/go 4.0.1 2.445.1 3.0.0 github.com/codatio/client-sdk-go/sync-for-payables", Hooks: hooks.New(), }, } diff --git a/sync-for-payables/docs/pkg/models/operations/listbillattachmentsresponse.md b/sync-for-payables/docs/pkg/models/operations/listbillattachmentsresponse.md index 1de84491..fd8ce3a5 100644 --- a/sync-for-payables/docs/pkg/models/operations/listbillattachmentsresponse.md +++ b/sync-for-payables/docs/pkg/models/operations/listbillattachmentsresponse.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | | `HTTPMeta` | [shared.HTTPMetadata](../../../pkg/models/shared/httpmetadata.md) | :heavy_check_mark: | N/A | -| `Attachment` | [*shared.Attachment](../../../pkg/models/shared/attachment.md) | :heavy_minus_sign: | Success | \ No newline at end of file +| `Attachments` | [][shared.Attachment](../../../pkg/models/shared/attachment.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-payables/docs/pkg/models/operations/uploadbillattachmentresponse.md b/sync-for-payables/docs/pkg/models/operations/uploadbillattachmentresponse.md index 81578be5..b2834199 100644 --- a/sync-for-payables/docs/pkg/models/operations/uploadbillattachmentresponse.md +++ b/sync-for-payables/docs/pkg/models/operations/uploadbillattachmentresponse.md @@ -5,4 +5,5 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | -| `HTTPMeta` | [shared.HTTPMetadata](../../../pkg/models/shared/httpmetadata.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| `HTTPMeta` | [shared.HTTPMetadata](../../../pkg/models/shared/httpmetadata.md) | :heavy_check_mark: | N/A | +| `Attachment` | [*shared.Attachment](../../../pkg/models/shared/attachment.md) | :heavy_minus_sign: | Created | \ No newline at end of file diff --git a/sync-for-payables/docs/sdks/bills/README.md b/sync-for-payables/docs/sdks/bills/README.md index bf175420..69796888 100644 --- a/sync-for-payables/docs/sdks/bills/README.md +++ b/sync-for-payables/docs/sdks/bills/README.md @@ -294,7 +294,7 @@ func main() { if err != nil { log.Fatal(err) } - if res != nil { + if res.Attachment != nil { // handle response } } @@ -354,7 +354,7 @@ func main() { if err != nil { log.Fatal(err) } - if res.Attachment != nil { + if res.Attachments != nil { // handle response } } diff --git a/sync-for-payables/pkg/models/operations/listbillattachments.go b/sync-for-payables/pkg/models/operations/listbillattachments.go index 3016c588..d247f9ab 100644 --- a/sync-for-payables/pkg/models/operations/listbillattachments.go +++ b/sync-for-payables/pkg/models/operations/listbillattachments.go @@ -39,7 +39,7 @@ func (o *ListBillAttachmentsRequest) GetBillID() string { type ListBillAttachmentsResponse struct { HTTPMeta shared.HTTPMetadata `json:"-"` // Success - Attachment *shared.Attachment + Attachments []shared.Attachment } func (o *ListBillAttachmentsResponse) GetHTTPMeta() shared.HTTPMetadata { @@ -49,9 +49,9 @@ func (o *ListBillAttachmentsResponse) GetHTTPMeta() shared.HTTPMetadata { return o.HTTPMeta } -func (o *ListBillAttachmentsResponse) GetAttachment() *shared.Attachment { +func (o *ListBillAttachmentsResponse) GetAttachments() []shared.Attachment { if o == nil { return nil } - return o.Attachment + return o.Attachments } diff --git a/sync-for-payables/pkg/models/operations/uploadbillattachment.go b/sync-for-payables/pkg/models/operations/uploadbillattachment.go index 0e238cc7..e147f9d2 100644 --- a/sync-for-payables/pkg/models/operations/uploadbillattachment.go +++ b/sync-for-payables/pkg/models/operations/uploadbillattachment.go @@ -46,6 +46,8 @@ func (o *UploadBillAttachmentRequest) GetAttachmentUpload() *shared.AttachmentUp type UploadBillAttachmentResponse struct { HTTPMeta shared.HTTPMetadata `json:"-"` + // Created + Attachment *shared.Attachment } func (o *UploadBillAttachmentResponse) GetHTTPMeta() shared.HTTPMetadata { @@ -54,3 +56,10 @@ func (o *UploadBillAttachmentResponse) GetHTTPMeta() shared.HTTPMetadata { } return o.HTTPMeta } + +func (o *UploadBillAttachmentResponse) GetAttachment() *shared.Attachment { + if o == nil { + return nil + } + return o.Attachment +}