Skip to content

Commit

Permalink
updates to go start_time in read changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanpq committed Nov 27, 2024
1 parent 6dba9f9 commit 0d52e1f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/clients/go/template/api_test.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ func Test{{appShortName}}Api(t *testing.T) {
got, response, err := apiClient.{{appShortName}}Api.ReadChanges(context.Background(), "01GXSB9YR785C4FYS3C0RTG7B2").
Type_("repo").
PageSize(25).
StartTime("2022-01-01T00:00:00Z").
StartTime(time.Parse(time.RFC3339, "2022-01-01T00:00:00Z")).
ContinuationToken("eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==").
Execute()
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions config/clients/go/template/client/client.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"math"
_nethttp "net/http"
"time"

fgaSdk "{{gitHost}}/{{gitUserId}}/{{gitRepoId}}"
"{{gitHost}}/{{gitUserId}}/{{gitRepoId}}/credentials"
Expand Down Expand Up @@ -1125,6 +1126,7 @@ type SdkClientReadChangesRequestInterface interface {

type ClientReadChangesRequest struct {
Type string `json:"type,omitempty"`
StartTime time.Time `json:"start_time,omitempty"`
}

type ClientReadChangesOptions struct {
Expand Down
4 changes: 3 additions & 1 deletion config/clients/go/template/client/client_test.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"net/http"
"testing"
"time"

"github.com/jarcoal/httpmock"
"{{gitHost}}/{{gitUserId}}/{{gitRepoId}}"
Expand Down Expand Up @@ -1040,8 +1041,9 @@ func Test{{appShortName}}Client(t *testing.T) {
)
body := ClientReadChangesRequest{
Type: "document",
StartTime: time.Parse(time.RFC3339,"2022-01-01T00:00:00Z"),
}
options := ClientReadChangesOptions{ContinuationToken: {{packageName}}.PtrString("eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ=="), StartTime: {{packageName}}.PtrString("2022-01-01T00:00:00Z"), PageSize: {{packageName}}.PtrInt32(25)}
options := ClientReadChangesOptions{ContinuationToken: {{packageName}}.PtrString("eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ=="), PageSize: {{packageName}}.PtrInt32(25)}
got, err := fgaClient.ReadChanges(context.Background()).Body(body).Options(options).Execute()
if err != nil {
t.Fatalf("%v", err)
Expand Down

0 comments on commit 0d52e1f

Please sign in to comment.