Skip to content

Commit

Permalink
Merge pull request #416 from codatio/speakeasy-sdk-regen-1697551831
Browse files Browse the repository at this point in the history
chore: speakeasy sdk regeneration - Generate Sync for Expenses version 1 library
  • Loading branch information
dcoplowe authored Oct 17, 2023
2 parents a4c4b2b + 6295a91 commit f6abd5a
Show file tree
Hide file tree
Showing 150 changed files with 2,004 additions and 1,212 deletions.
2 changes: 1 addition & 1 deletion previous-versions/sync-for-expenses-version-1/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@

# .gitignore
73 changes: 45 additions & 28 deletions previous-versions/sync-for-expenses-version-1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,37 @@ go get github.com/codatio/client-sdk-go/previous-versions/sync-for-expenses-vers

## Example Usage
<!-- Start SDK Example Usage -->


```go
package main

import(
import (
"context"
"log"
"github.com/codatio/client-sdk-go/previous-versions/sync-for-expenses-version-1"
syncforexpensesversion1 "github.com/codatio/client-sdk-go/previous-versions/sync-for-expenses-version-1"
"github.com/codatio/client-sdk-go/previous-versions/sync-for-expenses-version-1/pkg/models/shared"
"log"
)

func main() {
s := codatsyncexpenses.New(
codatsyncexpenses.WithSecurity(shared.Security{
AuthHeader: "Basic BASE_64_ENCODED(API_KEY)",
}),
)

ctx := context.Background()
res, err := s.Companies.CreateCompany(ctx, shared.CompanyRequestBody{
Description: codatsyncexpenses.String("Requested early access to the new financing scheme."),
Name: "Bank of Dave",
})
if err != nil {
log.Fatal(err)
}

if res.Company != nil {
// handle response
}
s := syncforexpensesversion1.New(
syncforexpensesversion1.WithSecurity(shared.Security{
AuthHeader: "Basic BASE_64_ENCODED(API_KEY)",
}),
)

ctx := context.Background()
res, err := s.Companies.CreateCompany(ctx, &shared.CompanyRequestBody{
Description: syncforexpensesversion1.String("Requested early access to the new financing scheme."),
Name: "Bank of Dave",
})
if err != nil {
log.Fatal(err)
}

if res.Company != nil {
// handle response
}
}

```
<!-- End SDK Example Usage -->

Expand All @@ -69,7 +68,7 @@ func main() {
### [Connections](docs/sdks/connections/README.md)

* [CreateConnection](docs/sdks/connections/README.md#createconnection) - Create connection
* [CreatePartnerExpenseConnection](docs/sdks/connections/README.md#createpartnerexpenseconnection) - Create Partner Expense connection
* [CreatePartnerExpenseConnection](docs/sdks/connections/README.md#createpartnerexpenseconnection) - Create partner expense connection
* [DeleteConnection](docs/sdks/connections/README.md#deleteconnection) - Delete connection
* [GetConnection](docs/sdks/connections/README.md#getconnection) - Get connection
* [ListConnections](docs/sdks/connections/README.md#listconnections) - List connections
Expand All @@ -78,7 +77,7 @@ func main() {
### [Expenses](docs/sdks/expenses/README.md)

* [CreateExpenseDataset](docs/sdks/expenses/README.md#createexpensedataset) - Create expense-transactions
* [UpdateExpenseDataset](docs/sdks/expenses/README.md#updateexpensedataset) - Update expense-transactions
* [UpdateExpenseDataset](docs/sdks/expenses/README.md#updateexpensedataset) - Update expense transactions
* [UploadAttachment](docs/sdks/expenses/README.md#uploadattachment) - Upload attachment

### [MappingOptions](docs/sdks/mappingoptions/README.md)
Expand All @@ -93,12 +92,30 @@ func main() {

* [GetLastSuccessfulSync](docs/sdks/syncstatus/README.md#getlastsuccessfulsync) - Last successful sync
* [GetLatestSync](docs/sdks/syncstatus/README.md#getlatestsync) - Latest sync status
* [GetSyncByID](docs/sdks/syncstatus/README.md#getsyncbyid) - Get Sync status
* [GetSyncByID](docs/sdks/syncstatus/README.md#getsyncbyid) - Get sync status
* [ListSyncs](docs/sdks/syncstatus/README.md#listsyncs) - List sync statuses

### [TransactionStatus](docs/sdks/transactionstatus/README.md)

* [GetSyncTransaction](docs/sdks/transactionstatus/README.md#getsynctransaction) - Get Sync Transaction
* [ListSyncTransactions](docs/sdks/transactionstatus/README.md#listsynctransactions) - Get Sync transactions
* [GetSyncTransaction](docs/sdks/transactionstatus/README.md#getsynctransaction) - Get sync transaction
* [ListSyncTransactions](docs/sdks/transactionstatus/README.md#listsynctransactions) - Get sync transactions
<!-- End SDK Available Operations -->



<!-- Start Dev Containers -->



<!-- End Dev Containers -->



<!-- Start Go Types -->

<!-- End Go Types -->

<!-- Placeholder for Future Speakeasy SDK Sections -->


### Library generated by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)
12 changes: 11 additions & 1 deletion previous-versions/sync-for-expenses-version-1/RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,14 @@ Based on:
### Generated
- [go v0.24.0] previous-versions/sync-for-expenses-version-1
### Releases
- [Go v0.24.0] https://github.com/codatio/client-sdk-go/releases/tag/previous-versions/sync-for-expenses-version-1/v0.24.0 - previous-versions/sync-for-expenses-version-1
- [Go v0.24.0] https://github.com/codatio/client-sdk-go/releases/tag/previous-versions/sync-for-expenses-version-1/v0.24.0 - previous-versions/sync-for-expenses-version-1

## 2023-10-17 14:10:26
### Changes
Based on:
- OpenAPI Doc prealpha https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Expenses-v1.yaml
- Speakeasy CLI 1.100.2 (2.159.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.25.0] previous-versions/sync-for-expenses-version-1
### Releases
- [Go v0.25.0] https://github.com/codatio/client-sdk-go/releases/tag/previous-versions/sync-for-expenses-version-1/v0.25.0 - previous-versions/sync-for-expenses-version-1
39 changes: 20 additions & 19 deletions previous-versions/sync-for-expenses-version-1/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,33 @@
```go
package main

import(
import (
"context"
"log"
"github.com/codatio/client-sdk-go/previous-versions/sync-for-expenses-version-1"
syncforexpensesversion1 "github.com/codatio/client-sdk-go/previous-versions/sync-for-expenses-version-1"
"github.com/codatio/client-sdk-go/previous-versions/sync-for-expenses-version-1/pkg/models/shared"
"log"
)

func main() {
s := codatsyncexpenses.New(
codatsyncexpenses.WithSecurity(shared.Security{
AuthHeader: "Basic BASE_64_ENCODED(API_KEY)",
}),
)
s := syncforexpensesversion1.New(
syncforexpensesversion1.WithSecurity(shared.Security{
AuthHeader: "Basic BASE_64_ENCODED(API_KEY)",
}),
)

ctx := context.Background()
res, err := s.Companies.CreateCompany(ctx, shared.CompanyRequestBody{
Description: codatsyncexpenses.String("Requested early access to the new financing scheme."),
Name: "Bank of Dave",
})
if err != nil {
log.Fatal(err)
}
ctx := context.Background()
res, err := s.Companies.CreateCompany(ctx, &shared.CompanyRequestBody{
Description: syncforexpensesversion1.String("Requested early access to the new financing scheme."),
Name: "Bank of Dave",
})
if err != nil {
log.Fatal(err)
}

if res.Company != nil {
// handle response
}
if res.Company != nil {
// handle response
}
}

```
<!-- End SDK Example Usage -->
29 changes: 24 additions & 5 deletions previous-versions/sync-for-expenses-version-1/codatsyncexpenses.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.

package codatsyncexpenses
package syncforexpensesversion1

import (
"context"
"fmt"
"github.com/codatio/client-sdk-go/previous-versions/sync-for-expenses-version-1/pkg/models/shared"
"github.com/codatio/client-sdk-go/previous-versions/sync-for-expenses-version-1/pkg/utils"
Expand Down Expand Up @@ -41,13 +42,14 @@ func Float64(f float64) *float64 { return &f }
type sdkConfiguration struct {
DefaultClient HTTPClient
SecurityClient HTTPClient
Security *shared.Security
Security func(context.Context) (interface{}, error)
ServerURL string
ServerIndex int
Language string
OpenAPIDocVersion string
SDKVersion string
GenVersion string
UserAgent string
RetryConfig *utils.RetryConfig
}

Expand Down Expand Up @@ -129,10 +131,26 @@ func WithClient(client HTTPClient) SDKOption {
}
}

func withSecurity(security interface{}) func(context.Context) (interface{}, error) {
return func(context.Context) (interface{}, error) {
return &security, nil
}
}

// WithSecurity configures the SDK to use the provided security details

func WithSecurity(security shared.Security) SDKOption {
return func(sdk *CodatSyncExpenses) {
sdk.sdkConfiguration.Security = &security
sdk.sdkConfiguration.Security = withSecurity(security)
}
}

// WithSecuritySource configures the SDK to invoke the Security Source function on each method call to determine authentication
func WithSecuritySource(security func(context.Context) (shared.Security, error)) SDKOption {
return func(sdk *CodatSyncExpenses) {
sdk.sdkConfiguration.Security = func(ctx context.Context) (interface{}, error) {
return security(ctx)
}
}
}

Expand All @@ -148,8 +166,9 @@ func New(opts ...SDKOption) *CodatSyncExpenses {
sdkConfiguration: sdkConfiguration{
Language: "go",
OpenAPIDocVersion: "prealpha",
SDKVersion: "0.24.0",
GenVersion: "2.109.1",
SDKVersion: "0.25.0",
GenVersion: "2.159.2",
UserAgent: "speakeasy-sdk/go 0.25.0 2.159.2 prealpha github.com/codatio/client-sdk-go/previous-versions/sync-for-expenses-version-1",
},
}
for _, opt := range opts {
Expand Down
Loading

0 comments on commit f6abd5a

Please sign in to comment.