Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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 main

import (
"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.Date

d2 := 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)