Skip to content

Commit

Permalink
feat: Adds BranchRestrictionPolicy [ClientId], Users [Fragment, Objec…
Browse files Browse the repository at this point in the history
…tType, ObjectUrl, Property], UserMatches [Indices, Text], docs updates (#43)

* New updates to generated code

* New updates to generated code
  • Loading branch information
octokitbot committed Aug 21, 2024
1 parent a0cce4b commit c41743f
Show file tree
Hide file tree
Showing 10 changed files with 2,154 additions and 2,234 deletions.
4,072 changes: 2,074 additions & 1,998 deletions pkg/github/.kiota.log

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type ItemSecretScanningAlertsRequestBuilderGetQueryParameters struct {
Per_page *int32 `uriparametername:"per_page"`
// A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`.
Resolution *string `uriparametername:"resolution"`
// A comma-separated list of secret types to return. By default all secret types are returned.See "[Secret scanning patterns](https://docs.github.com/[email protected]/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)"for a complete list of secret types.
// A comma-separated list of secret types to return. By default all secret types are returned.See "[Supported secret scanning patterns](https://docs.github.com/[email protected]/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)"for a complete list of secret types.
Secret_type *string `uriparametername:"secret_type"`
// The property to sort the results by. `created` means when the alert was created. `updated` means when the alert was updated or resolved.
Sort *ie731c1b19a2e5cc53591a2f3e26c1721bd2d17fb9da2b8efca9e1e81c4c05962.GetSortQueryParameterType `uriparametername:"sort"`
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": "3432CE051EB2E49BDF50641D87DB95EE4B4E1627CF6886161E5AADC33F9CA4664DD5EFD92682714391D22CAD05B5918F05BD4F45CB49FFF0EE99A0F62F3CB263",
"descriptionHash": "B3D378D8DE9B859E32369A2B38874093C09775DF03C7F342F05D4D4B9BAEB53E7138D2BEF4D11FB2D24E98E821AEC2B3834DCBF3837CA4FA86D219F754054951",
"descriptionLocation": "../../../../../schemas/ghes-3.10.json",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.14.0",
Expand Down
29 changes: 29 additions & 0 deletions pkg/github/models/branch_restriction_policy_apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
type BranchRestrictionPolicy_apps 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 client_id property
client_id *string
// The created_at property
created_at *string
// The description property
Expand Down Expand Up @@ -49,6 +51,11 @@ func CreateBranchRestrictionPolicy_appsFromDiscriminatorValue(parseNode i878a80d
func (m *BranchRestrictionPolicy_apps) GetAdditionalData()(map[string]any) {
return m.additionalData
}
// GetClientId gets the client_id property value. The client_id property
// returns a *string when successful
func (m *BranchRestrictionPolicy_apps) GetClientId()(*string) {
return m.client_id
}
// GetCreatedAt gets the created_at property value. The created_at property
// returns a *string when successful
func (m *BranchRestrictionPolicy_apps) GetCreatedAt()(*string) {
Expand All @@ -73,6 +80,16 @@ func (m *BranchRestrictionPolicy_apps) GetExternalUrl()(*string) {
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *BranchRestrictionPolicy_apps) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error))
res["client_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetClientId(val)
}
return nil
}
res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
Expand Down Expand Up @@ -243,6 +260,12 @@ func (m *BranchRestrictionPolicy_apps) GetUpdatedAt()(*string) {
}
// Serialize serializes information the current object
func (m *BranchRestrictionPolicy_apps) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
{
err := writer.WriteStringValue("client_id", m.GetClientId())
if err != nil {
return err
}
}
{
err := writer.WriteStringValue("created_at", m.GetCreatedAt())
if err != nil {
Expand Down Expand Up @@ -327,6 +350,10 @@ func (m *BranchRestrictionPolicy_apps) Serialize(writer i878a80d2330e89d26896388
func (m *BranchRestrictionPolicy_apps) SetAdditionalData(value map[string]any)() {
m.additionalData = value
}
// SetClientId sets the client_id property value. The client_id property
func (m *BranchRestrictionPolicy_apps) SetClientId(value *string)() {
m.client_id = value
}
// SetCreatedAt sets the created_at property value. The created_at property
func (m *BranchRestrictionPolicy_apps) SetCreatedAt(value *string)() {
m.created_at = value
Expand Down Expand Up @@ -378,6 +405,7 @@ func (m *BranchRestrictionPolicy_apps) SetUpdatedAt(value *string)() {
type BranchRestrictionPolicy_appsable interface {
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
GetClientId()(*string)
GetCreatedAt()(*string)
GetDescription()(*string)
GetEvents()([]string)
Expand All @@ -390,6 +418,7 @@ type BranchRestrictionPolicy_appsable interface {
GetPermissions()(BranchRestrictionPolicy_apps_permissionsable)
GetSlug()(*string)
GetUpdatedAt()(*string)
SetClientId(value *string)()
SetCreatedAt(value *string)()
SetDescription(value *string)()
SetEvents(value []string)()
Expand Down
6 changes: 3 additions & 3 deletions pkg/github/models/organization_secret_scanning_alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type OrganizationSecretScanningAlert struct {
secret *string
// The type of secret that secret scanning detected.
secret_type *string
// User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see "[Secret scanning patterns](https://docs.github.com/[email protected]/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)."
// User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see "[Supported secret scanning patterns](https://docs.github.com/[email protected]/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)."
secret_type_display_name *string
// Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`.
state *SecretScanningAlertState
Expand Down Expand Up @@ -318,7 +318,7 @@ func (m *OrganizationSecretScanningAlert) GetSecret()(*string) {
func (m *OrganizationSecretScanningAlert) GetSecretType()(*string) {
return m.secret_type
}
// GetSecretTypeDisplayName gets the secret_type_display_name property value. User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see "[Secret scanning patterns](https://docs.github.com/[email protected]/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)."
// GetSecretTypeDisplayName gets the secret_type_display_name property value. User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see "[Supported secret scanning patterns](https://docs.github.com/[email protected]/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)."
// returns a *string when successful
func (m *OrganizationSecretScanningAlert) GetSecretTypeDisplayName()(*string) {
return m.secret_type_display_name
Expand Down Expand Up @@ -488,7 +488,7 @@ func (m *OrganizationSecretScanningAlert) SetSecret(value *string)() {
func (m *OrganizationSecretScanningAlert) SetSecretType(value *string)() {
m.secret_type = value
}
// SetSecretTypeDisplayName sets the secret_type_display_name property value. User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see "[Secret scanning patterns](https://docs.github.com/[email protected]/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)."
// SetSecretTypeDisplayName sets the secret_type_display_name property value. User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see "[Supported secret scanning patterns](https://docs.github.com/[email protected]/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)."
func (m *OrganizationSecretScanningAlert) SetSecretTypeDisplayName(value *string)() {
m.secret_type_display_name = value
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/github/models/secret_scanning_alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type SecretScanningAlert struct {
secret *string
// The type of secret that secret scanning detected.
secret_type *string
// User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see "[Secret scanning patterns](https://docs.github.com/[email protected]/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)."
// User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see "[Supported secret scanning patterns](https://docs.github.com/[email protected]/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)."
secret_type_display_name *string
// Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`.
state *SecretScanningAlertState
Expand Down Expand Up @@ -301,7 +301,7 @@ func (m *SecretScanningAlert) GetSecret()(*string) {
func (m *SecretScanningAlert) GetSecretType()(*string) {
return m.secret_type
}
// GetSecretTypeDisplayName gets the secret_type_display_name property value. User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see "[Secret scanning patterns](https://docs.github.com/[email protected]/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)."
// GetSecretTypeDisplayName gets the secret_type_display_name property value. User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see "[Supported secret scanning patterns](https://docs.github.com/[email protected]/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)."
// returns a *string when successful
func (m *SecretScanningAlert) GetSecretTypeDisplayName()(*string) {
return m.secret_type_display_name
Expand Down Expand Up @@ -461,7 +461,7 @@ func (m *SecretScanningAlert) SetSecret(value *string)() {
func (m *SecretScanningAlert) SetSecretType(value *string)() {
m.secret_type = value
}
// SetSecretTypeDisplayName sets the secret_type_display_name property value. User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see "[Secret scanning patterns](https://docs.github.com/[email protected]/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)."
// SetSecretTypeDisplayName sets the secret_type_display_name property value. User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see "[Supported secret scanning patterns](https://docs.github.com/[email protected]/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)."
func (m *SecretScanningAlert) SetSecretTypeDisplayName(value *string)() {
m.secret_type_display_name = value
}
Expand Down
152 changes: 41 additions & 111 deletions pkg/github/models/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,12 @@ 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
// 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
// Whether this email address is the primary address.
primary *bool
// The type of email address.
typeEscaped *string
// The email address.
value *string
}
// NewUsers instantiates a new Users and sets the default values.
func NewUsers()(*Users) {
Expand All @@ -39,123 +35,69 @@ 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["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()
res["primary"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetBoolValue()
if err != nil {
return err
}
if val != nil {
m.SetObjectType(val)
m.SetPrimary(val)
}
return nil
}
res["object_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetObjectUrl(val)
m.SetTypeEscaped(val)
}
return nil
}
res["property"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetProperty(val)
m.SetValue(val)
}
return nil
}
return res
}
// 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
// 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
}
// GetObjectUrl gets the object_url property value. The object_url property
// GetTypeEscaped gets the type property value. The type of email address.
// returns a *string when successful
func (m *Users) GetObjectUrl()(*string) {
return m.object_url
func (m *Users) GetTypeEscaped()(*string) {
return m.typeEscaped
}
// GetProperty gets the property property value. The property property
// GetValue gets the value property value. The email address.
// returns a *string when successful
func (m *Users) GetProperty()(*string) {
return m.property
func (m *Users) GetValue()(*string) {
return m.value
}
// Serialize serializes information the current object
func (m *Users) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
{
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())
err := writer.WriteBoolValue("primary", m.GetPrimary())
if err != nil {
return err
}
}
{
err := writer.WriteStringValue("object_url", m.GetObjectUrl())
err := writer.WriteStringValue("type", m.GetTypeEscaped())
if err != nil {
return err
}
}
{
err := writer.WriteStringValue("property", m.GetProperty())
err := writer.WriteStringValue("value", m.GetValue())
if err != nil {
return err
}
Expand All @@ -172,37 +114,25 @@ func (m *Users) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c4
func (m *Users) SetAdditionalData(value map[string]any)() {
m.additionalData = 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
// SetPrimary sets the primary property value. Whether this email address is the primary address.
func (m *Users) SetPrimary(value *bool)() {
m.primary = value
}
// SetObjectUrl sets the object_url property value. The object_url property
func (m *Users) SetObjectUrl(value *string)() {
m.object_url = value
// SetTypeEscaped sets the type property value. The type of email address.
func (m *Users) SetTypeEscaped(value *string)() {
m.typeEscaped = value
}
// SetProperty sets the property property value. The property property
func (m *Users) SetProperty(value *string)() {
m.property = value
// SetValue sets the value property value. The email address.
func (m *Users) SetValue(value *string)() {
m.value = value
}
type Usersable interface {
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
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)()
GetPrimary()(*bool)
GetTypeEscaped()(*string)
GetValue()(*string)
SetPrimary(value *bool)()
SetTypeEscaped(value *string)()
SetValue(value *string)()
}
Loading

0 comments on commit c41743f

Please sign in to comment.