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 Aug 31, 2024
1 parent 676f61f commit cb918af
Show file tree
Hide file tree
Showing 10 changed files with 2,520 additions and 2,681 deletions.
4,939 changes: 2,313 additions & 2,626 deletions pkg/github/.kiota.log

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion pkg/github/advisories/get_sort_query_parameter_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ type GetSortQueryParameterType int
const (
UPDATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota
PUBLISHED_GETSORTQUERYPARAMETERTYPE
EPSS_PERCENTAGE_GETSORTQUERYPARAMETERTYPE
EPSS_PERCENTILE_GETSORTQUERYPARAMETERTYPE
)

func (i GetSortQueryParameterType) String() string {
return []string{"updated", "published"}[i]
return []string{"updated", "published", "epss_percentage", "epss_percentile"}[i]
}
func ParseGetSortQueryParameterType(v string) (any, error) {
result := UPDATED_GETSORTQUERYPARAMETERTYPE
Expand All @@ -16,6 +18,10 @@ func ParseGetSortQueryParameterType(v string) (any, error) {
result = UPDATED_GETSORTQUERYPARAMETERTYPE
case "published":
result = PUBLISHED_GETSORTQUERYPARAMETERTYPE
case "epss_percentage":
result = EPSS_PERCENTAGE_GETSORTQUERYPARAMETERTYPE
case "epss_percentile":
result = EPSS_PERCENTILE_GETSORTQUERYPARAMETERTYPE
default:
return nil, nil
}
Expand Down
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": "F0EA7EF2FC507B20861DFEA86E9DD6DE1D81238B7C598E851FFB9F036B21762DC44F84BD97422EFA1BA56DADAFA46BFE370EB5D7E60BBA1B402193C8D2F0F7FB",
"descriptionHash": "87541D93EDF176CF48CF693C5A0CEC8535C3F31A04143E83CBD21DCD3F0A2BEA523BCCD97793ADC61FB9617B2EAD3534F75AD2834D35724B836586F14C4F19BA",
"descriptionLocation": "../../../../../schemas/ghec.json",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.17.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,45 +1,62 @@
package orgs
package models

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

type ItemOrganizationRolesPostRequestBody struct {
type OrganizationCustomOrganizationRoleCreateSchema struct {
// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
additionalData map[string]any
// The system role from which this role can inherit permissions.
base_role *OrganizationCustomOrganizationRoleCreateSchema_base_role
// A short description about the intended usage of this role or what permissions it grants.
description *string
// The name of the custom role.
name *string
// A list of additional permissions included in this role.
permissions []string
}
// NewItemOrganizationRolesPostRequestBody instantiates a new ItemOrganizationRolesPostRequestBody and sets the default values.
func NewItemOrganizationRolesPostRequestBody()(*ItemOrganizationRolesPostRequestBody) {
m := &ItemOrganizationRolesPostRequestBody{
// NewOrganizationCustomOrganizationRoleCreateSchema instantiates a new OrganizationCustomOrganizationRoleCreateSchema and sets the default values.
func NewOrganizationCustomOrganizationRoleCreateSchema()(*OrganizationCustomOrganizationRoleCreateSchema) {
m := &OrganizationCustomOrganizationRoleCreateSchema{
}
m.SetAdditionalData(make(map[string]any))
return m
}
// CreateItemOrganizationRolesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// CreateOrganizationCustomOrganizationRoleCreateSchemaFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// returns a Parsable when successful
func CreateItemOrganizationRolesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewItemOrganizationRolesPostRequestBody(), nil
func CreateOrganizationCustomOrganizationRoleCreateSchemaFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewOrganizationCustomOrganizationRoleCreateSchema(), 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 *ItemOrganizationRolesPostRequestBody) GetAdditionalData()(map[string]any) {
func (m *OrganizationCustomOrganizationRoleCreateSchema) GetAdditionalData()(map[string]any) {
return m.additionalData
}
// GetBaseRole gets the base_role property value. The system role from which this role can inherit permissions.
// returns a *OrganizationCustomOrganizationRoleCreateSchema_base_role when successful
func (m *OrganizationCustomOrganizationRoleCreateSchema) GetBaseRole()(*OrganizationCustomOrganizationRoleCreateSchema_base_role) {
return m.base_role
}
// GetDescription gets the description property value. A short description about the intended usage of this role or what permissions it grants.
// returns a *string when successful
func (m *ItemOrganizationRolesPostRequestBody) GetDescription()(*string) {
func (m *OrganizationCustomOrganizationRoleCreateSchema) GetDescription()(*string) {
return m.description
}
// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *ItemOrganizationRolesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
func (m *OrganizationCustomOrganizationRoleCreateSchema) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error))
res["base_role"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetEnumValue(ParseOrganizationCustomOrganizationRoleCreateSchema_base_role)
if err != nil {
return err
}
if val != nil {
m.SetBaseRole(val.(*OrganizationCustomOrganizationRoleCreateSchema_base_role))
}
return nil
}
res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
Expand Down Expand Up @@ -80,16 +97,23 @@ func (m *ItemOrganizationRolesPostRequestBody) GetFieldDeserializers()(map[strin
}
// GetName gets the name property value. The name of the custom role.
// returns a *string when successful
func (m *ItemOrganizationRolesPostRequestBody) GetName()(*string) {
func (m *OrganizationCustomOrganizationRoleCreateSchema) GetName()(*string) {
return m.name
}
// GetPermissions gets the permissions property value. A list of additional permissions included in this role.
// returns a []string when successful
func (m *ItemOrganizationRolesPostRequestBody) GetPermissions()([]string) {
func (m *OrganizationCustomOrganizationRoleCreateSchema) GetPermissions()([]string) {
return m.permissions
}
// Serialize serializes information the current object
func (m *ItemOrganizationRolesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
func (m *OrganizationCustomOrganizationRoleCreateSchema) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
if m.GetBaseRole() != nil {
cast := (*m.GetBaseRole()).String()
err := writer.WriteStringValue("base_role", &cast)
if err != nil {
return err
}
}
{
err := writer.WriteStringValue("description", m.GetDescription())
if err != nil {
Expand Down Expand Up @@ -117,27 +141,33 @@ func (m *ItemOrganizationRolesPostRequestBody) Serialize(writer i878a80d2330e89d
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 *ItemOrganizationRolesPostRequestBody) SetAdditionalData(value map[string]any)() {
func (m *OrganizationCustomOrganizationRoleCreateSchema) SetAdditionalData(value map[string]any)() {
m.additionalData = value
}
// SetBaseRole sets the base_role property value. The system role from which this role can inherit permissions.
func (m *OrganizationCustomOrganizationRoleCreateSchema) SetBaseRole(value *OrganizationCustomOrganizationRoleCreateSchema_base_role)() {
m.base_role = value
}
// SetDescription sets the description property value. A short description about the intended usage of this role or what permissions it grants.
func (m *ItemOrganizationRolesPostRequestBody) SetDescription(value *string)() {
func (m *OrganizationCustomOrganizationRoleCreateSchema) SetDescription(value *string)() {
m.description = value
}
// SetName sets the name property value. The name of the custom role.
func (m *ItemOrganizationRolesPostRequestBody) SetName(value *string)() {
func (m *OrganizationCustomOrganizationRoleCreateSchema) SetName(value *string)() {
m.name = value
}
// SetPermissions sets the permissions property value. A list of additional permissions included in this role.
func (m *ItemOrganizationRolesPostRequestBody) SetPermissions(value []string)() {
func (m *OrganizationCustomOrganizationRoleCreateSchema) SetPermissions(value []string)() {
m.permissions = value
}
type ItemOrganizationRolesPostRequestBodyable interface {
type OrganizationCustomOrganizationRoleCreateSchemaable interface {
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
GetBaseRole()(*OrganizationCustomOrganizationRoleCreateSchema_base_role)
GetDescription()(*string)
GetName()(*string)
GetPermissions()([]string)
SetBaseRole(value *OrganizationCustomOrganizationRoleCreateSchema_base_role)()
SetDescription(value *string)()
SetName(value *string)()
SetPermissions(value []string)()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package models
// The system role from which this role can inherit permissions.
type OrganizationCustomOrganizationRoleCreateSchema_base_role int

const (
READ_ORGANIZATIONCUSTOMORGANIZATIONROLECREATESCHEMA_BASE_ROLE OrganizationCustomOrganizationRoleCreateSchema_base_role = iota
TRIAGE_ORGANIZATIONCUSTOMORGANIZATIONROLECREATESCHEMA_BASE_ROLE
WRITE_ORGANIZATIONCUSTOMORGANIZATIONROLECREATESCHEMA_BASE_ROLE
MAINTAIN_ORGANIZATIONCUSTOMORGANIZATIONROLECREATESCHEMA_BASE_ROLE
ADMIN_ORGANIZATIONCUSTOMORGANIZATIONROLECREATESCHEMA_BASE_ROLE
)

func (i OrganizationCustomOrganizationRoleCreateSchema_base_role) String() string {
return []string{"read", "triage", "write", "maintain", "admin"}[i]
}
func ParseOrganizationCustomOrganizationRoleCreateSchema_base_role(v string) (any, error) {
result := READ_ORGANIZATIONCUSTOMORGANIZATIONROLECREATESCHEMA_BASE_ROLE
switch v {
case "read":
result = READ_ORGANIZATIONCUSTOMORGANIZATIONROLECREATESCHEMA_BASE_ROLE
case "triage":
result = TRIAGE_ORGANIZATIONCUSTOMORGANIZATIONROLECREATESCHEMA_BASE_ROLE
case "write":
result = WRITE_ORGANIZATIONCUSTOMORGANIZATIONROLECREATESCHEMA_BASE_ROLE
case "maintain":
result = MAINTAIN_ORGANIZATIONCUSTOMORGANIZATIONROLECREATESCHEMA_BASE_ROLE
case "admin":
result = ADMIN_ORGANIZATIONCUSTOMORGANIZATIONROLECREATESCHEMA_BASE_ROLE
default:
return nil, nil
}
return &result, nil
}
func SerializeOrganizationCustomOrganizationRoleCreateSchema_base_role(values []OrganizationCustomOrganizationRoleCreateSchema_base_role) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i OrganizationCustomOrganizationRoleCreateSchema_base_role) isMultiValue() bool {
return false
}
Loading

0 comments on commit cb918af

Please sign in to comment.