Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/speakeasy-sdks/optional-v1-go
A go SDK for accessing the optional-v1-go API.
https://github.com/speakeasy-sdks/optional-v1-go
Last synced: 2 days ago
JSON representation
A go SDK for accessing the optional-v1-go API.
- Host: GitHub
- URL: https://github.com/speakeasy-sdks/optional-v1-go
- Owner: speakeasy-sdks
- License: mit
- Created: 2023-08-24T10:32:50.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-02T21:44:41.000Z (7 months ago)
- Last Synced: 2024-06-21T08:19:34.923Z (5 months ago)
- Language: Go
- Size: 77.1 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# github.com/speakeasy-sdks/optional-v1-go
## SDK Installation
```bash
go get github.com/speakeasy-sdks/optional-v1-go
```## SDK Example Usage
```go
package mainimport (
"context"
optionalv1go "github.com/speakeasy-sdks/optional-v1-go"
"github.com/speakeasy-sdks/optional-v1-go/pkg/models/operations"
"github.com/speakeasy-sdks/optional-v1-go/pkg/models/shared"
"log"
)func main() {
s := optionalv1go.New()ctx := context.Background()
res, err := s.Body.SendChild(ctx, operations.SendChildRequest{
ChildClass: shared.ChildClass{
ChildClassArray: []shared.ChildClass{
shared.ChildClass{},
},
GrandParentRequired: "string",
GrandParentRequiredNullable: "string",
ParentRequired: "string",
ParentRequiredNullable: "string",
Required: "string",
RequiredNullable: "string",
},
Field: "string",
SetToNull: false,
UnSet: false,
})
if err != nil {
log.Fatal(err)
}if res.ServerResponse != nil {
// handle response
}
}```
## Available Resources and Operations
### [Body](docs/sdks/body/README.md)
* [SendChild](docs/sdks/body/README.md#sendchild) - sendChild
### [RfcDate](docs/sdks/rfcdate/README.md)
* [SendRfc1123Date](docs/sdks/rfcdate/README.md#sendrfc1123date) - sendRfc1123Date
* [SendRfc1123DateArray](docs/sdks/rfcdate/README.md#sendrfc1123datearray) - sendRfc1123DateArray
* [SendRfc1123DateMap](docs/sdks/rfcdate/README.md#sendrfc1123datemap) - sendRfc1123DateMap### [SimpleDate](docs/sdks/simpledate/README.md)
* [SendSimpleDate](docs/sdks/simpledate/README.md#sendsimpledate) - sendSimpleDate
* [SendSimpleDateArray](docs/sdks/simpledate/README.md#sendsimpledatearray) - sendSimpleDateArray### [UnixDate](docs/sdks/unixdate/README.md)
* [SendUnixDate](docs/sdks/unixdate/README.md#sendunixdate) - sendUnixDate
* [SendUnixDateArray](docs/sdks/unixdate/README.md#sendunixdatearray) - sendUnixDateArray
* [SendUnixDateMap](docs/sdks/unixdate/README.md#sendunixdatemap) - sendUnixDateMap# Pagination
Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the
returned response object will have a `Next` method that can be called to pull down the next group of results. If the
return value of `Next` is `nil`, then there are no more pages to be fetched.Here's an example of one such pagination call:
# Special Types
This SDK defines the following custom types to assist with marshalling and unmarshalling data.
## Date
`types.Date` is a wrapper around time.Time that allows for JSON marshaling a date string formatted as "2006-01-02".
### Usage
```go
d1 := types.NewDate(time.Now()) // returns *types.Dated2 := types.DateFromTime(time.Now()) // returns types.Date
d3, err := types.NewDateFromString("2019-01-01") // returns *types.Date, error
d4, err := types.DateFromString("2019-01-01") // returns types.Date, error
d5 := types.MustNewDateFromString("2019-01-01") // returns *types.Date and panics on error
d6 := types.MustDateFromString("2019-01-01") // returns types.Date and panics on error
```### Maturity
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
looking for the latest version.### Contributions
While we value open-source contributions to this SDK, this library is generated programmatically.
Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!### SDK Created by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)