Skip to content

Commit

Permalink
Release v0.0.723
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Apr 11, 2024
1 parent 5eeb814 commit 4053d5c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/client_option.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ func (c *ClientOptions) cloneHeader() http.Header {
headers := c.HTTPHeader.Clone()
headers.Set("X-Fern-Language", "Go")
headers.Set("X-Fern-SDK-Name", "github.com/fern-api/generator-exec-go")
headers.Set("X-Fern-SDK-Version", "v0.0.712")
headers.Set("X-Fern-SDK-Version", "v0.0.723")
return headers
}
38 changes: 38 additions & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1391,6 +1391,7 @@ type EndpointSnippet struct {
Python *PythonEndpointSnippet
Java *JavaEndpointSnippet
Go *GoEndpointSnippet
Ruby *RubyEndpointSnippet
}

func NewEndpointSnippetFromTypescript(value *TypescriptEndpointSnippet) *EndpointSnippet {
Expand All @@ -1409,6 +1410,10 @@ func NewEndpointSnippetFromGo(value *GoEndpointSnippet) *EndpointSnippet {
return &EndpointSnippet{Type: "go", Go: value}
}

func NewEndpointSnippetFromRuby(value *RubyEndpointSnippet) *EndpointSnippet {
return &EndpointSnippet{Type: "ruby", Ruby: value}
}

func (e *EndpointSnippet) UnmarshalJSON(data []byte) error {
var unmarshaler struct {
Type string `json:"type"`
Expand Down Expand Up @@ -1442,6 +1447,12 @@ func (e *EndpointSnippet) UnmarshalJSON(data []byte) error {
return err
}
e.Go = value
case "ruby":
value := new(RubyEndpointSnippet)
if err := json.Unmarshal(data, &value); err != nil {
return err
}
e.Ruby = value
}
return nil
}
Expand Down Expand Up @@ -1486,6 +1497,15 @@ func (e EndpointSnippet) MarshalJSON() ([]byte, error) {
GoEndpointSnippet: e.Go,
}
return json.Marshal(marshaler)
case "ruby":
var marshaler = struct {
Type string `json:"type"`
*RubyEndpointSnippet
}{
Type: e.Type,
RubyEndpointSnippet: e.Ruby,
}
return json.Marshal(marshaler)
}
}

Expand All @@ -1494,6 +1514,7 @@ type EndpointSnippetVisitor interface {
VisitPython(*PythonEndpointSnippet) error
VisitJava(*JavaEndpointSnippet) error
VisitGo(*GoEndpointSnippet) error
VisitRuby(*RubyEndpointSnippet) error
}

func (e *EndpointSnippet) Accept(visitor EndpointSnippetVisitor) error {
Expand All @@ -1508,6 +1529,8 @@ func (e *EndpointSnippet) Accept(visitor EndpointSnippetVisitor) error {
return visitor.VisitJava(e.Java)
case "go":
return visitor.VisitGo(e.Go)
case "ruby":
return visitor.VisitRuby(e.Ruby)
}
}

Expand Down Expand Up @@ -1593,6 +1616,21 @@ type PythonEndpointSnippet struct {
AsyncClient string `json:"async_client"`
}

type RubyEndpointSnippet struct {
// A full endpoint snippet, including the client instantiation, e.g.
//
// require "acme"
//
// acme = Acme::Client.new(
// apiKey: 'YOUR_API_KEY'
// )
// acme.admin.update(
// submission_id: "submission-12o3uds",
// request: Acme::RunningSubmissionState::QUEUEING_SUBMISSION
// )
Client string `json:"client"`
}

// The code snippets defined in the API
type Snippets struct {
// The type snippets defined by by the API
Expand Down

0 comments on commit 4053d5c

Please sign in to comment.