Skip to content

Commit 8dfe641

Browse files
committed
Release v0.0.27
1 parent fa7b089 commit 8dfe641

File tree

3 files changed

+104
-1
lines changed

3 files changed

+104
-1
lines changed

.mock/definition/readme.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ types:
6767
java: JavaInfo
6868
ruby: RubyInfo
6969
csharp: CsharpInfo
70+
php: PhpInfo
7071
docs: >
7172
The language and its associated publish information (if any).
7273
@@ -92,6 +93,12 @@ types:
9293
CsharpInfo:
9394
properties:
9495
publishInfo: optional<NugetPublishInfo>
96+
PhpInfo:
97+
properties:
98+
publishInfo: optional<ComposerPublishInfo>
99+
ComposerPublishInfo:
100+
properties:
101+
packageName: string
95102
NpmPublishInfo:
96103
properties:
97104
packageName: string

core/request_option.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func (r *RequestOptions) cloneHeader() http.Header {
4444
headers := r.HTTPHeader.Clone()
4545
headers.Set("X-Fern-Language", "Go")
4646
headers.Set("X-Fern-SDK-Name", "github.com/fern-api/generator-cli-go")
47-
headers.Set("X-Fern-SDK-Version", "v0.0.26")
47+
headers.Set("X-Fern-SDK-Version", "v0.0.27")
4848
return headers
4949
}
5050

types.go

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,47 @@ func (g *GitHubConfig) String() string {
240240
return fmt.Sprintf("%#v", g)
241241
}
242242

243+
type ComposerPublishInfo struct {
244+
PackageName string `json:"packageName" url:"packageName"`
245+
246+
extraProperties map[string]interface{}
247+
_rawJSON json.RawMessage
248+
}
249+
250+
func (c *ComposerPublishInfo) GetExtraProperties() map[string]interface{} {
251+
return c.extraProperties
252+
}
253+
254+
func (c *ComposerPublishInfo) UnmarshalJSON(data []byte) error {
255+
type unmarshaler ComposerPublishInfo
256+
var value unmarshaler
257+
if err := json.Unmarshal(data, &value); err != nil {
258+
return err
259+
}
260+
*c = ComposerPublishInfo(value)
261+
262+
extraProperties, err := core.ExtractExtraProperties(data, *c)
263+
if err != nil {
264+
return err
265+
}
266+
c.extraProperties = extraProperties
267+
268+
c._rawJSON = json.RawMessage(data)
269+
return nil
270+
}
271+
272+
func (c *ComposerPublishInfo) String() string {
273+
if len(c._rawJSON) > 0 {
274+
if value, err := core.StringifyJSON(c._rawJSON); err == nil {
275+
return value
276+
}
277+
}
278+
if value, err := core.StringifyJSON(c); err == nil {
279+
return value
280+
}
281+
return fmt.Sprintf("%#v", c)
282+
}
283+
243284
type CsharpInfo struct {
244285
PublishInfo *NugetPublishInfo `json:"publishInfo,omitempty" url:"publishInfo,omitempty"`
245286

@@ -461,6 +502,7 @@ type LanguageInfo struct {
461502
Java *JavaInfo
462503
Ruby *RubyInfo
463504
Csharp *CsharpInfo
505+
Php *PhpInfo
464506
}
465507

466508
func (l *LanguageInfo) UnmarshalJSON(data []byte) error {
@@ -508,6 +550,12 @@ func (l *LanguageInfo) UnmarshalJSON(data []byte) error {
508550
return err
509551
}
510552
l.Csharp = value
553+
case "php":
554+
value := new(PhpInfo)
555+
if err := json.Unmarshal(data, &value); err != nil {
556+
return err
557+
}
558+
l.Php = value
511559
}
512560
return nil
513561
}
@@ -531,6 +579,9 @@ func (l LanguageInfo) MarshalJSON() ([]byte, error) {
531579
if l.Csharp != nil {
532580
return core.MarshalJSONWithExtraProperty(l.Csharp, "type", "csharp")
533581
}
582+
if l.Php != nil {
583+
return core.MarshalJSONWithExtraProperty(l.Php, "type", "php")
584+
}
534585
return nil, fmt.Errorf("type %T does not define a non-empty union type", l)
535586
}
536587

@@ -541,6 +592,7 @@ type LanguageInfoVisitor interface {
541592
VisitJava(*JavaInfo) error
542593
VisitRuby(*RubyInfo) error
543594
VisitCsharp(*CsharpInfo) error
595+
VisitPhp(*PhpInfo) error
544596
}
545597

546598
func (l *LanguageInfo) Accept(visitor LanguageInfoVisitor) error {
@@ -562,6 +614,9 @@ func (l *LanguageInfo) Accept(visitor LanguageInfoVisitor) error {
562614
if l.Csharp != nil {
563615
return visitor.VisitCsharp(l.Csharp)
564616
}
617+
if l.Php != nil {
618+
return visitor.VisitPhp(l.Php)
619+
}
565620
return fmt.Errorf("type %T does not define a non-empty union type", l)
566621
}
567622

@@ -690,6 +745,47 @@ func (n *NugetPublishInfo) String() string {
690745
return fmt.Sprintf("%#v", n)
691746
}
692747

748+
type PhpInfo struct {
749+
PublishInfo *ComposerPublishInfo `json:"publishInfo,omitempty" url:"publishInfo,omitempty"`
750+
751+
extraProperties map[string]interface{}
752+
_rawJSON json.RawMessage
753+
}
754+
755+
func (p *PhpInfo) GetExtraProperties() map[string]interface{} {
756+
return p.extraProperties
757+
}
758+
759+
func (p *PhpInfo) UnmarshalJSON(data []byte) error {
760+
type unmarshaler PhpInfo
761+
var value unmarshaler
762+
if err := json.Unmarshal(data, &value); err != nil {
763+
return err
764+
}
765+
*p = PhpInfo(value)
766+
767+
extraProperties, err := core.ExtractExtraProperties(data, *p)
768+
if err != nil {
769+
return err
770+
}
771+
p.extraProperties = extraProperties
772+
773+
p._rawJSON = json.RawMessage(data)
774+
return nil
775+
}
776+
777+
func (p *PhpInfo) String() string {
778+
if len(p._rawJSON) > 0 {
779+
if value, err := core.StringifyJSON(p._rawJSON); err == nil {
780+
return value
781+
}
782+
}
783+
if value, err := core.StringifyJSON(p); err == nil {
784+
return value
785+
}
786+
return fmt.Sprintf("%#v", p)
787+
}
788+
693789
type PypiPublishInfo struct {
694790
PackageName string `json:"packageName" url:"packageName"`
695791

0 commit comments

Comments
 (0)