Skip to content

Commit

Permalink
New updates to generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
Octokit Bot committed Jan 13, 2024
1 parent 3241752 commit 737193b
Show file tree
Hide file tree
Showing 11 changed files with 298 additions and 166 deletions.
4 changes: 2 additions & 2 deletions pkg/github/kiota-lock.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"descriptionHash": "34253D35B40BACA42BEB6EA858C41A55F15F56B8139868AB23DCCB92FBA133DC1B3F625ABA0EF3F2D59615258AC57D9412C444F0C89A598EAA8EDB997FC30FE3",
"descriptionHash": "71E8B2E2A83100656B8BEEA5EBC617EBEDA50413D3DB041E7F9F1EFF906C06B28ADC62EF0462F8D1E9EBD390AB62CE0DBF249CE9E486F4E4862D5C8DAEE25C8B",
"descriptionLocation": "../../../source-generator/schemas/downloaded.json",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.10.0",
"kiotaVersion": "1.10.1",
"clientClassName": "ApiClient",
"clientNamespaceName": "github.com/octokit/go-sdk/pkg/github/",
"language": "Go",
Expand Down
28 changes: 28 additions & 0 deletions pkg/github/models/full_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ type FullRepository struct {
contributors_url *string
// The created_at property
created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time
// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values.
custom_properties FullRepository_custom_propertiesable
// The default_branch property
default_branch *string
// The delete_branch_on_merge property
Expand Down Expand Up @@ -313,6 +315,10 @@ func (m *FullRepository) GetContributorsUrl()(*string) {
func (m *FullRepository) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {
return m.created_at
}
// GetCustomProperties gets the custom_properties property value. The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values.
func (m *FullRepository) GetCustomProperties()(FullRepository_custom_propertiesable) {
return m.custom_properties
}
// GetDefaultBranch gets the default_branch property value. The default_branch property
func (m *FullRepository) GetDefaultBranch()(*string) {
return m.default_branch
Expand Down Expand Up @@ -554,6 +560,16 @@ func (m *FullRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89
}
return nil
}
res["custom_properties"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetObjectValue(CreateFullRepository_custom_propertiesFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
m.SetCustomProperties(val.(FullRepository_custom_propertiesable))
}
return nil
}
res["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
Expand Down Expand Up @@ -1796,6 +1812,12 @@ func (m *FullRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a
return err
}
}
{
err := writer.WriteObjectValue("custom_properties", m.GetCustomProperties())
if err != nil {
return err
}
}
{
err := writer.WriteStringValue("default_branch", m.GetDefaultBranch())
if err != nil {
Expand Down Expand Up @@ -2382,6 +2404,10 @@ func (m *FullRepository) SetContributorsUrl(value *string)() {
func (m *FullRepository) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {
m.created_at = value
}
// SetCustomProperties sets the custom_properties property value. The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values.
func (m *FullRepository) SetCustomProperties(value FullRepository_custom_propertiesable)() {
m.custom_properties = value
}
// SetDefaultBranch sets the default_branch property value. The default_branch property
func (m *FullRepository) SetDefaultBranch(value *string)() {
m.default_branch = value
Expand Down Expand Up @@ -2731,6 +2757,7 @@ type FullRepositoryable interface {
GetContentsUrl()(*string)
GetContributorsUrl()(*string)
GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
GetCustomProperties()(FullRepository_custom_propertiesable)
GetDefaultBranch()(*string)
GetDeleteBranchOnMerge()(*bool)
GetDeploymentsUrl()(*string)
Expand Down Expand Up @@ -2833,6 +2860,7 @@ type FullRepositoryable interface {
SetContentsUrl(value *string)()
SetContributorsUrl(value *string)()
SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)()
SetCustomProperties(value FullRepository_custom_propertiesable)()
SetDefaultBranch(value *string)()
SetDeleteBranchOnMerge(value *bool)()
SetDeploymentsUrl(value *string)()
Expand Down
50 changes: 50 additions & 0 deletions pkg/github/models/full_repository_custom_properties.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package models

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

// FullRepository_custom_properties the custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values.
type FullRepository_custom_properties struct {
// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
additionalData map[string]any
}
// NewFullRepository_custom_properties instantiates a new fullRepository_custom_properties and sets the default values.
func NewFullRepository_custom_properties()(*FullRepository_custom_properties) {
m := &FullRepository_custom_properties{
}
m.SetAdditionalData(make(map[string]any))
return m
}
// CreateFullRepository_custom_propertiesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
func CreateFullRepository_custom_propertiesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewFullRepository_custom_properties(), 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.
func (m *FullRepository_custom_properties) GetAdditionalData()(map[string]any) {
return m.additionalData
}
// GetFieldDeserializers the deserialization information for the current model
func (m *FullRepository_custom_properties) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error))
return res
}
// Serialize serializes information the current object
func (m *FullRepository_custom_properties) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
{
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 *FullRepository_custom_properties) SetAdditionalData(value map[string]any)() {
m.additionalData = value
}
// FullRepository_custom_propertiesable
type FullRepository_custom_propertiesable interface {
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
}
20 changes: 10 additions & 10 deletions pkg/github/models/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ type Hook struct {
active *bool
// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
additionalData map[string]any
// The config property
config Hook_configable
// Configuration object of the webhook
config WebhookConfigable
// The created_at property
created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time
// The deliveries_url property
Expand Down Expand Up @@ -55,8 +55,8 @@ func (m *Hook) GetActive()(*bool) {
func (m *Hook) GetAdditionalData()(map[string]any) {
return m.additionalData
}
// GetConfig gets the config property value. The config property
func (m *Hook) GetConfig()(Hook_configable) {
// GetConfig gets the config property value. Configuration object of the webhook
func (m *Hook) GetConfig()(WebhookConfigable) {
return m.config
}
// GetCreatedAt gets the created_at property value. The created_at property
Expand Down Expand Up @@ -85,12 +85,12 @@ func (m *Hook) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a
return nil
}
res["config"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetObjectValue(CreateHook_configFromDiscriminatorValue)
val, err := n.GetObjectValue(CreateWebhookConfigFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
m.SetConfig(val.(Hook_configable))
m.SetConfig(val.(WebhookConfigable))
}
return nil
}
Expand Down Expand Up @@ -340,8 +340,8 @@ func (m *Hook) SetActive(value *bool)() {
func (m *Hook) SetAdditionalData(value map[string]any)() {
m.additionalData = value
}
// SetConfig sets the config property value. The config property
func (m *Hook) SetConfig(value Hook_configable)() {
// SetConfig sets the config property value. Configuration object of the webhook
func (m *Hook) SetConfig(value WebhookConfigable)() {
m.config = value
}
// SetCreatedAt sets the created_at property value. The created_at property
Expand Down Expand Up @@ -393,7 +393,7 @@ type Hookable interface {
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
GetActive()(*bool)
GetConfig()(Hook_configable)
GetConfig()(WebhookConfigable)
GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
GetDeliveriesUrl()(*string)
GetEvents()([]string)
Expand All @@ -406,7 +406,7 @@ type Hookable interface {
GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
GetUrl()(*string)
SetActive(value *bool)()
SetConfig(value Hook_configable)()
SetConfig(value WebhookConfigable)()
SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)()
SetDeliveriesUrl(value *string)()
SetEvents(value []string)()
Expand Down
29 changes: 29 additions & 0 deletions pkg/github/models/org_custom_property.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ type OrgCustomProperty struct {
required *bool
// The type of the value for the property
value_type *OrgCustomProperty_value_type
// Who can edit the values of the property
values_editable_by *OrgCustomProperty_values_editable_by
}
// NewOrgCustomProperty instantiates a new orgCustomProperty and sets the default values.
func NewOrgCustomProperty()(*OrgCustomProperty) {
Expand Down Expand Up @@ -117,6 +119,16 @@ func (m *OrgCustomProperty) GetFieldDeserializers()(map[string]func(i878a80d2330
}
return nil
}
res["values_editable_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetEnumValue(ParseOrgCustomProperty_values_editable_by)
if err != nil {
return err
}
if val != nil {
m.SetValuesEditableBy(val.(*OrgCustomProperty_values_editable_by))
}
return nil
}
return res
}
// GetPropertyName gets the property_name property value. The name of the property
Expand All @@ -127,6 +139,10 @@ func (m *OrgCustomProperty) GetPropertyName()(*string) {
func (m *OrgCustomProperty) GetRequired()(*bool) {
return m.required
}
// GetValuesEditableBy gets the values_editable_by property value. Who can edit the values of the property
func (m *OrgCustomProperty) GetValuesEditableBy()(*OrgCustomProperty_values_editable_by) {
return m.values_editable_by
}
// GetValueType gets the value_type property value. The type of the value for the property
func (m *OrgCustomProperty) GetValueType()(*OrgCustomProperty_value_type) {
return m.value_type
Expand Down Expand Up @@ -163,6 +179,13 @@ func (m *OrgCustomProperty) Serialize(writer i878a80d2330e89d26896388a3f487eef27
return err
}
}
if m.GetValuesEditableBy() != nil {
cast := (*m.GetValuesEditableBy()).String()
err := writer.WriteStringValue("values_editable_by", &cast)
if err != nil {
return err
}
}
if m.GetValueType() != nil {
cast := (*m.GetValueType()).String()
err := writer.WriteStringValue("value_type", &cast)
Expand Down Expand Up @@ -202,6 +225,10 @@ func (m *OrgCustomProperty) SetPropertyName(value *string)() {
func (m *OrgCustomProperty) SetRequired(value *bool)() {
m.required = value
}
// SetValuesEditableBy sets the values_editable_by property value. Who can edit the values of the property
func (m *OrgCustomProperty) SetValuesEditableBy(value *OrgCustomProperty_values_editable_by)() {
m.values_editable_by = value
}
// SetValueType sets the value_type property value. The type of the value for the property
func (m *OrgCustomProperty) SetValueType(value *OrgCustomProperty_value_type)() {
m.value_type = value
Expand All @@ -215,11 +242,13 @@ type OrgCustomPropertyable interface {
GetDescription()(*string)
GetPropertyName()(*string)
GetRequired()(*bool)
GetValuesEditableBy()(*OrgCustomProperty_values_editable_by)
GetValueType()(*OrgCustomProperty_value_type)
SetAllowedValues(value []string)()
SetDefaultValue(value *string)()
SetDescription(value *string)()
SetPropertyName(value *string)()
SetRequired(value *bool)()
SetValuesEditableBy(value *OrgCustomProperty_values_editable_by)()
SetValueType(value *OrgCustomProperty_value_type)()
}
37 changes: 37 additions & 0 deletions pkg/github/models/org_custom_property_values_editable_by.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package models
import (
"errors"
)
// Who can edit the values of the property
type OrgCustomProperty_values_editable_by int

const (
ORG_ACTORS_ORGCUSTOMPROPERTY_VALUES_EDITABLE_BY OrgCustomProperty_values_editable_by = iota
ORG_AND_REPO_ACTORS_ORGCUSTOMPROPERTY_VALUES_EDITABLE_BY
)

func (i OrgCustomProperty_values_editable_by) String() string {
return []string{"org_actors", "org_and_repo_actors"}[i]
}
func ParseOrgCustomProperty_values_editable_by(v string) (any, error) {
result := ORG_ACTORS_ORGCUSTOMPROPERTY_VALUES_EDITABLE_BY
switch v {
case "org_actors":
result = ORG_ACTORS_ORGCUSTOMPROPERTY_VALUES_EDITABLE_BY
case "org_and_repo_actors":
result = ORG_AND_REPO_ACTORS_ORGCUSTOMPROPERTY_VALUES_EDITABLE_BY
default:
return 0, errors.New("Unknown OrgCustomProperty_values_editable_by value: " + v)
}
return &result, nil
}
func SerializeOrgCustomProperty_values_editable_by(values []OrgCustomProperty_values_editable_by) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i OrgCustomProperty_values_editable_by) isMultiValue() bool {
return false
}
Loading

0 comments on commit 737193b

Please sign in to comment.