Skip to content

Commit dcf33cb

Browse files
Release v0.0.1165
1 parent 45f2351 commit dcf33cb

File tree

2 files changed

+140
-4
lines changed

2 files changed

+140
-4
lines changed

core/client_option.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ func (c *ClientOptions) cloneHeader() http.Header {
3636
headers := c.HTTPHeader.Clone()
3737
headers.Set("X-Fern-Language", "Go")
3838
headers.Set("X-Fern-SDK-Name", "github.com/fern-api/generator-exec-go")
39-
headers.Set("X-Fern-SDK-Version", "v0.0.1163")
39+
headers.Set("X-Fern-SDK-Version", "v0.0.1165")
4040
return headers
4141
}

types.go

Lines changed: 139 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,19 @@ type BasicLicense struct {
207207
Id LicenseId `json:"id,omitempty"`
208208
}
209209

210+
type CratesGithubPublishInfo struct {
211+
RegistryUrl string `json:"registryUrl"`
212+
PackageName string `json:"packageName"`
213+
TokenEnvironmentVariable EnvironmentVariable `json:"tokenEnvironmentVariable"`
214+
ShouldGeneratePublishWorkflow *bool `json:"shouldGeneratePublishWorkflow,omitempty"`
215+
}
216+
217+
type CratesRegistryConfig struct {
218+
RegistryUrl string `json:"registryUrl"`
219+
Token string `json:"token"`
220+
PackageName string `json:"packageName"`
221+
}
222+
210223
type CustomLicense struct {
211224
Filename string `json:"filename"`
212225
}
@@ -336,6 +349,7 @@ type GeneratorPublishTarget struct {
336349
Postman *PostmanConfig
337350
Rubygems *RubyGemsRegistryConfig
338351
Nuget *NugetRegistryConfig
352+
Crates *CratesRegistryConfig
339353
}
340354

341355
func NewGeneratorPublishTargetFromMaven(value *MavenRegistryConfigV2) *GeneratorPublishTarget {
@@ -362,6 +376,10 @@ func NewGeneratorPublishTargetFromNuget(value *NugetRegistryConfig) *GeneratorPu
362376
return &GeneratorPublishTarget{Type: "nuget", Nuget: value}
363377
}
364378

379+
func NewGeneratorPublishTargetFromCrates(value *CratesRegistryConfig) *GeneratorPublishTarget {
380+
return &GeneratorPublishTarget{Type: "crates", Crates: value}
381+
}
382+
365383
func (g *GeneratorPublishTarget) UnmarshalJSON(data []byte) error {
366384
var unmarshaler struct {
367385
Type string `json:"type"`
@@ -407,6 +425,12 @@ func (g *GeneratorPublishTarget) UnmarshalJSON(data []byte) error {
407425
return err
408426
}
409427
g.Nuget = value
428+
case "crates":
429+
value := new(CratesRegistryConfig)
430+
if err := json.Unmarshal(data, &value); err != nil {
431+
return err
432+
}
433+
g.Crates = value
410434
}
411435
return nil
412436
}
@@ -469,6 +493,15 @@ func (g GeneratorPublishTarget) MarshalJSON() ([]byte, error) {
469493
NugetRegistryConfig: g.Nuget,
470494
}
471495
return json.Marshal(marshaler)
496+
case "crates":
497+
var marshaler = struct {
498+
Type string `json:"type"`
499+
*CratesRegistryConfig
500+
}{
501+
Type: g.Type,
502+
CratesRegistryConfig: g.Crates,
503+
}
504+
return json.Marshal(marshaler)
472505
}
473506
}
474507

@@ -479,6 +512,7 @@ type GeneratorPublishTargetVisitor interface {
479512
VisitPostman(*PostmanConfig) error
480513
VisitRubygems(*RubyGemsRegistryConfig) error
481514
VisitNuget(*NugetRegistryConfig) error
515+
VisitCrates(*CratesRegistryConfig) error
482516
}
483517

484518
func (g *GeneratorPublishTarget) Accept(visitor GeneratorPublishTargetVisitor) error {
@@ -497,6 +531,8 @@ func (g *GeneratorPublishTarget) Accept(visitor GeneratorPublishTargetVisitor) e
497531
return visitor.VisitRubygems(g.Rubygems)
498532
case "nuget":
499533
return visitor.VisitNuget(g.Nuget)
534+
case "crates":
535+
return visitor.VisitCrates(g.Crates)
500536
}
501537
}
502538

@@ -511,6 +547,7 @@ type GeneratorRegistriesConfigV2 struct {
511547
Pypi *PypiRegistryConfig `json:"pypi,omitempty"`
512548
Rubygems *RubyGemsRegistryConfig `json:"rubygems,omitempty"`
513549
Nuget *NugetRegistryConfig `json:"nuget,omitempty"`
550+
Crates *CratesRegistryConfig `json:"crates,omitempty"`
514551
}
515552

516553
type GithubOutputMode struct {
@@ -531,6 +568,7 @@ type GithubPublishInfo struct {
531568
Pypi *PypiGithubPublishInfo
532569
Rubygems *RubyGemsGithubPublishInfo
533570
Nuget *NugetGithubPublishInfo
571+
Crates *CratesGithubPublishInfo
534572
}
535573

536574
func NewGithubPublishInfoFromNpm(value *NpmGithubPublishInfo) *GithubPublishInfo {
@@ -557,6 +595,10 @@ func NewGithubPublishInfoFromNuget(value *NugetGithubPublishInfo) *GithubPublish
557595
return &GithubPublishInfo{Type: "nuget", Nuget: value}
558596
}
559597

598+
func NewGithubPublishInfoFromCrates(value *CratesGithubPublishInfo) *GithubPublishInfo {
599+
return &GithubPublishInfo{Type: "crates", Crates: value}
600+
}
601+
560602
func (g *GithubPublishInfo) UnmarshalJSON(data []byte) error {
561603
var unmarshaler struct {
562604
Type string `json:"type"`
@@ -602,6 +644,12 @@ func (g *GithubPublishInfo) UnmarshalJSON(data []byte) error {
602644
return err
603645
}
604646
g.Nuget = value
647+
case "crates":
648+
value := new(CratesGithubPublishInfo)
649+
if err := json.Unmarshal(data, &value); err != nil {
650+
return err
651+
}
652+
g.Crates = value
605653
}
606654
return nil
607655
}
@@ -664,6 +712,15 @@ func (g GithubPublishInfo) MarshalJSON() ([]byte, error) {
664712
NugetGithubPublishInfo: g.Nuget,
665713
}
666714
return json.Marshal(marshaler)
715+
case "crates":
716+
var marshaler = struct {
717+
Type string `json:"type"`
718+
*CratesGithubPublishInfo
719+
}{
720+
Type: g.Type,
721+
CratesGithubPublishInfo: g.Crates,
722+
}
723+
return json.Marshal(marshaler)
667724
}
668725
}
669726

@@ -674,6 +731,7 @@ type GithubPublishInfoVisitor interface {
674731
VisitPypi(*PypiGithubPublishInfo) error
675732
VisitRubygems(*RubyGemsGithubPublishInfo) error
676733
VisitNuget(*NugetGithubPublishInfo) error
734+
VisitCrates(*CratesGithubPublishInfo) error
677735
}
678736

679737
func (g *GithubPublishInfo) Accept(visitor GithubPublishInfoVisitor) error {
@@ -692,6 +750,8 @@ func (g *GithubPublishInfo) Accept(visitor GithubPublishInfoVisitor) error {
692750
return visitor.VisitRubygems(g.Rubygems)
693751
case "nuget":
694752
return visitor.VisitNuget(g.Nuget)
753+
case "crates":
754+
return visitor.VisitCrates(g.Crates)
695755
}
696756
}
697757

@@ -1057,6 +1117,11 @@ type RubyGemsRegistryConfig struct {
10571117
PackageName string `json:"packageName"`
10581118
}
10591119

1120+
type CratesCoordinate struct {
1121+
Name string `json:"name"`
1122+
Version string `json:"version"`
1123+
}
1124+
10601125
type ErrorExitStatusUpdate struct {
10611126
Message string `json:"message"`
10621127
}
@@ -1216,9 +1281,10 @@ type NpmCoordinate struct {
12161281
}
12171282

12181283
type PackageCoordinate struct {
1219-
Type string
1220-
Npm *NpmCoordinate
1221-
Maven *MavenCoordinate
1284+
Type string
1285+
Npm *NpmCoordinate
1286+
Maven *MavenCoordinate
1287+
Crates *CratesCoordinate
12221288
}
12231289

12241290
func NewPackageCoordinateFromNpm(value *NpmCoordinate) *PackageCoordinate {
@@ -1229,6 +1295,10 @@ func NewPackageCoordinateFromMaven(value *MavenCoordinate) *PackageCoordinate {
12291295
return &PackageCoordinate{Type: "maven", Maven: value}
12301296
}
12311297

1298+
func NewPackageCoordinateFromCrates(value *CratesCoordinate) *PackageCoordinate {
1299+
return &PackageCoordinate{Type: "crates", Crates: value}
1300+
}
1301+
12321302
func (p *PackageCoordinate) UnmarshalJSON(data []byte) error {
12331303
var unmarshaler struct {
12341304
Type string `json:"_type"`
@@ -1250,6 +1320,12 @@ func (p *PackageCoordinate) UnmarshalJSON(data []byte) error {
12501320
return err
12511321
}
12521322
p.Maven = value
1323+
case "crates":
1324+
value := new(CratesCoordinate)
1325+
if err := json.Unmarshal(data, &value); err != nil {
1326+
return err
1327+
}
1328+
p.Crates = value
12531329
}
12541330
return nil
12551331
}
@@ -1276,12 +1352,22 @@ func (p PackageCoordinate) MarshalJSON() ([]byte, error) {
12761352
MavenCoordinate: p.Maven,
12771353
}
12781354
return json.Marshal(marshaler)
1355+
case "crates":
1356+
var marshaler = struct {
1357+
Type string `json:"_type"`
1358+
*CratesCoordinate
1359+
}{
1360+
Type: p.Type,
1361+
CratesCoordinate: p.Crates,
1362+
}
1363+
return json.Marshal(marshaler)
12791364
}
12801365
}
12811366

12821367
type PackageCoordinateVisitor interface {
12831368
VisitNpm(*NpmCoordinate) error
12841369
VisitMaven(*MavenCoordinate) error
1370+
VisitCrates(*CratesCoordinate) error
12851371
}
12861372

12871373
func (p *PackageCoordinate) Accept(visitor PackageCoordinateVisitor) error {
@@ -1292,6 +1378,8 @@ func (p *PackageCoordinate) Accept(visitor PackageCoordinateVisitor) error {
12921378
return visitor.VisitNpm(p.Npm)
12931379
case "maven":
12941380
return visitor.VisitMaven(p.Maven)
1381+
case "crates":
1382+
return visitor.VisitCrates(p.Crates)
12951383
}
12961384
}
12971385

@@ -1303,6 +1391,7 @@ const (
13031391
RegistryTypePypi
13041392
RegistryTypeRubygems
13051393
RegistryTypeNuget
1394+
RegistryTypeCrates
13061395
)
13071396

13081397
func (r RegistryType) String() string {
@@ -1319,6 +1408,8 @@ func (r RegistryType) String() string {
13191408
return "RUBYGEMS"
13201409
case RegistryTypeNuget:
13211410
return "NUGET"
1411+
case RegistryTypeCrates:
1412+
return "CRATES"
13221413
}
13231414
}
13241415

@@ -1347,6 +1438,9 @@ func (r *RegistryType) UnmarshalJSON(data []byte) error {
13471438
case "NUGET":
13481439
value := RegistryTypeNuget
13491440
*r = value
1441+
case "CRATES":
1442+
value := RegistryTypeCrates
1443+
*r = value
13501444
}
13511445
return nil
13521446
}
@@ -1366,6 +1460,7 @@ const (
13661460
BadgeTypeGo
13671461
BadgeTypeRubygems
13681462
BadgeTypeNuget
1463+
BadgeTypeCrates
13691464
)
13701465

13711466
func (b BadgeType) String() string {
@@ -1384,6 +1479,8 @@ func (b BadgeType) String() string {
13841479
return "RUBYGEMS"
13851480
case BadgeTypeNuget:
13861481
return "NUGET"
1482+
case BadgeTypeCrates:
1483+
return "CRATES"
13871484
}
13881485
}
13891486

@@ -1415,6 +1512,9 @@ func (b *BadgeType) UnmarshalJSON(data []byte) error {
14151512
case "NUGET":
14161513
value := BadgeTypeNuget
14171514
*b = value
1515+
case "CRATES":
1516+
value := BadgeTypeCrates
1517+
*b = value
14181518
}
14191519
return nil
14201520
}
@@ -1523,6 +1623,7 @@ type EndpointSnippet struct {
15231623
Go *GoEndpointSnippet
15241624
Ruby *RubyEndpointSnippet
15251625
Csharp *CsharpEndpointSnippet
1626+
Rust *RustEndpointSnippet
15261627
}
15271628

15281629
func NewEndpointSnippetFromTypescript(value *TypescriptEndpointSnippet) *EndpointSnippet {
@@ -1549,6 +1650,10 @@ func NewEndpointSnippetFromCsharp(value *CsharpEndpointSnippet) *EndpointSnippet
15491650
return &EndpointSnippet{Type: "csharp", Csharp: value}
15501651
}
15511652

1653+
func NewEndpointSnippetFromRust(value *RustEndpointSnippet) *EndpointSnippet {
1654+
return &EndpointSnippet{Type: "rust", Rust: value}
1655+
}
1656+
15521657
func (e *EndpointSnippet) UnmarshalJSON(data []byte) error {
15531658
var unmarshaler struct {
15541659
Type string `json:"type"`
@@ -1594,6 +1699,12 @@ func (e *EndpointSnippet) UnmarshalJSON(data []byte) error {
15941699
return err
15951700
}
15961701
e.Csharp = value
1702+
case "rust":
1703+
value := new(RustEndpointSnippet)
1704+
if err := json.Unmarshal(data, &value); err != nil {
1705+
return err
1706+
}
1707+
e.Rust = value
15971708
}
15981709
return nil
15991710
}
@@ -1656,6 +1767,15 @@ func (e EndpointSnippet) MarshalJSON() ([]byte, error) {
16561767
CsharpEndpointSnippet: e.Csharp,
16571768
}
16581769
return json.Marshal(marshaler)
1770+
case "rust":
1771+
var marshaler = struct {
1772+
Type string `json:"type"`
1773+
*RustEndpointSnippet
1774+
}{
1775+
Type: e.Type,
1776+
RustEndpointSnippet: e.Rust,
1777+
}
1778+
return json.Marshal(marshaler)
16591779
}
16601780
}
16611781

@@ -1666,6 +1786,7 @@ type EndpointSnippetVisitor interface {
16661786
VisitGo(*GoEndpointSnippet) error
16671787
VisitRuby(*RubyEndpointSnippet) error
16681788
VisitCsharp(*CsharpEndpointSnippet) error
1789+
VisitRust(*RustEndpointSnippet) error
16691790
}
16701791

16711792
func (e *EndpointSnippet) Accept(visitor EndpointSnippetVisitor) error {
@@ -1684,6 +1805,8 @@ func (e *EndpointSnippet) Accept(visitor EndpointSnippetVisitor) error {
16841805
return visitor.VisitRuby(e.Ruby)
16851806
case "csharp":
16861807
return visitor.VisitCsharp(e.Csharp)
1808+
case "rust":
1809+
return visitor.VisitRust(e.Rust)
16871810
}
16881811
}
16891812

@@ -1784,6 +1907,19 @@ type RubyEndpointSnippet struct {
17841907
Client string `json:"client"`
17851908
}
17861909

1910+
type RustEndpointSnippet struct {
1911+
// A full endpoint snippet, including the client instantiation, e.g.
1912+
//
1913+
// use acme::{AcmeClient, RunningSubmissionState};
1914+
//
1915+
// let client = AcmeClient::new("YOUR_API_KEY");
1916+
// client.admin().update(
1917+
// "submission-12o3uds",
1918+
// RunningSubmissionState::QueueingSubmission,
1919+
// ).await?;
1920+
Client string `json:"client"`
1921+
}
1922+
17871923
// The code snippets defined in the API
17881924
type Snippets struct {
17891925
// The type snippets defined by by the API

0 commit comments

Comments
 (0)