From 22c6baa700f158945d8aa792b791427ec9098562 Mon Sep 17 00:00:00 2001 From: Octokit Bot Date: Tue, 24 Sep 2024 00:09:38 +0000 Subject: [PATCH 1/3] New updates to generated code --- pkg/github/kiota-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/github/kiota-lock.json b/pkg/github/kiota-lock.json index 14aa4c7a..baaed638 100644 --- a/pkg/github/kiota-lock.json +++ b/pkg/github/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "12DF1E15BA73305937A12C26C9416358C3B6F5CC2F176595578F1623B747B8B9D28934FBF88839377445093B6979D4BD2FE825F52F224DFC224FADB019BE6F92", + "descriptionHash": "82AE1B3830F7191FC9703298B3C31A927127CD272AC23BD364DE1A31E37D597ABD37ED30769C4642F9C9B97A4A3105AD81B964FFA385E97A603B063D807DB2DC", "descriptionLocation": "../../../../../schemas/ghes-3.14.json", "lockFileVersion": "1.0.0", "kiotaVersion": "1.18.0", From cada88f98a55e11f26228abfd84707fa34ee8795 Mon Sep 17 00:00:00 2001 From: Octokit Bot Date: Thu, 26 Sep 2024 00:09:22 +0000 Subject: [PATCH 2/3] New updates to generated code --- pkg/github/models/users.go | 152 +++++++++++++++------ pkg/github/models/users_escaped_matches.go | 115 ++++++++++++++++ 2 files changed, 226 insertions(+), 41 deletions(-) create mode 100644 pkg/github/models/users_escaped_matches.go diff --git a/pkg/github/models/users.go b/pkg/github/models/users.go index cf42c03e..dd87f2ab 100644 --- a/pkg/github/models/users.go +++ b/pkg/github/models/users.go @@ -7,12 +7,16 @@ import ( type Users struct { // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. additionalData map[string]any - // Whether this email address is the primary address. - primary *bool - // The type of email address. - typeEscaped *string - // The email address. - value *string + // The fragment property + fragment *string + // The matches property + matches []Users_matchesable + // The object_type property + object_type *string + // The object_url property + object_url *string + // The property property + property *string } // NewUsers instantiates a new Users and sets the default values. func NewUsers()(*Users) { @@ -35,69 +39,123 @@ func (m *Users) GetAdditionalData()(map[string]any) { // returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful func (m *Users) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) - res["primary"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { - val, err := n.GetBoolValue() + res["fragment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFragment(val) + } + return nil + } + res["matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateUsers_matchesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Users_matchesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Users_matchesable) + } + } + m.SetMatches(res) + } + return nil + } + res["object_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() if err != nil { return err } if val != nil { - m.SetPrimary(val) + m.SetObjectType(val) } return nil } - res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res["object_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { - m.SetTypeEscaped(val) + m.SetObjectUrl(val) } return nil } - res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res["property"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { - m.SetValue(val) + m.SetProperty(val) } return nil } return res } -// GetPrimary gets the primary property value. Whether this email address is the primary address. -// returns a *bool when successful -func (m *Users) GetPrimary()(*bool) { - return m.primary +// GetFragment gets the fragment property value. The fragment property +// returns a *string when successful +func (m *Users) GetFragment()(*string) { + return m.fragment +} +// GetMatches gets the matches property value. The matches property +// returns a []Users_matchesable when successful +func (m *Users) GetMatches()([]Users_matchesable) { + return m.matches +} +// GetObjectType gets the object_type property value. The object_type property +// returns a *string when successful +func (m *Users) GetObjectType()(*string) { + return m.object_type } -// GetTypeEscaped gets the type property value. The type of email address. +// GetObjectUrl gets the object_url property value. The object_url property // returns a *string when successful -func (m *Users) GetTypeEscaped()(*string) { - return m.typeEscaped +func (m *Users) GetObjectUrl()(*string) { + return m.object_url } -// GetValue gets the value property value. The email address. +// GetProperty gets the property property value. The property property // returns a *string when successful -func (m *Users) GetValue()(*string) { - return m.value +func (m *Users) GetProperty()(*string) { + return m.property } // Serialize serializes information the current object func (m *Users) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { { - err := writer.WriteBoolValue("primary", m.GetPrimary()) + err := writer.WriteStringValue("fragment", m.GetFragment()) + if err != nil { + return err + } + } + if m.GetMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetMatches())) + for i, v := range m.GetMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_type", m.GetObjectType()) if err != nil { return err } } { - err := writer.WriteStringValue("type", m.GetTypeEscaped()) + err := writer.WriteStringValue("object_url", m.GetObjectUrl()) if err != nil { return err } } { - err := writer.WriteStringValue("value", m.GetValue()) + err := writer.WriteStringValue("property", m.GetProperty()) if err != nil { return err } @@ -114,25 +172,37 @@ func (m *Users) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c4 func (m *Users) SetAdditionalData(value map[string]any)() { m.additionalData = value } -// SetPrimary sets the primary property value. Whether this email address is the primary address. -func (m *Users) SetPrimary(value *bool)() { - m.primary = value +// SetFragment sets the fragment property value. The fragment property +func (m *Users) SetFragment(value *string)() { + m.fragment = value +} +// SetMatches sets the matches property value. The matches property +func (m *Users) SetMatches(value []Users_matchesable)() { + m.matches = value +} +// SetObjectType sets the object_type property value. The object_type property +func (m *Users) SetObjectType(value *string)() { + m.object_type = value } -// SetTypeEscaped sets the type property value. The type of email address. -func (m *Users) SetTypeEscaped(value *string)() { - m.typeEscaped = value +// SetObjectUrl sets the object_url property value. The object_url property +func (m *Users) SetObjectUrl(value *string)() { + m.object_url = value } -// SetValue sets the value property value. The email address. -func (m *Users) SetValue(value *string)() { - m.value = value +// SetProperty sets the property property value. The property property +func (m *Users) SetProperty(value *string)() { + m.property = value } type Usersable interface { i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable - GetPrimary()(*bool) - GetTypeEscaped()(*string) - GetValue()(*string) - SetPrimary(value *bool)() - SetTypeEscaped(value *string)() - SetValue(value *string)() + GetFragment()(*string) + GetMatches()([]Users_matchesable) + GetObjectType()(*string) + GetObjectUrl()(*string) + GetProperty()(*string) + SetFragment(value *string)() + SetMatches(value []Users_matchesable)() + SetObjectType(value *string)() + SetObjectUrl(value *string)() + SetProperty(value *string)() } diff --git a/pkg/github/models/users_escaped_matches.go b/pkg/github/models/users_escaped_matches.go new file mode 100644 index 00000000..01a8d51e --- /dev/null +++ b/pkg/github/models/users_escaped_matches.go @@ -0,0 +1,115 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Users_matches 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 indices property + indices []int32 + // The text property + text *string +} +// NewUsers_matches instantiates a new Users_matches and sets the default values. +func NewUsers_matches()(*Users_matches) { + m := &Users_matches{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUsers_matchesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUsers_matchesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUsers_matches(), 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 *Users_matches) 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 *Users_matches) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["indices"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetIndices(res) + } + return nil + } + res["text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetText(val) + } + return nil + } + return res +} +// GetIndices gets the indices property value. The indices property +// returns a []int32 when successful +func (m *Users_matches) GetIndices()([]int32) { + return m.indices +} +// GetText gets the text property value. The text property +// returns a *string when successful +func (m *Users_matches) GetText()(*string) { + return m.text +} +// Serialize serializes information the current object +func (m *Users_matches) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetIndices() != nil { + err := writer.WriteCollectionOfInt32Values("indices", m.GetIndices()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("text", m.GetText()) + 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 *Users_matches) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIndices sets the indices property value. The indices property +func (m *Users_matches) SetIndices(value []int32)() { + m.indices = value +} +// SetText sets the text property value. The text property +func (m *Users_matches) SetText(value *string)() { + m.text = value +} +type Users_matchesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIndices()([]int32) + GetText()(*string) + SetIndices(value []int32)() + SetText(value *string)() +} From fcd4277035e594e5845e382456be166ba7ae1052 Mon Sep 17 00:00:00 2001 From: Octokit Bot Date: Fri, 27 Sep 2024 00:09:42 +0000 Subject: [PATCH 3/3] New updates to generated code --- pkg/github/kiota-lock.json | 2 +- .../item_item_pulls_item_update_branch_request_builder.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/github/kiota-lock.json b/pkg/github/kiota-lock.json index baaed638..de969ca2 100644 --- a/pkg/github/kiota-lock.json +++ b/pkg/github/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "82AE1B3830F7191FC9703298B3C31A927127CD272AC23BD364DE1A31E37D597ABD37ED30769C4642F9C9B97A4A3105AD81B964FFA385E97A603B063D807DB2DC", + "descriptionHash": "9482DE710096F8842856A82D500BA83D727899A8C841DC3999C90DA5DB1E40449E7AFB279E14DBE66409B4CFE2CA6497FA9382062527A01C161C5F2463C8B7B7", "descriptionLocation": "../../../../../schemas/ghes-3.14.json", "lockFileVersion": "1.0.0", "kiotaVersion": "1.18.0", diff --git a/pkg/github/repos/item_item_pulls_item_update_branch_request_builder.go b/pkg/github/repos/item_item_pulls_item_update_branch_request_builder.go index c6ba06a3..444d2621 100644 --- a/pkg/github/repos/item_item_pulls_item_update_branch_request_builder.go +++ b/pkg/github/repos/item_item_pulls_item_update_branch_request_builder.go @@ -23,7 +23,7 @@ func NewItemItemPullsItemUpdateBranchRequestBuilder(rawUrl string, requestAdapte urlParams["request-raw-url"] = rawUrl return NewItemItemPullsItemUpdateBranchRequestBuilderInternal(urlParams, requestAdapter) } -// Put updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch. +// Put updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch.Note: If making a request on behalf of a GitHub App you must also have permissions to write the contents of the head repository. // returns a ItemItemPullsItemUpdateBranchPutResponseable when successful // returns a BasicError error when the service returns a 403 status code // returns a ValidationError error when the service returns a 422 status code @@ -48,7 +48,7 @@ func (m *ItemItemPullsItemUpdateBranchRequestBuilder) Put(ctx context.Context, b } return res.(ItemItemPullsItemUpdateBranchPutResponseable), nil } -// ToPutRequestInformation updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch. +// ToPutRequestInformation updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch.Note: If making a request on behalf of a GitHub App you must also have permissions to write the contents of the head repository. // returns a *RequestInformation when successful func (m *ItemItemPullsItemUpdateBranchRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemPullsItemUpdateBranchPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters)