Skip to content

Commit

Permalink
New updates to generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
octokitbot committed Jan 18, 2025
1 parent 3b14d66 commit ff42001
Show file tree
Hide file tree
Showing 37 changed files with 3,592 additions and 23 deletions.
2 changes: 1 addition & 1 deletion pkg/github/kiota-lock.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"descriptionHash": "C84AE6AF1B5631937CEF55A90CC3878897880355FD45430C281287BEB6AF8FFCEF4B21A49C8089494C5B75881FEA1A7F809D376F852C7CECB69D77D100AA0073",
"descriptionHash": "FB8FE1F741E080719F7C4C8EECBECB741B6136E59A74D88B952D22410BD8A842793A943EAAE1203C70B4C81AC38085D1E362187B86FF232A573D3D7DDB253B9B",
"descriptionLocation": "../../../../../schemas/api.github.com.json",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.19.0",
Expand Down
385 changes: 385 additions & 0 deletions pkg/github/models/actions_hosted_runner.go

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions pkg/github/models/actions_hosted_runner_escaped_status.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package models
// The status of the runner.
type ActionsHostedRunner_status int

const (
READY_ACTIONSHOSTEDRUNNER_STATUS ActionsHostedRunner_status = iota
PROVISIONING_ACTIONSHOSTEDRUNNER_STATUS
SHUTDOWN_ACTIONSHOSTEDRUNNER_STATUS
DELETING_ACTIONSHOSTEDRUNNER_STATUS
STUCK_ACTIONSHOSTEDRUNNER_STATUS
)

func (i ActionsHostedRunner_status) String() string {
return []string{"Ready", "Provisioning", "Shutdown", "Deleting", "Stuck"}[i]
}
func ParseActionsHostedRunner_status(v string) (any, error) {
result := READY_ACTIONSHOSTEDRUNNER_STATUS
switch v {
case "Ready":
result = READY_ACTIONSHOSTEDRUNNER_STATUS
case "Provisioning":
result = PROVISIONING_ACTIONSHOSTEDRUNNER_STATUS
case "Shutdown":
result = SHUTDOWN_ACTIONSHOSTEDRUNNER_STATUS
case "Deleting":
result = DELETING_ACTIONSHOSTEDRUNNER_STATUS
case "Stuck":
result = STUCK_ACTIONSHOSTEDRUNNER_STATUS
default:
return nil, nil
}
return &result, nil
}
func SerializeActionsHostedRunner_status(values []ActionsHostedRunner_status) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i ActionsHostedRunner_status) isMultiValue() bool {
return false
}
198 changes: 198 additions & 0 deletions pkg/github/models/actions_hosted_runner_image.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
package models

import (
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
)

// ActionsHostedRunnerImage provides details of a hosted runner image
type ActionsHostedRunnerImage struct {
// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
additionalData map[string]any
// Display name for this image.
display_name *string
// The ID of the image. Use this ID for the `image` parameter when creating a new larger runner.
id *string
// The operating system of the image.
platform *string
// Image size in GB.
size_gb *int32
// The image provider.
source *ActionsHostedRunnerImage_source
}
// NewActionsHostedRunnerImage instantiates a new ActionsHostedRunnerImage and sets the default values.
func NewActionsHostedRunnerImage()(*ActionsHostedRunnerImage) {
m := &ActionsHostedRunnerImage{
}
m.SetAdditionalData(make(map[string]any))
return m
}
// CreateActionsHostedRunnerImageFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// returns a Parsable when successful
func CreateActionsHostedRunnerImageFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewActionsHostedRunnerImage(), nil
}
// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
// returns a map[string]any when successful
func (m *ActionsHostedRunnerImage) GetAdditionalData()(map[string]any) {
return m.additionalData
}
// GetDisplayName gets the display_name property value. Display name for this image.
// returns a *string when successful
func (m *ActionsHostedRunnerImage) GetDisplayName()(*string) {
return m.display_name
}
// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *ActionsHostedRunnerImage) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error))
res["display_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetDisplayName(val)
}
return nil
}
res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetId(val)
}
return nil
}
res["platform"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetPlatform(val)
}
return nil
}
res["size_gb"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetInt32Value()
if err != nil {
return err
}
if val != nil {
m.SetSizeGb(val)
}
return nil
}
res["source"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetEnumValue(ParseActionsHostedRunnerImage_source)
if err != nil {
return err
}
if val != nil {
m.SetSource(val.(*ActionsHostedRunnerImage_source))
}
return nil
}
return res
}
// GetId gets the id property value. The ID of the image. Use this ID for the `image` parameter when creating a new larger runner.
// returns a *string when successful
func (m *ActionsHostedRunnerImage) GetId()(*string) {
return m.id
}
// GetPlatform gets the platform property value. The operating system of the image.
// returns a *string when successful
func (m *ActionsHostedRunnerImage) GetPlatform()(*string) {
return m.platform
}
// GetSizeGb gets the size_gb property value. Image size in GB.
// returns a *int32 when successful
func (m *ActionsHostedRunnerImage) GetSizeGb()(*int32) {
return m.size_gb
}
// GetSource gets the source property value. The image provider.
// returns a *ActionsHostedRunnerImage_source when successful
func (m *ActionsHostedRunnerImage) GetSource()(*ActionsHostedRunnerImage_source) {
return m.source
}
// Serialize serializes information the current object
func (m *ActionsHostedRunnerImage) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
{
err := writer.WriteStringValue("display_name", m.GetDisplayName())
if err != nil {
return err
}
}
{
err := writer.WriteStringValue("id", m.GetId())
if err != nil {
return err
}
}
{
err := writer.WriteStringValue("platform", m.GetPlatform())
if err != nil {
return err
}
}
{
err := writer.WriteInt32Value("size_gb", m.GetSizeGb())
if err != nil {
return err
}
}
if m.GetSource() != nil {
cast := (*m.GetSource()).String()
err := writer.WriteStringValue("source", &cast)
if err != nil {
return err
}
}
{
err := writer.WriteAdditionalData(m.GetAdditionalData())
if err != nil {
return err
}
}
return nil
}
// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
func (m *ActionsHostedRunnerImage) SetAdditionalData(value map[string]any)() {
m.additionalData = value
}
// SetDisplayName sets the display_name property value. Display name for this image.
func (m *ActionsHostedRunnerImage) SetDisplayName(value *string)() {
m.display_name = value
}
// SetId sets the id property value. The ID of the image. Use this ID for the `image` parameter when creating a new larger runner.
func (m *ActionsHostedRunnerImage) SetId(value *string)() {
m.id = value
}
// SetPlatform sets the platform property value. The operating system of the image.
func (m *ActionsHostedRunnerImage) SetPlatform(value *string)() {
m.platform = value
}
// SetSizeGb sets the size_gb property value. Image size in GB.
func (m *ActionsHostedRunnerImage) SetSizeGb(value *int32)() {
m.size_gb = value
}
// SetSource sets the source property value. The image provider.
func (m *ActionsHostedRunnerImage) SetSource(value *ActionsHostedRunnerImage_source)() {
m.source = value
}
type ActionsHostedRunnerImageable interface {
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
GetDisplayName()(*string)
GetId()(*string)
GetPlatform()(*string)
GetSizeGb()(*int32)
GetSource()(*ActionsHostedRunnerImage_source)
SetDisplayName(value *string)()
SetId(value *string)()
SetPlatform(value *string)()
SetSizeGb(value *int32)()
SetSource(value *ActionsHostedRunnerImage_source)()
}
37 changes: 37 additions & 0 deletions pkg/github/models/actions_hosted_runner_image_escaped_source.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package models
// The image provider.
type ActionsHostedRunnerImage_source int

const (
GITHUB_ACTIONSHOSTEDRUNNERIMAGE_SOURCE ActionsHostedRunnerImage_source = iota
PARTNER_ACTIONSHOSTEDRUNNERIMAGE_SOURCE
CUSTOM_ACTIONSHOSTEDRUNNERIMAGE_SOURCE
)

func (i ActionsHostedRunnerImage_source) String() string {
return []string{"github", "partner", "custom"}[i]
}
func ParseActionsHostedRunnerImage_source(v string) (any, error) {
result := GITHUB_ACTIONSHOSTEDRUNNERIMAGE_SOURCE
switch v {
case "github":
result = GITHUB_ACTIONSHOSTEDRUNNERIMAGE_SOURCE
case "partner":
result = PARTNER_ACTIONSHOSTEDRUNNERIMAGE_SOURCE
case "custom":
result = CUSTOM_ACTIONSHOSTEDRUNNERIMAGE_SOURCE
default:
return nil, nil
}
return &result, nil
}
func SerializeActionsHostedRunnerImage_source(values []ActionsHostedRunnerImage_source) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i ActionsHostedRunnerImage_source) isMultiValue() bool {
return false
}
80 changes: 80 additions & 0 deletions pkg/github/models/actions_hosted_runner_limits.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
package models

import (
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
)

type ActionsHostedRunnerLimits struct {
// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
additionalData map[string]any
// Provides details of static public IP limits for GitHub-hosted Hosted Runners
public_ips ActionsHostedRunnerLimits_public_ipsable
}
// NewActionsHostedRunnerLimits instantiates a new ActionsHostedRunnerLimits and sets the default values.
func NewActionsHostedRunnerLimits()(*ActionsHostedRunnerLimits) {
m := &ActionsHostedRunnerLimits{
}
m.SetAdditionalData(make(map[string]any))
return m
}
// CreateActionsHostedRunnerLimitsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// returns a Parsable when successful
func CreateActionsHostedRunnerLimitsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewActionsHostedRunnerLimits(), nil
}
// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
// returns a map[string]any when successful
func (m *ActionsHostedRunnerLimits) GetAdditionalData()(map[string]any) {
return m.additionalData
}
// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *ActionsHostedRunnerLimits) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error))
res["public_ips"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetObjectValue(CreateActionsHostedRunnerLimits_public_ipsFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
m.SetPublicIps(val.(ActionsHostedRunnerLimits_public_ipsable))
}
return nil
}
return res
}
// GetPublicIps gets the public_ips property value. Provides details of static public IP limits for GitHub-hosted Hosted Runners
// returns a ActionsHostedRunnerLimits_public_ipsable when successful
func (m *ActionsHostedRunnerLimits) GetPublicIps()(ActionsHostedRunnerLimits_public_ipsable) {
return m.public_ips
}
// Serialize serializes information the current object
func (m *ActionsHostedRunnerLimits) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
{
err := writer.WriteObjectValue("public_ips", m.GetPublicIps())
if err != nil {
return err
}
}
{
err := writer.WriteAdditionalData(m.GetAdditionalData())
if err != nil {
return err
}
}
return nil
}
// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
func (m *ActionsHostedRunnerLimits) SetAdditionalData(value map[string]any)() {
m.additionalData = value
}
// SetPublicIps sets the public_ips property value. Provides details of static public IP limits for GitHub-hosted Hosted Runners
func (m *ActionsHostedRunnerLimits) SetPublicIps(value ActionsHostedRunnerLimits_public_ipsable)() {
m.public_ips = value
}
type ActionsHostedRunnerLimitsable interface {
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
GetPublicIps()(ActionsHostedRunnerLimits_public_ipsable)
SetPublicIps(value ActionsHostedRunnerLimits_public_ipsable)()
}
Loading

0 comments on commit ff42001

Please sign in to comment.