@@ -334,6 +334,7 @@ type GeneratorPublishTarget struct {
334334 Pypi * PypiRegistryConfig
335335 Postman * PostmanConfig
336336 Rubygems * RubyGemsRegistryConfig
337+ Nuget * NugetRegistryConfig
337338}
338339
339340func NewGeneratorPublishTargetFromMaven (value * MavenRegistryConfigV2 ) * GeneratorPublishTarget {
@@ -356,6 +357,10 @@ func NewGeneratorPublishTargetFromRubygems(value *RubyGemsRegistryConfig) *Gener
356357 return & GeneratorPublishTarget {Type : "rubygems" , Rubygems : value }
357358}
358359
360+ func NewGeneratorPublishTargetFromNuget (value * NugetRegistryConfig ) * GeneratorPublishTarget {
361+ return & GeneratorPublishTarget {Type : "nuget" , Nuget : value }
362+ }
363+
359364func (g * GeneratorPublishTarget ) UnmarshalJSON (data []byte ) error {
360365 var unmarshaler struct {
361366 Type string `json:"type"`
@@ -395,6 +400,12 @@ func (g *GeneratorPublishTarget) UnmarshalJSON(data []byte) error {
395400 return err
396401 }
397402 g .Rubygems = value
403+ case "nuget" :
404+ value := new (NugetRegistryConfig )
405+ if err := json .Unmarshal (data , & value ); err != nil {
406+ return err
407+ }
408+ g .Nuget = value
398409 }
399410 return nil
400411}
@@ -448,6 +459,15 @@ func (g GeneratorPublishTarget) MarshalJSON() ([]byte, error) {
448459 RubyGemsRegistryConfig : g .Rubygems ,
449460 }
450461 return json .Marshal (marshaler )
462+ case "nuget" :
463+ var marshaler = struct {
464+ Type string `json:"type"`
465+ * NugetRegistryConfig
466+ }{
467+ Type : g .Type ,
468+ NugetRegistryConfig : g .Nuget ,
469+ }
470+ return json .Marshal (marshaler )
451471 }
452472}
453473
@@ -457,6 +477,7 @@ type GeneratorPublishTargetVisitor interface {
457477 VisitPypi (* PypiRegistryConfig ) error
458478 VisitPostman (* PostmanConfig ) error
459479 VisitRubygems (* RubyGemsRegistryConfig ) error
480+ VisitNuget (* NugetRegistryConfig ) error
460481}
461482
462483func (g * GeneratorPublishTarget ) Accept (visitor GeneratorPublishTargetVisitor ) error {
@@ -473,6 +494,8 @@ func (g *GeneratorPublishTarget) Accept(visitor GeneratorPublishTargetVisitor) e
473494 return visitor .VisitPostman (g .Postman )
474495 case "rubygems" :
475496 return visitor .VisitRubygems (g .Rubygems )
497+ case "nuget" :
498+ return visitor .VisitNuget (g .Nuget )
476499 }
477500}
478501
@@ -486,6 +509,7 @@ type GeneratorRegistriesConfigV2 struct {
486509 Npm * NpmRegistryConfigV2 `json:"npm,omitempty"`
487510 Pypi * PypiRegistryConfig `json:"pypi,omitempty"`
488511 Rubygems * RubyGemsRegistryConfig `json:"rubygems,omitempty"`
512+ Nuget * NugetRegistryConfig `json:"nuget,omitempty"`
489513}
490514
491515type GithubOutputMode struct {
@@ -502,6 +526,7 @@ type GithubPublishInfo struct {
502526 Postman * PostmanGithubPublishInfo
503527 Pypi * PypiGithubPublishInfo
504528 Rubygems * RubyGemsGithubPublishInfo
529+ Nuget * NugetGithubPublishInfo
505530}
506531
507532func NewGithubPublishInfoFromNpm (value * NpmGithubPublishInfo ) * GithubPublishInfo {
@@ -524,6 +549,10 @@ func NewGithubPublishInfoFromRubygems(value *RubyGemsGithubPublishInfo) *GithubP
524549 return & GithubPublishInfo {Type : "rubygems" , Rubygems : value }
525550}
526551
552+ func NewGithubPublishInfoFromNuget (value * NugetGithubPublishInfo ) * GithubPublishInfo {
553+ return & GithubPublishInfo {Type : "nuget" , Nuget : value }
554+ }
555+
527556func (g * GithubPublishInfo ) UnmarshalJSON (data []byte ) error {
528557 var unmarshaler struct {
529558 Type string `json:"type"`
@@ -563,6 +592,12 @@ func (g *GithubPublishInfo) UnmarshalJSON(data []byte) error {
563592 return err
564593 }
565594 g .Rubygems = value
595+ case "nuget" :
596+ value := new (NugetGithubPublishInfo )
597+ if err := json .Unmarshal (data , & value ); err != nil {
598+ return err
599+ }
600+ g .Nuget = value
566601 }
567602 return nil
568603}
@@ -616,6 +651,15 @@ func (g GithubPublishInfo) MarshalJSON() ([]byte, error) {
616651 RubyGemsGithubPublishInfo : g .Rubygems ,
617652 }
618653 return json .Marshal (marshaler )
654+ case "nuget" :
655+ var marshaler = struct {
656+ Type string `json:"type"`
657+ * NugetGithubPublishInfo
658+ }{
659+ Type : g .Type ,
660+ NugetGithubPublishInfo : g .Nuget ,
661+ }
662+ return json .Marshal (marshaler )
619663 }
620664}
621665
@@ -625,6 +669,7 @@ type GithubPublishInfoVisitor interface {
625669 VisitPostman (* PostmanGithubPublishInfo ) error
626670 VisitPypi (* PypiGithubPublishInfo ) error
627671 VisitRubygems (* RubyGemsGithubPublishInfo ) error
672+ VisitNuget (* NugetGithubPublishInfo ) error
628673}
629674
630675func (g * GithubPublishInfo ) Accept (visitor GithubPublishInfoVisitor ) error {
@@ -641,6 +686,8 @@ func (g *GithubPublishInfo) Accept(visitor GithubPublishInfoVisitor) error {
641686 return visitor .VisitPypi (g .Pypi )
642687 case "rubygems" :
643688 return visitor .VisitRubygems (g .Rubygems )
689+ case "nuget" :
690+ return visitor .VisitNuget (g .Nuget )
644691 }
645692}
646693
@@ -816,6 +863,18 @@ type NpmRegistryConfigV2 struct {
816863 PackageName string `json:"packageName"`
817864}
818865
866+ type NugetGithubPublishInfo struct {
867+ RegistryUrl string `json:"registryUrl"`
868+ PackageName string `json:"packageName"`
869+ ApiKeyEnvironmentVariable EnvironmentVariable `json:"apiKeyEnvironmentVariable"`
870+ }
871+
872+ type NugetRegistryConfig struct {
873+ RegistryUrl string `json:"registryUrl"`
874+ ApiKey string `json:"apiKey"`
875+ PackageName string `json:"packageName"`
876+ }
877+
819878type OutputMode struct {
820879 Type string
821880 Publish * GeneratorPublishConfig
@@ -1213,6 +1272,7 @@ const (
12131272 RegistryTypeMaven
12141273 RegistryTypePypi
12151274 RegistryTypeRubygems
1275+ RegistryTypeNuget
12161276)
12171277
12181278func (r RegistryType ) String () string {
@@ -1227,6 +1287,8 @@ func (r RegistryType) String() string {
12271287 return "PYPI"
12281288 case RegistryTypeRubygems :
12291289 return "RUBYGEMS"
1290+ case RegistryTypeNuget :
1291+ return "NUGET"
12301292 }
12311293}
12321294
@@ -1252,6 +1314,9 @@ func (r *RegistryType) UnmarshalJSON(data []byte) error {
12521314 case "RUBYGEMS" :
12531315 value := RegistryTypeRubygems
12541316 * r = value
1317+ case "NUGET" :
1318+ value := RegistryTypeNuget
1319+ * r = value
12551320 }
12561321 return nil
12571322}
@@ -1270,6 +1335,7 @@ const (
12701335 BadgeTypePypi
12711336 BadgeTypeGo
12721337 BadgeTypeRubygems
1338+ BadgeTypeNuget
12731339)
12741340
12751341func (b BadgeType ) String () string {
@@ -1286,6 +1352,8 @@ func (b BadgeType) String() string {
12861352 return "GO"
12871353 case BadgeTypeRubygems :
12881354 return "RUBYGEMS"
1355+ case BadgeTypeNuget :
1356+ return "NUGET"
12891357 }
12901358}
12911359
@@ -1314,6 +1382,9 @@ func (b *BadgeType) UnmarshalJSON(data []byte) error {
13141382 case "RUBYGEMS" :
13151383 value := BadgeTypeRubygems
13161384 * b = value
1385+ case "NUGET" :
1386+ value := BadgeTypeNuget
1387+ * b = value
13171388 }
13181389 return nil
13191390}
0 commit comments