From 60b052d69c878d82d35c8651b1c711301009d67b Mon Sep 17 00:00:00 2001 From: Octokit Bot Date: Thu, 25 Jul 2024 00:08:21 +0000 Subject: [PATCH 1/4] New updates to generated code --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index ab138cfa..ecacc5f0 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,9 @@ You may also want: - [dotnet-sdk-enterprise-cloud repository](https://github.com/octokit/dotnet-sdk-enterprise-cloud) - For GitHub Enterprise Server - [dotnet-sdk-enterprise-server repository](https://github.com/octokit/dotnet-sdk-enterprise-server) + - For our classic non-generated, hand-maintained Octokit.net project + - [Octokit.net repository](https://github.com/octokit/octokit.net) + - For why we're building generative SDKs, see [Why a generated SDK?](#why-a-generated-sdk) below - [source-generator](https://github.com/octokit/source-generator) (the repository that creates these generated SDKs) - Contributions to this repository should take place in source-generator instead, as they'll be distributed here through mechanisms there. From 7c2812a5d2c4dec8e070b367a7939f2a1e3c92b2 Mon Sep 17 00:00:00 2001 From: Octokit Bot Date: Thu, 25 Jul 2024 21:52:04 +0000 Subject: [PATCH 2/4] New updates to generated code --- pkg/github/kiota-lock.json | 2 +- .../models/file_extension_restriction.go | 2 +- pkg/github/models/file_path_restriction.go | 2 +- pkg/github/models/max_file_path_length.go | 2 +- pkg/github/models/max_file_size.go | 2 +- pkg/github/models/repository_rule.go | 92 ++++++- .../models/repository_rule_merge_queue.go | 111 ++++++++ .../repository_rule_merge_queue_parameters.go | 256 ++++++++++++++++++ ...erge_queue_parameters_grouping_strategy.go | 37 +++ ...ule_merge_queue_parameters_merge_method.go | 40 +++ .../repository_rule_merge_queue_type.go | 33 +++ ..._rule_required_status_checks_parameters.go | 29 ++ .../repository_rule_workflows_parameters.go | 29 ++ ...gurations_post_request_body_enforcement.go | 2 +- ...guration_patch_request_body_enforcement.go | 2 +- ...tions_item_repositories_request_builder.go | 2 +- 16 files changed, 634 insertions(+), 9 deletions(-) create mode 100644 pkg/github/models/repository_rule_merge_queue.go create mode 100644 pkg/github/models/repository_rule_merge_queue_parameters.go create mode 100644 pkg/github/models/repository_rule_merge_queue_parameters_grouping_strategy.go create mode 100644 pkg/github/models/repository_rule_merge_queue_parameters_merge_method.go create mode 100644 pkg/github/models/repository_rule_merge_queue_type.go diff --git a/pkg/github/kiota-lock.json b/pkg/github/kiota-lock.json index 35fef8f2..0259b6be 100644 --- a/pkg/github/kiota-lock.json +++ b/pkg/github/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "261F60DD494AFFB56F930D3042ADFA27120D57684490956B6C18FAFBF91CDB3656E3898CCC41269A2D4B4664B15FF40D37A3BCD066927006DA56031E07F14802", + "descriptionHash": "7ECFD65586B744E83319DF0E73957BCA36AE996677673FEE71A46310209AB2B7209EAEADEB1B275AABF9911452C9E8AEC15A1119DF8C6FDCDED17C52F7FD9785", "descriptionLocation": "../../../../../schemas/api.github.com.json", "lockFileVersion": "1.0.0", "kiotaVersion": "1.14.0", diff --git a/pkg/github/models/file_extension_restriction.go b/pkg/github/models/file_extension_restriction.go index cf261b71..e12002a5 100644 --- a/pkg/github/models/file_extension_restriction.go +++ b/pkg/github/models/file_extension_restriction.go @@ -4,7 +4,7 @@ import ( i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" ) -// File_extension_restriction note: file_extension_restriction is in beta and subject to change.Prevent commits that include files with specified file extensions from being pushed to the commit graph. +// File_extension_restriction > [!NOTE]> `file_extension_restriction` is in beta and subject to change.Prevent commits that include files with specified file extensions from being pushed to the commit graph. type File_extension_restriction struct { // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. additionalData map[string]any diff --git a/pkg/github/models/file_path_restriction.go b/pkg/github/models/file_path_restriction.go index d45a9641..e54c5be1 100644 --- a/pkg/github/models/file_path_restriction.go +++ b/pkg/github/models/file_path_restriction.go @@ -4,7 +4,7 @@ import ( i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" ) -// File_path_restriction note: file_path_restriction is in beta and subject to change.Prevent commits that include changes in specified file paths from being pushed to the commit graph. +// File_path_restriction > [!NOTE]> `file_path_restriction` is in beta and subject to change.Prevent commits that include changes in specified file paths from being pushed to the commit graph. type File_path_restriction struct { // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. additionalData map[string]any diff --git a/pkg/github/models/max_file_path_length.go b/pkg/github/models/max_file_path_length.go index ec4fe6f8..87a3a6ab 100644 --- a/pkg/github/models/max_file_path_length.go +++ b/pkg/github/models/max_file_path_length.go @@ -4,7 +4,7 @@ import ( i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" ) -// Max_file_path_length note: max_file_path_length is in beta and subject to change.Prevent commits that include file paths that exceed a specified character limit from being pushed to the commit graph. +// Max_file_path_length > [!NOTE]> `max_file_path_length` is in beta and subject to change.Prevent commits that include file paths that exceed a specified character limit from being pushed to the commit graph. type Max_file_path_length struct { // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. additionalData map[string]any diff --git a/pkg/github/models/max_file_size.go b/pkg/github/models/max_file_size.go index 9bf5bb59..e1c7ff95 100644 --- a/pkg/github/models/max_file_size.go +++ b/pkg/github/models/max_file_size.go @@ -4,7 +4,7 @@ import ( i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" ) -// Max_file_size note: max_file_size is in beta and subject to change.Prevent commits that exceed a specified file size limit from being pushed to the commit. +// Max_file_size > [!NOTE]> `max_file_size` is in beta and subject to change.Prevent commits that exceed a specified file size limit from being pushed to the commit. type Max_file_size struct { // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. additionalData map[string]any diff --git a/pkg/github/models/repository_rule.go b/pkg/github/models/repository_rule.go index 64a538ba..88d9ff47 100644 --- a/pkg/github/models/repository_rule.go +++ b/pkg/github/models/repository_rule.go @@ -4,7 +4,7 @@ import ( i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" ) -// RepositoryRule composed type wrapper for classes File_extension_restrictionable, File_path_restrictionable, Max_file_path_lengthable, Max_file_sizeable, RepositoryRuleBranchNamePatternable, RepositoryRuleCodeScanningable, RepositoryRuleCommitAuthorEmailPatternable, RepositoryRuleCommitMessagePatternable, RepositoryRuleCommitterEmailPatternable, RepositoryRuleCreationable, RepositoryRuleDeletionable, RepositoryRuleNonFastForwardable, RepositoryRulePullRequestable, RepositoryRuleRequiredDeploymentsable, RepositoryRuleRequiredLinearHistoryable, RepositoryRuleRequiredSignaturesable, RepositoryRuleRequiredStatusChecksable, RepositoryRuleTagNamePatternable, RepositoryRuleUpdateable, RepositoryRuleWorkflowsable +// RepositoryRule composed type wrapper for classes File_extension_restrictionable, File_path_restrictionable, Max_file_path_lengthable, Max_file_sizeable, RepositoryRuleBranchNamePatternable, RepositoryRuleCodeScanningable, RepositoryRuleCommitAuthorEmailPatternable, RepositoryRuleCommitMessagePatternable, RepositoryRuleCommitterEmailPatternable, RepositoryRuleCreationable, RepositoryRuleDeletionable, RepositoryRuleMergeQueueable, RepositoryRuleNonFastForwardable, RepositoryRulePullRequestable, RepositoryRuleRequiredDeploymentsable, RepositoryRuleRequiredLinearHistoryable, RepositoryRuleRequiredSignaturesable, RepositoryRuleRequiredStatusChecksable, RepositoryRuleTagNamePatternable, RepositoryRuleUpdateable, RepositoryRuleWorkflowsable type RepositoryRule struct { // Composed type representation for type File_extension_restrictionable file_extension_restriction File_extension_restrictionable @@ -60,6 +60,8 @@ type RepositoryRule struct { repositoryRuleMax_file_size1 Max_file_sizeable // Composed type representation for type Max_file_sizeable repositoryRuleMax_file_size2 Max_file_sizeable + // Composed type representation for type RepositoryRuleMergeQueueable + repositoryRuleMergeQueue RepositoryRuleMergeQueueable // Composed type representation for type RepositoryRuleNonFastForwardable repositoryRuleNonFastForward RepositoryRuleNonFastForwardable // Composed type representation for type RepositoryRulePullRequestable @@ -120,6 +122,14 @@ type RepositoryRule struct { repositoryRuleRepositoryRuleDeletion1 RepositoryRuleDeletionable // Composed type representation for type RepositoryRuleDeletionable repositoryRuleRepositoryRuleDeletion2 RepositoryRuleDeletionable + // Composed type representation for type RepositoryRuleMergeQueueable + repositoryRuleRepositoryRuleMergeQueue RepositoryRuleMergeQueueable + // Composed type representation for type RepositoryRuleMergeQueueable + repositoryRuleRepositoryRuleMergeQueue0 RepositoryRuleMergeQueueable + // Composed type representation for type RepositoryRuleMergeQueueable + repositoryRuleRepositoryRuleMergeQueue1 RepositoryRuleMergeQueueable + // Composed type representation for type RepositoryRuleMergeQueueable + repositoryRuleRepositoryRuleMergeQueue2 RepositoryRuleMergeQueueable // Composed type representation for type RepositoryRuleNonFastForwardable repositoryRuleRepositoryRuleNonFastForward RepositoryRuleNonFastForwardable // Composed type representation for type RepositoryRuleNonFastForwardable @@ -378,6 +388,11 @@ func (m *RepositoryRule) GetRepositoryRuleMaxFileSize1()(Max_file_sizeable) { func (m *RepositoryRule) GetRepositoryRuleMaxFileSize2()(Max_file_sizeable) { return m.repositoryRuleMax_file_size2 } +// GetRepositoryRuleMergeQueue gets the repositoryRuleMergeQueue property value. Composed type representation for type RepositoryRuleMergeQueueable +// returns a RepositoryRuleMergeQueueable when successful +func (m *RepositoryRule) GetRepositoryRuleMergeQueue()(RepositoryRuleMergeQueueable) { + return m.repositoryRuleMergeQueue +} // GetRepositoryRuleNonFastForward gets the repositoryRuleNonFastForward property value. Composed type representation for type RepositoryRuleNonFastForwardable // returns a RepositoryRuleNonFastForwardable when successful func (m *RepositoryRule) GetRepositoryRuleNonFastForward()(RepositoryRuleNonFastForwardable) { @@ -528,6 +543,26 @@ func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleDeletion1()(RepositoryRu func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleDeletion2()(RepositoryRuleDeletionable) { return m.repositoryRuleRepositoryRuleDeletion2 } +// GetRepositoryRuleRepositoryRuleMergeQueue gets the repositoryRuleMergeQueue property value. Composed type representation for type RepositoryRuleMergeQueueable +// returns a RepositoryRuleMergeQueueable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleMergeQueue()(RepositoryRuleMergeQueueable) { + return m.repositoryRuleRepositoryRuleMergeQueue +} +// GetRepositoryRuleRepositoryRuleMergeQueue0 gets the repositoryRuleMergeQueue property value. Composed type representation for type RepositoryRuleMergeQueueable +// returns a RepositoryRuleMergeQueueable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleMergeQueue0()(RepositoryRuleMergeQueueable) { + return m.repositoryRuleRepositoryRuleMergeQueue0 +} +// GetRepositoryRuleRepositoryRuleMergeQueue1 gets the repositoryRuleMergeQueue property value. Composed type representation for type RepositoryRuleMergeQueueable +// returns a RepositoryRuleMergeQueueable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleMergeQueue1()(RepositoryRuleMergeQueueable) { + return m.repositoryRuleRepositoryRuleMergeQueue1 +} +// GetRepositoryRuleRepositoryRuleMergeQueue2 gets the repositoryRuleMergeQueue property value. Composed type representation for type RepositoryRuleMergeQueueable +// returns a RepositoryRuleMergeQueueable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleMergeQueue2()(RepositoryRuleMergeQueueable) { + return m.repositoryRuleRepositoryRuleMergeQueue2 +} // GetRepositoryRuleRepositoryRuleNonFastForward gets the repositoryRuleNonFastForward property value. Composed type representation for type RepositoryRuleNonFastForwardable // returns a RepositoryRuleNonFastForwardable when successful func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleNonFastForward()(RepositoryRuleNonFastForwardable) { @@ -880,6 +915,11 @@ func (m *RepositoryRule) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a if err != nil { return err } + } else if m.GetRepositoryRuleMergeQueue() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleMergeQueue()) + if err != nil { + return err + } } else if m.GetRepositoryRuleNonFastForward() != nil { err := writer.WriteObjectValue("", m.GetRepositoryRuleNonFastForward()) if err != nil { @@ -1030,6 +1070,26 @@ func (m *RepositoryRule) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a if err != nil { return err } + } else if m.GetRepositoryRuleRepositoryRuleMergeQueue() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleMergeQueue()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleMergeQueue0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleMergeQueue0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleMergeQueue1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleMergeQueue1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleMergeQueue2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleMergeQueue2()) + if err != nil { + return err + } } else if m.GetRepositoryRuleRepositoryRuleNonFastForward() != nil { err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleNonFastForward()) if err != nil { @@ -1356,6 +1416,10 @@ func (m *RepositoryRule) SetRepositoryRuleMaxFileSize1(value Max_file_sizeable)( func (m *RepositoryRule) SetRepositoryRuleMaxFileSize2(value Max_file_sizeable)() { m.repositoryRuleMax_file_size2 = value } +// SetRepositoryRuleMergeQueue sets the repositoryRuleMergeQueue property value. Composed type representation for type RepositoryRuleMergeQueueable +func (m *RepositoryRule) SetRepositoryRuleMergeQueue(value RepositoryRuleMergeQueueable)() { + m.repositoryRuleMergeQueue = value +} // SetRepositoryRuleNonFastForward sets the repositoryRuleNonFastForward property value. Composed type representation for type RepositoryRuleNonFastForwardable func (m *RepositoryRule) SetRepositoryRuleNonFastForward(value RepositoryRuleNonFastForwardable)() { m.repositoryRuleNonFastForward = value @@ -1476,6 +1540,22 @@ func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleDeletion1(value Reposito func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleDeletion2(value RepositoryRuleDeletionable)() { m.repositoryRuleRepositoryRuleDeletion2 = value } +// SetRepositoryRuleRepositoryRuleMergeQueue sets the repositoryRuleMergeQueue property value. Composed type representation for type RepositoryRuleMergeQueueable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleMergeQueue(value RepositoryRuleMergeQueueable)() { + m.repositoryRuleRepositoryRuleMergeQueue = value +} +// SetRepositoryRuleRepositoryRuleMergeQueue0 sets the repositoryRuleMergeQueue property value. Composed type representation for type RepositoryRuleMergeQueueable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleMergeQueue0(value RepositoryRuleMergeQueueable)() { + m.repositoryRuleRepositoryRuleMergeQueue0 = value +} +// SetRepositoryRuleRepositoryRuleMergeQueue1 sets the repositoryRuleMergeQueue property value. Composed type representation for type RepositoryRuleMergeQueueable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleMergeQueue1(value RepositoryRuleMergeQueueable)() { + m.repositoryRuleRepositoryRuleMergeQueue1 = value +} +// SetRepositoryRuleRepositoryRuleMergeQueue2 sets the repositoryRuleMergeQueue property value. Composed type representation for type RepositoryRuleMergeQueueable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleMergeQueue2(value RepositoryRuleMergeQueueable)() { + m.repositoryRuleRepositoryRuleMergeQueue2 = value +} // SetRepositoryRuleRepositoryRuleNonFastForward sets the repositoryRuleNonFastForward property value. Composed type representation for type RepositoryRuleNonFastForwardable func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleNonFastForward(value RepositoryRuleNonFastForwardable)() { m.repositoryRuleRepositoryRuleNonFastForward = value @@ -1677,6 +1757,7 @@ type RepositoryRuleable interface { GetRepositoryRuleMaxFileSize0()(Max_file_sizeable) GetRepositoryRuleMaxFileSize1()(Max_file_sizeable) GetRepositoryRuleMaxFileSize2()(Max_file_sizeable) + GetRepositoryRuleMergeQueue()(RepositoryRuleMergeQueueable) GetRepositoryRuleNonFastForward()(RepositoryRuleNonFastForwardable) GetRepositoryRulePullRequest()(RepositoryRulePullRequestable) GetRepositoryRuleRepositoryRuleBranchNamePattern()(RepositoryRuleBranchNamePatternable) @@ -1707,6 +1788,10 @@ type RepositoryRuleable interface { GetRepositoryRuleRepositoryRuleDeletion0()(RepositoryRuleDeletionable) GetRepositoryRuleRepositoryRuleDeletion1()(RepositoryRuleDeletionable) GetRepositoryRuleRepositoryRuleDeletion2()(RepositoryRuleDeletionable) + GetRepositoryRuleRepositoryRuleMergeQueue()(RepositoryRuleMergeQueueable) + GetRepositoryRuleRepositoryRuleMergeQueue0()(RepositoryRuleMergeQueueable) + GetRepositoryRuleRepositoryRuleMergeQueue1()(RepositoryRuleMergeQueueable) + GetRepositoryRuleRepositoryRuleMergeQueue2()(RepositoryRuleMergeQueueable) GetRepositoryRuleRepositoryRuleNonFastForward()(RepositoryRuleNonFastForwardable) GetRepositoryRuleRepositoryRuleNonFastForward0()(RepositoryRuleNonFastForwardable) GetRepositoryRuleRepositoryRuleNonFastForward1()(RepositoryRuleNonFastForwardable) @@ -1777,6 +1862,7 @@ type RepositoryRuleable interface { SetRepositoryRuleMaxFileSize0(value Max_file_sizeable)() SetRepositoryRuleMaxFileSize1(value Max_file_sizeable)() SetRepositoryRuleMaxFileSize2(value Max_file_sizeable)() + SetRepositoryRuleMergeQueue(value RepositoryRuleMergeQueueable)() SetRepositoryRuleNonFastForward(value RepositoryRuleNonFastForwardable)() SetRepositoryRulePullRequest(value RepositoryRulePullRequestable)() SetRepositoryRuleRepositoryRuleBranchNamePattern(value RepositoryRuleBranchNamePatternable)() @@ -1807,6 +1893,10 @@ type RepositoryRuleable interface { SetRepositoryRuleRepositoryRuleDeletion0(value RepositoryRuleDeletionable)() SetRepositoryRuleRepositoryRuleDeletion1(value RepositoryRuleDeletionable)() SetRepositoryRuleRepositoryRuleDeletion2(value RepositoryRuleDeletionable)() + SetRepositoryRuleRepositoryRuleMergeQueue(value RepositoryRuleMergeQueueable)() + SetRepositoryRuleRepositoryRuleMergeQueue0(value RepositoryRuleMergeQueueable)() + SetRepositoryRuleRepositoryRuleMergeQueue1(value RepositoryRuleMergeQueueable)() + SetRepositoryRuleRepositoryRuleMergeQueue2(value RepositoryRuleMergeQueueable)() SetRepositoryRuleRepositoryRuleNonFastForward(value RepositoryRuleNonFastForwardable)() SetRepositoryRuleRepositoryRuleNonFastForward0(value RepositoryRuleNonFastForwardable)() SetRepositoryRuleRepositoryRuleNonFastForward1(value RepositoryRuleNonFastForwardable)() diff --git a/pkg/github/models/repository_rule_merge_queue.go b/pkg/github/models/repository_rule_merge_queue.go new file mode 100644 index 00000000..3e05c01d --- /dev/null +++ b/pkg/github/models/repository_rule_merge_queue.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleMergeQueue merges must be performed via a merge queue. +type RepositoryRuleMergeQueue 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 parameters property + parameters RepositoryRuleMergeQueue_parametersable + // The type property + typeEscaped *RepositoryRuleMergeQueue_type +} +// NewRepositoryRuleMergeQueue instantiates a new RepositoryRuleMergeQueue and sets the default values. +func NewRepositoryRuleMergeQueue()(*RepositoryRuleMergeQueue) { + m := &RepositoryRuleMergeQueue{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleMergeQueueFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleMergeQueueFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleMergeQueue(), 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 *RepositoryRuleMergeQueue) 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 *RepositoryRuleMergeQueue) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleMergeQueue_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleMergeQueue_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleMergeQueue_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleMergeQueue_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleMergeQueue_parametersable when successful +func (m *RepositoryRuleMergeQueue) GetParameters()(RepositoryRuleMergeQueue_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleMergeQueue_type when successful +func (m *RepositoryRuleMergeQueue) GetTypeEscaped()(*RepositoryRuleMergeQueue_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleMergeQueue) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &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 *RepositoryRuleMergeQueue) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleMergeQueue) SetParameters(value RepositoryRuleMergeQueue_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleMergeQueue) SetTypeEscaped(value *RepositoryRuleMergeQueue_type)() { + m.typeEscaped = value +} +type RepositoryRuleMergeQueueable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleMergeQueue_parametersable) + GetTypeEscaped()(*RepositoryRuleMergeQueue_type) + SetParameters(value RepositoryRuleMergeQueue_parametersable)() + SetTypeEscaped(value *RepositoryRuleMergeQueue_type)() +} diff --git a/pkg/github/models/repository_rule_merge_queue_parameters.go b/pkg/github/models/repository_rule_merge_queue_parameters.go new file mode 100644 index 00000000..4f7ab423 --- /dev/null +++ b/pkg/github/models/repository_rule_merge_queue_parameters.go @@ -0,0 +1,256 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleMergeQueue_parameters struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Maximum time for a required status check to report a conclusion. After this much time has elapsed, checks that have not reported a conclusion will be assumed to have failed + check_response_timeout_minutes *int32 + // When set to ALLGREEN, the merge commit created by merge queue for each PR in the group must pass all required checks to merge. When set to HEADGREEN, only the commit at the head of the merge group, i.e. the commit containing changes from all of the PRs in the group, must pass its required checks to merge. + grouping_strategy *RepositoryRuleMergeQueue_parameters_grouping_strategy + // Limit the number of queued pull requests requesting checks and workflow runs at the same time. + max_entries_to_build *int32 + // The maximum number of PRs that will be merged together in a group. + max_entries_to_merge *int32 + // Method to use when merging changes from queued pull requests. + merge_method *RepositoryRuleMergeQueue_parameters_merge_method + // The minimum number of PRs that will be merged together in a group. + min_entries_to_merge *int32 + // The time merge queue should wait after the first PR is added to the queue for the minimum group size to be met. After this time has elapsed, the minimum group size will be ignored and a smaller group will be merged. + min_entries_to_merge_wait_minutes *int32 +} +// NewRepositoryRuleMergeQueue_parameters instantiates a new RepositoryRuleMergeQueue_parameters and sets the default values. +func NewRepositoryRuleMergeQueue_parameters()(*RepositoryRuleMergeQueue_parameters) { + m := &RepositoryRuleMergeQueue_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleMergeQueue_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleMergeQueue_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleMergeQueue_parameters(), 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 *RepositoryRuleMergeQueue_parameters) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCheckResponseTimeoutMinutes gets the check_response_timeout_minutes property value. Maximum time for a required status check to report a conclusion. After this much time has elapsed, checks that have not reported a conclusion will be assumed to have failed +// returns a *int32 when successful +func (m *RepositoryRuleMergeQueue_parameters) GetCheckResponseTimeoutMinutes()(*int32) { + return m.check_response_timeout_minutes +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleMergeQueue_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["check_response_timeout_minutes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCheckResponseTimeoutMinutes(val) + } + return nil + } + res["grouping_strategy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleMergeQueue_parameters_grouping_strategy) + if err != nil { + return err + } + if val != nil { + m.SetGroupingStrategy(val.(*RepositoryRuleMergeQueue_parameters_grouping_strategy)) + } + return nil + } + res["max_entries_to_build"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMaxEntriesToBuild(val) + } + return nil + } + res["max_entries_to_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMaxEntriesToMerge(val) + } + return nil + } + res["merge_method"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleMergeQueue_parameters_merge_method) + if err != nil { + return err + } + if val != nil { + m.SetMergeMethod(val.(*RepositoryRuleMergeQueue_parameters_merge_method)) + } + return nil + } + res["min_entries_to_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMinEntriesToMerge(val) + } + return nil + } + res["min_entries_to_merge_wait_minutes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMinEntriesToMergeWaitMinutes(val) + } + return nil + } + return res +} +// GetGroupingStrategy gets the grouping_strategy property value. When set to ALLGREEN, the merge commit created by merge queue for each PR in the group must pass all required checks to merge. When set to HEADGREEN, only the commit at the head of the merge group, i.e. the commit containing changes from all of the PRs in the group, must pass its required checks to merge. +// returns a *RepositoryRuleMergeQueue_parameters_grouping_strategy when successful +func (m *RepositoryRuleMergeQueue_parameters) GetGroupingStrategy()(*RepositoryRuleMergeQueue_parameters_grouping_strategy) { + return m.grouping_strategy +} +// GetMaxEntriesToBuild gets the max_entries_to_build property value. Limit the number of queued pull requests requesting checks and workflow runs at the same time. +// returns a *int32 when successful +func (m *RepositoryRuleMergeQueue_parameters) GetMaxEntriesToBuild()(*int32) { + return m.max_entries_to_build +} +// GetMaxEntriesToMerge gets the max_entries_to_merge property value. The maximum number of PRs that will be merged together in a group. +// returns a *int32 when successful +func (m *RepositoryRuleMergeQueue_parameters) GetMaxEntriesToMerge()(*int32) { + return m.max_entries_to_merge +} +// GetMergeMethod gets the merge_method property value. Method to use when merging changes from queued pull requests. +// returns a *RepositoryRuleMergeQueue_parameters_merge_method when successful +func (m *RepositoryRuleMergeQueue_parameters) GetMergeMethod()(*RepositoryRuleMergeQueue_parameters_merge_method) { + return m.merge_method +} +// GetMinEntriesToMerge gets the min_entries_to_merge property value. The minimum number of PRs that will be merged together in a group. +// returns a *int32 when successful +func (m *RepositoryRuleMergeQueue_parameters) GetMinEntriesToMerge()(*int32) { + return m.min_entries_to_merge +} +// GetMinEntriesToMergeWaitMinutes gets the min_entries_to_merge_wait_minutes property value. The time merge queue should wait after the first PR is added to the queue for the minimum group size to be met. After this time has elapsed, the minimum group size will be ignored and a smaller group will be merged. +// returns a *int32 when successful +func (m *RepositoryRuleMergeQueue_parameters) GetMinEntriesToMergeWaitMinutes()(*int32) { + return m.min_entries_to_merge_wait_minutes +} +// Serialize serializes information the current object +func (m *RepositoryRuleMergeQueue_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("check_response_timeout_minutes", m.GetCheckResponseTimeoutMinutes()) + if err != nil { + return err + } + } + if m.GetGroupingStrategy() != nil { + cast := (*m.GetGroupingStrategy()).String() + err := writer.WriteStringValue("grouping_strategy", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("max_entries_to_build", m.GetMaxEntriesToBuild()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("max_entries_to_merge", m.GetMaxEntriesToMerge()) + if err != nil { + return err + } + } + if m.GetMergeMethod() != nil { + cast := (*m.GetMergeMethod()).String() + err := writer.WriteStringValue("merge_method", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("min_entries_to_merge", m.GetMinEntriesToMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("min_entries_to_merge_wait_minutes", m.GetMinEntriesToMergeWaitMinutes()) + 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 *RepositoryRuleMergeQueue_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCheckResponseTimeoutMinutes sets the check_response_timeout_minutes property value. Maximum time for a required status check to report a conclusion. After this much time has elapsed, checks that have not reported a conclusion will be assumed to have failed +func (m *RepositoryRuleMergeQueue_parameters) SetCheckResponseTimeoutMinutes(value *int32)() { + m.check_response_timeout_minutes = value +} +// SetGroupingStrategy sets the grouping_strategy property value. When set to ALLGREEN, the merge commit created by merge queue for each PR in the group must pass all required checks to merge. When set to HEADGREEN, only the commit at the head of the merge group, i.e. the commit containing changes from all of the PRs in the group, must pass its required checks to merge. +func (m *RepositoryRuleMergeQueue_parameters) SetGroupingStrategy(value *RepositoryRuleMergeQueue_parameters_grouping_strategy)() { + m.grouping_strategy = value +} +// SetMaxEntriesToBuild sets the max_entries_to_build property value. Limit the number of queued pull requests requesting checks and workflow runs at the same time. +func (m *RepositoryRuleMergeQueue_parameters) SetMaxEntriesToBuild(value *int32)() { + m.max_entries_to_build = value +} +// SetMaxEntriesToMerge sets the max_entries_to_merge property value. The maximum number of PRs that will be merged together in a group. +func (m *RepositoryRuleMergeQueue_parameters) SetMaxEntriesToMerge(value *int32)() { + m.max_entries_to_merge = value +} +// SetMergeMethod sets the merge_method property value. Method to use when merging changes from queued pull requests. +func (m *RepositoryRuleMergeQueue_parameters) SetMergeMethod(value *RepositoryRuleMergeQueue_parameters_merge_method)() { + m.merge_method = value +} +// SetMinEntriesToMerge sets the min_entries_to_merge property value. The minimum number of PRs that will be merged together in a group. +func (m *RepositoryRuleMergeQueue_parameters) SetMinEntriesToMerge(value *int32)() { + m.min_entries_to_merge = value +} +// SetMinEntriesToMergeWaitMinutes sets the min_entries_to_merge_wait_minutes property value. The time merge queue should wait after the first PR is added to the queue for the minimum group size to be met. After this time has elapsed, the minimum group size will be ignored and a smaller group will be merged. +func (m *RepositoryRuleMergeQueue_parameters) SetMinEntriesToMergeWaitMinutes(value *int32)() { + m.min_entries_to_merge_wait_minutes = value +} +type RepositoryRuleMergeQueue_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCheckResponseTimeoutMinutes()(*int32) + GetGroupingStrategy()(*RepositoryRuleMergeQueue_parameters_grouping_strategy) + GetMaxEntriesToBuild()(*int32) + GetMaxEntriesToMerge()(*int32) + GetMergeMethod()(*RepositoryRuleMergeQueue_parameters_merge_method) + GetMinEntriesToMerge()(*int32) + GetMinEntriesToMergeWaitMinutes()(*int32) + SetCheckResponseTimeoutMinutes(value *int32)() + SetGroupingStrategy(value *RepositoryRuleMergeQueue_parameters_grouping_strategy)() + SetMaxEntriesToBuild(value *int32)() + SetMaxEntriesToMerge(value *int32)() + SetMergeMethod(value *RepositoryRuleMergeQueue_parameters_merge_method)() + SetMinEntriesToMerge(value *int32)() + SetMinEntriesToMergeWaitMinutes(value *int32)() +} diff --git a/pkg/github/models/repository_rule_merge_queue_parameters_grouping_strategy.go b/pkg/github/models/repository_rule_merge_queue_parameters_grouping_strategy.go new file mode 100644 index 00000000..03c59b15 --- /dev/null +++ b/pkg/github/models/repository_rule_merge_queue_parameters_grouping_strategy.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// When set to ALLGREEN, the merge commit created by merge queue for each PR in the group must pass all required checks to merge. When set to HEADGREEN, only the commit at the head of the merge group, i.e. the commit containing changes from all of the PRs in the group, must pass its required checks to merge. +type RepositoryRuleMergeQueue_parameters_grouping_strategy int + +const ( + ALLGREEN_REPOSITORYRULEMERGEQUEUE_PARAMETERS_GROUPING_STRATEGY RepositoryRuleMergeQueue_parameters_grouping_strategy = iota + HEADGREEN_REPOSITORYRULEMERGEQUEUE_PARAMETERS_GROUPING_STRATEGY +) + +func (i RepositoryRuleMergeQueue_parameters_grouping_strategy) String() string { + return []string{"ALLGREEN", "HEADGREEN"}[i] +} +func ParseRepositoryRuleMergeQueue_parameters_grouping_strategy(v string) (any, error) { + result := ALLGREEN_REPOSITORYRULEMERGEQUEUE_PARAMETERS_GROUPING_STRATEGY + switch v { + case "ALLGREEN": + result = ALLGREEN_REPOSITORYRULEMERGEQUEUE_PARAMETERS_GROUPING_STRATEGY + case "HEADGREEN": + result = HEADGREEN_REPOSITORYRULEMERGEQUEUE_PARAMETERS_GROUPING_STRATEGY + default: + return 0, errors.New("Unknown RepositoryRuleMergeQueue_parameters_grouping_strategy value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleMergeQueue_parameters_grouping_strategy(values []RepositoryRuleMergeQueue_parameters_grouping_strategy) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleMergeQueue_parameters_grouping_strategy) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_merge_queue_parameters_merge_method.go b/pkg/github/models/repository_rule_merge_queue_parameters_merge_method.go new file mode 100644 index 00000000..5f4055bf --- /dev/null +++ b/pkg/github/models/repository_rule_merge_queue_parameters_merge_method.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// Method to use when merging changes from queued pull requests. +type RepositoryRuleMergeQueue_parameters_merge_method int + +const ( + MERGE_REPOSITORYRULEMERGEQUEUE_PARAMETERS_MERGE_METHOD RepositoryRuleMergeQueue_parameters_merge_method = iota + SQUASH_REPOSITORYRULEMERGEQUEUE_PARAMETERS_MERGE_METHOD + REBASE_REPOSITORYRULEMERGEQUEUE_PARAMETERS_MERGE_METHOD +) + +func (i RepositoryRuleMergeQueue_parameters_merge_method) String() string { + return []string{"MERGE", "SQUASH", "REBASE"}[i] +} +func ParseRepositoryRuleMergeQueue_parameters_merge_method(v string) (any, error) { + result := MERGE_REPOSITORYRULEMERGEQUEUE_PARAMETERS_MERGE_METHOD + switch v { + case "MERGE": + result = MERGE_REPOSITORYRULEMERGEQUEUE_PARAMETERS_MERGE_METHOD + case "SQUASH": + result = SQUASH_REPOSITORYRULEMERGEQUEUE_PARAMETERS_MERGE_METHOD + case "REBASE": + result = REBASE_REPOSITORYRULEMERGEQUEUE_PARAMETERS_MERGE_METHOD + default: + return 0, errors.New("Unknown RepositoryRuleMergeQueue_parameters_merge_method value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleMergeQueue_parameters_merge_method(values []RepositoryRuleMergeQueue_parameters_merge_method) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleMergeQueue_parameters_merge_method) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_merge_queue_type.go b/pkg/github/models/repository_rule_merge_queue_type.go new file mode 100644 index 00000000..7a88fd54 --- /dev/null +++ b/pkg/github/models/repository_rule_merge_queue_type.go @@ -0,0 +1,33 @@ +package models +import ( + "errors" +) +type RepositoryRuleMergeQueue_type int + +const ( + MERGE_QUEUE_REPOSITORYRULEMERGEQUEUE_TYPE RepositoryRuleMergeQueue_type = iota +) + +func (i RepositoryRuleMergeQueue_type) String() string { + return []string{"merge_queue"}[i] +} +func ParseRepositoryRuleMergeQueue_type(v string) (any, error) { + result := MERGE_QUEUE_REPOSITORYRULEMERGEQUEUE_TYPE + switch v { + case "merge_queue": + result = MERGE_QUEUE_REPOSITORYRULEMERGEQUEUE_TYPE + default: + return 0, errors.New("Unknown RepositoryRuleMergeQueue_type value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleMergeQueue_type(values []RepositoryRuleMergeQueue_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleMergeQueue_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_required_status_checks_parameters.go b/pkg/github/models/repository_rule_required_status_checks_parameters.go index 5187b3d2..d0772451 100644 --- a/pkg/github/models/repository_rule_required_status_checks_parameters.go +++ b/pkg/github/models/repository_rule_required_status_checks_parameters.go @@ -7,6 +7,8 @@ import ( type RepositoryRuleRequiredStatusChecks_parameters struct { // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. additionalData map[string]any + // Allow repositories and branches to be created if a check would otherwise prohibit it. + do_not_enforce_on_create *bool // Status checks that are required. required_status_checks []RepositoryRuleParamsStatusCheckConfigurationable // Whether pull requests targeting a matching branch must be tested with the latest code. This setting will not take effect unless at least one status check is enabled. @@ -29,10 +31,25 @@ func CreateRepositoryRuleRequiredStatusChecks_parametersFromDiscriminatorValue(p func (m *RepositoryRuleRequiredStatusChecks_parameters) GetAdditionalData()(map[string]any) { return m.additionalData } +// GetDoNotEnforceOnCreate gets the do_not_enforce_on_create property value. Allow repositories and branches to be created if a check would otherwise prohibit it. +// returns a *bool when successful +func (m *RepositoryRuleRequiredStatusChecks_parameters) GetDoNotEnforceOnCreate()(*bool) { + return m.do_not_enforce_on_create +} // GetFieldDeserializers the deserialization information for the current model // returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful func (m *RepositoryRuleRequiredStatusChecks_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["do_not_enforce_on_create"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDoNotEnforceOnCreate(val) + } + return nil + } res["required_status_checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetCollectionOfObjectValues(CreateRepositoryRuleParamsStatusCheckConfigurationFromDiscriminatorValue) if err != nil { @@ -73,6 +90,12 @@ func (m *RepositoryRuleRequiredStatusChecks_parameters) GetStrictRequiredStatusC } // Serialize serializes information the current object func (m *RepositoryRuleRequiredStatusChecks_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("do_not_enforce_on_create", m.GetDoNotEnforceOnCreate()) + if err != nil { + return err + } + } if m.GetRequiredStatusChecks() != nil { cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRequiredStatusChecks())) for i, v := range m.GetRequiredStatusChecks() { @@ -103,6 +126,10 @@ func (m *RepositoryRuleRequiredStatusChecks_parameters) Serialize(writer i878a80 func (m *RepositoryRuleRequiredStatusChecks_parameters) SetAdditionalData(value map[string]any)() { m.additionalData = value } +// SetDoNotEnforceOnCreate sets the do_not_enforce_on_create property value. Allow repositories and branches to be created if a check would otherwise prohibit it. +func (m *RepositoryRuleRequiredStatusChecks_parameters) SetDoNotEnforceOnCreate(value *bool)() { + m.do_not_enforce_on_create = value +} // SetRequiredStatusChecks sets the required_status_checks property value. Status checks that are required. func (m *RepositoryRuleRequiredStatusChecks_parameters) SetRequiredStatusChecks(value []RepositoryRuleParamsStatusCheckConfigurationable)() { m.required_status_checks = value @@ -114,8 +141,10 @@ func (m *RepositoryRuleRequiredStatusChecks_parameters) SetStrictRequiredStatusC type RepositoryRuleRequiredStatusChecks_parametersable interface { i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDoNotEnforceOnCreate()(*bool) GetRequiredStatusChecks()([]RepositoryRuleParamsStatusCheckConfigurationable) GetStrictRequiredStatusChecksPolicy()(*bool) + SetDoNotEnforceOnCreate(value *bool)() SetRequiredStatusChecks(value []RepositoryRuleParamsStatusCheckConfigurationable)() SetStrictRequiredStatusChecksPolicy(value *bool)() } diff --git a/pkg/github/models/repository_rule_workflows_parameters.go b/pkg/github/models/repository_rule_workflows_parameters.go index 0bbd8f89..47cefd91 100644 --- a/pkg/github/models/repository_rule_workflows_parameters.go +++ b/pkg/github/models/repository_rule_workflows_parameters.go @@ -7,6 +7,8 @@ import ( type RepositoryRuleWorkflows_parameters struct { // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. additionalData map[string]any + // Allow repositories and branches to be created if a check would otherwise prohibit it. + do_not_enforce_on_create *bool // Workflows that must pass for this rule to pass. workflows []RepositoryRuleParamsWorkflowFileReferenceable } @@ -27,10 +29,25 @@ func CreateRepositoryRuleWorkflows_parametersFromDiscriminatorValue(parseNode i8 func (m *RepositoryRuleWorkflows_parameters) GetAdditionalData()(map[string]any) { return m.additionalData } +// GetDoNotEnforceOnCreate gets the do_not_enforce_on_create property value. Allow repositories and branches to be created if a check would otherwise prohibit it. +// returns a *bool when successful +func (m *RepositoryRuleWorkflows_parameters) GetDoNotEnforceOnCreate()(*bool) { + return m.do_not_enforce_on_create +} // GetFieldDeserializers the deserialization information for the current model // returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful func (m *RepositoryRuleWorkflows_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["do_not_enforce_on_create"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDoNotEnforceOnCreate(val) + } + return nil + } res["workflows"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetCollectionOfObjectValues(CreateRepositoryRuleParamsWorkflowFileReferenceFromDiscriminatorValue) if err != nil { @@ -56,6 +73,12 @@ func (m *RepositoryRuleWorkflows_parameters) GetWorkflows()([]RepositoryRulePara } // Serialize serializes information the current object func (m *RepositoryRuleWorkflows_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("do_not_enforce_on_create", m.GetDoNotEnforceOnCreate()) + if err != nil { + return err + } + } if m.GetWorkflows() != nil { cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetWorkflows())) for i, v := range m.GetWorkflows() { @@ -80,6 +103,10 @@ func (m *RepositoryRuleWorkflows_parameters) Serialize(writer i878a80d2330e89d26 func (m *RepositoryRuleWorkflows_parameters) SetAdditionalData(value map[string]any)() { m.additionalData = value } +// SetDoNotEnforceOnCreate sets the do_not_enforce_on_create property value. Allow repositories and branches to be created if a check would otherwise prohibit it. +func (m *RepositoryRuleWorkflows_parameters) SetDoNotEnforceOnCreate(value *bool)() { + m.do_not_enforce_on_create = value +} // SetWorkflows sets the workflows property value. Workflows that must pass for this rule to pass. func (m *RepositoryRuleWorkflows_parameters) SetWorkflows(value []RepositoryRuleParamsWorkflowFileReferenceable)() { m.workflows = value @@ -87,6 +114,8 @@ func (m *RepositoryRuleWorkflows_parameters) SetWorkflows(value []RepositoryRule type RepositoryRuleWorkflows_parametersable interface { i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDoNotEnforceOnCreate()(*bool) GetWorkflows()([]RepositoryRuleParamsWorkflowFileReferenceable) + SetDoNotEnforceOnCreate(value *bool)() SetWorkflows(value []RepositoryRuleParamsWorkflowFileReferenceable)() } diff --git a/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_enforcement.go b/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_enforcement.go index 73d1b678..9c60d0c8 100644 --- a/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_enforcement.go +++ b/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_enforcement.go @@ -2,7 +2,7 @@ package configurations import ( "errors" ) -// The status of enforcement +// The enforcement status for a security configuration type ConfigurationsPostRequestBody_enforcement int const ( diff --git a/pkg/github/orgs/item/codesecurity/configurations/item/with_configuration_patch_request_body_enforcement.go b/pkg/github/orgs/item/codesecurity/configurations/item/with_configuration_patch_request_body_enforcement.go index 8240acff..2fdb80ce 100644 --- a/pkg/github/orgs/item/codesecurity/configurations/item/with_configuration_patch_request_body_enforcement.go +++ b/pkg/github/orgs/item/codesecurity/configurations/item/with_configuration_patch_request_body_enforcement.go @@ -2,7 +2,7 @@ package item import ( "errors" ) -// The status of enforcement +// The enforcement status for a security configuration type WithConfiguration_PatchRequestBody_enforcement int const ( diff --git a/pkg/github/orgs/item_code_security_configurations_item_repositories_request_builder.go b/pkg/github/orgs/item_code_security_configurations_item_repositories_request_builder.go index e34a6bf9..03000808 100644 --- a/pkg/github/orgs/item_code_security_configurations_item_repositories_request_builder.go +++ b/pkg/github/orgs/item_code_security_configurations_item_repositories_request_builder.go @@ -18,7 +18,7 @@ type ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilderGetQueryParamet Before *string `uriparametername:"before"` // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." Per_page *int32 `uriparametername:"per_page"` - // A comma-separated list of statuses. If specified, only repositories with these attachment statuses will be returned.Can be: `all`, `attached`, `attaching`, `detached`, `enforced`, `failed`, `updating` + // A comma-separated list of statuses. If specified, only repositories with these attachment statuses will be returned.Can be: `all`, `attached`, `attaching`, `detached`, `removed`, `enforced`, `failed`, `updating`, `removed_by_enterprise` Status *string `uriparametername:"status"` } // NewItemCodeSecurityConfigurationsItemRepositoriesRequestBuilderInternal instantiates a new ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder and sets the default values. From a9ee6f02d7c4736593553decd961609e8484dd60 Mon Sep 17 00:00:00 2001 From: Octokit Bot Date: Fri, 26 Jul 2024 00:07:57 +0000 Subject: [PATCH 3/4] New updates to generated code --- pkg/github/kiota-lock.json | 2 +- pkg/github/models/label.go | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pkg/github/kiota-lock.json b/pkg/github/kiota-lock.json index 0259b6be..81d38d99 100644 --- a/pkg/github/kiota-lock.json +++ b/pkg/github/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "7ECFD65586B744E83319DF0E73957BCA36AE996677673FEE71A46310209AB2B7209EAEADEB1B275AABF9911452C9E8AEC15A1119DF8C6FDCDED17C52F7FD9785", + "descriptionHash": "A9B113041EADA2541D3B59E31CF23870FA0A7627482597017CC50A2D390ACC44D4912594E27929B8F5F5412430B8482043A0FB536C5B2DD2CCEA0E941FCAC416", "descriptionLocation": "../../../../../schemas/api.github.com.json", "lockFileVersion": "1.0.0", "kiotaVersion": "1.14.0", diff --git a/pkg/github/models/label.go b/pkg/github/models/label.go index ba41053b..82986b47 100644 --- a/pkg/github/models/label.go +++ b/pkg/github/models/label.go @@ -10,11 +10,11 @@ type Label struct { additionalData map[string]any // 6-character hex code, without the leading #, identifying the color color *string - // The default property + // Whether this label comes by default in a new repository. defaultEscaped *bool - // The description property + // Optional description of the label, such as its purpose. description *string - // The id property + // Unique identifier for the label. id *int64 // The name of the label. name *string @@ -45,12 +45,12 @@ func (m *Label) GetAdditionalData()(map[string]any) { func (m *Label) GetColor()(*string) { return m.color } -// GetDefaultEscaped gets the default property value. The default property +// GetDefaultEscaped gets the default property value. Whether this label comes by default in a new repository. // returns a *bool when successful func (m *Label) GetDefaultEscaped()(*bool) { return m.defaultEscaped } -// GetDescription gets the description property value. The description property +// GetDescription gets the description property value. Optional description of the label, such as its purpose. // returns a *string when successful func (m *Label) GetDescription()(*string) { return m.description @@ -131,7 +131,7 @@ func (m *Label) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388 } return res } -// GetId gets the id property value. The id property +// GetId gets the id property value. Unique identifier for the label. // returns a *int64 when successful func (m *Label) GetId()(*int64) { return m.id @@ -211,15 +211,15 @@ func (m *Label) SetAdditionalData(value map[string]any)() { func (m *Label) SetColor(value *string)() { m.color = value } -// SetDefaultEscaped sets the default property value. The default property +// SetDefaultEscaped sets the default property value. Whether this label comes by default in a new repository. func (m *Label) SetDefaultEscaped(value *bool)() { m.defaultEscaped = value } -// SetDescription sets the description property value. The description property +// SetDescription sets the description property value. Optional description of the label, such as its purpose. func (m *Label) SetDescription(value *string)() { m.description = value } -// SetId sets the id property value. The id property +// SetId sets the id property value. Unique identifier for the label. func (m *Label) SetId(value *int64)() { m.id = value } From 425e8a01f5e933b140f431f6cd69095386c62b3b Mon Sep 17 00:00:00 2001 From: Octokit Bot Date: Sat, 27 Jul 2024 00:08:15 +0000 Subject: [PATCH 4/4] New updates to generated code --- pkg/client.go | 16 ++++++++++++---- pkg/github/kiota-lock.json | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/pkg/client.go b/pkg/client.go index 9538d96d..a8201321 100644 --- a/pkg/client.go +++ b/pkg/client.go @@ -16,7 +16,10 @@ import ( // Client (wrapper of *github.ApiClient) with the provided option functions. // By default, it includes a rate limiting middleware. func NewApiClient(optionFuncs ...ClientOptionFunc) (*Client, error) { - options := GetDefaultClientOptions() + options, err := GetDefaultClientOptions() + if err != nil { + return nil, fmt.Errorf("failed to get default client options: %v", err) + } for _, optionFunc := range optionFuncs { optionFunc(options) } @@ -118,12 +121,17 @@ type ClientOptions struct { // GetDefaultClientOptions returns a new instance of ClientOptions with default values. // This is used in the NewApiClient constructor before applying user-defined custom options. -func GetDefaultClientOptions() *ClientOptions { +func GetDefaultClientOptions() (*ClientOptions, error) { + turnOffCompression := kiotaHttp.NewCompressionOptions(false) + middlewares, err := kiotaHttp.GetDefaultMiddlewaresWithOptions(&turnOffCompression) + if err != nil { + return nil, fmt.Errorf("failed to get middleware with compression turned off: %v", err) + } return &ClientOptions{ UserAgent: "octokit/go-sdk", APIVersion: "2022-11-28", - Middleware: kiotaHttp.GetDefaultMiddlewares(), - } + Middleware: middlewares, + }, nil } // ClientOptionFunc provides a functional pattern for client configuration diff --git a/pkg/github/kiota-lock.json b/pkg/github/kiota-lock.json index 81d38d99..b6c25293 100644 --- a/pkg/github/kiota-lock.json +++ b/pkg/github/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "A9B113041EADA2541D3B59E31CF23870FA0A7627482597017CC50A2D390ACC44D4912594E27929B8F5F5412430B8482043A0FB536C5B2DD2CCEA0E941FCAC416", + "descriptionHash": "145BCDC18ADD0C8E2EC561562308D43480017AD06C35365B09A27C83A9E6AAA51A6AF94048AF9F372388146007325C1DB4ED2E86F5CBFCEAD3625FBFBE1F9D51", "descriptionLocation": "../../../../../schemas/api.github.com.json", "lockFileVersion": "1.0.0", "kiotaVersion": "1.14.0",