Skip to content

Commit

Permalink
feat: Adds BranchRestrictionPolicy [ClientId], docs updates, deps cha…
Browse files Browse the repository at this point in the history
…nges
  • Loading branch information
octokitbot authored Aug 21, 2024
1 parent 91fd590 commit 2c03a82
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 23 deletions.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ go 1.21.5

require (
github.com/kfcampbell/ghinstallation v0.0.6
github.com/microsoft/kiota-abstractions-go v1.6.1
github.com/microsoft/kiota-abstractions-go v1.6.0
github.com/microsoft/kiota-http-go v1.3.3
github.com/microsoft/kiota-serialization-form-go v1.0.0
github.com/microsoft/kiota-serialization-json-go v1.0.8
github.com/microsoft/kiota-serialization-json-go v1.0.7
github.com/microsoft/kiota-serialization-multipart-go v1.0.0
github.com/microsoft/kiota-serialization-text-go v1.0.0
)
Expand All @@ -20,7 +20,7 @@ require (
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/std-uritemplate/std-uritemplate/go v0.0.57 // indirect
github.com/std-uritemplate/std-uritemplate/go v0.0.55 // indirect
github.com/stretchr/testify v1.9.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@ github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/microsoft/kiota-abstractions-go v1.6.1 h1:NXK50S3BwJn9Wj6bO0YFuAig7y2WVgdQ/ie1ktMl2J4=
github.com/microsoft/kiota-abstractions-go v1.6.1/go.mod h1:FI1I2OHg0E7bK5t8DPnw+9C/CHVyLP6XeqDBT+95pTE=
github.com/microsoft/kiota-abstractions-go v1.6.0 h1:qbGBNMU0/o5myKbikCBXJFohVCFrrpx2cO15Rta2WyA=
github.com/microsoft/kiota-abstractions-go v1.6.0/go.mod h1:7YH20ZbRWXGfHSSvdHkdztzgCB9mRdtFx13+hrYIEpo=
github.com/microsoft/kiota-http-go v1.3.3 h1:FKjK5BLFONu5eIBxtrkirkixFQmcPwitZ8iwZHKbESo=
github.com/microsoft/kiota-http-go v1.3.3/go.mod h1:IWw/PwtBs/GYz+Pa75gPW7MFNFv0aKPFsLw5WqzL1SE=
github.com/microsoft/kiota-serialization-form-go v1.0.0 h1:UNdrkMnLFqUCccQZerKjblsyVgifS11b3WCx+eFEsAI=
github.com/microsoft/kiota-serialization-form-go v1.0.0/go.mod h1:h4mQOO6KVTNciMF6azi1J9QB19ujSw3ULKcSNyXXOMA=
github.com/microsoft/kiota-serialization-json-go v1.0.8 h1:+aViv9k6wqaw1Fx6P49fl5GIB1hN3b6CG0McNTcUYBc=
github.com/microsoft/kiota-serialization-json-go v1.0.8/go.mod h1:O8+v11U0EUwHlCz7hrW38KxDmdhKAHfv4Q89uvsBalY=
github.com/microsoft/kiota-serialization-json-go v1.0.7 h1:yMbckSTPrjZdM4EMXgzLZSA3CtDaUBI350u0VoYRz7Y=
github.com/microsoft/kiota-serialization-json-go v1.0.7/go.mod h1:1krrY7DYl3ivPIzl4xTaBpew6akYNa8/Tal8g+kb0cc=
github.com/microsoft/kiota-serialization-multipart-go v1.0.0 h1:3O5sb5Zj+moLBiJympbXNaeV07K0d46IfuEd5v9+pBs=
github.com/microsoft/kiota-serialization-multipart-go v1.0.0/go.mod h1:yauLeBTpANk4L03XD985akNysG24SnRJGaveZf+p4so=
github.com/microsoft/kiota-serialization-text-go v1.0.0 h1:XOaRhAXy+g8ZVpcq7x7a0jlETWnWrEum0RhmbYrTFnA=
github.com/microsoft/kiota-serialization-text-go v1.0.0/go.mod h1:sM1/C6ecnQ7IquQOGUrUldaO5wj+9+v7G2W3sQ3fy6M=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/std-uritemplate/std-uritemplate/go v0.0.57 h1:GHGjptrsmazP4IVDlUprssiEf9ESVkbjx15xQXXzvq4=
github.com/std-uritemplate/std-uritemplate/go v0.0.57/go.mod h1:rG/bqh/ThY4xE5de7Rap3vaDkYUT76B0GPJ0loYeTTc=
github.com/std-uritemplate/std-uritemplate/go v0.0.55 h1:muSH037g97K7U2f94G9LUuE8tZlJsoSSrPsO9V281WY=
github.com/std-uritemplate/std-uritemplate/go v0.0.55/go.mod h1:rG/bqh/ThY4xE5de7Rap3vaDkYUT76B0GPJ0loYeTTc=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
Expand Down
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/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/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 *i001db24e943d0f84422b7e2ee3ebec420ca587ebd5e378cf50225876c7468a70.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": "DE5F98C38ECED98D5584742BA57E5A4EEA75FB123B6EF6A8021C5C19974B56AB0EEB75E1D7E95381BEC1659E2E5AFB54B01F08415E091D6F17C4962867C7C64F",
"descriptionHash": "2A275CA0C1BC6884322B17DC1FC9558B61329DE5207AAB92506C0235D5002569BC7341E821733BED96F5763A9D461DB59AB267A12789BFB78632EAAA6AC0F41C",
"descriptionLocation": "../../../../../schemas/api.github.com.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/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/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 @@ -330,7 +330,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/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/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 @@ -512,7 +512,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/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/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/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/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 @@ -313,7 +313,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/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/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 @@ -485,7 +485,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/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/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
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,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/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/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 *i6bfc00bdb302bcd8be4fd093f881ba8f86d967800ec976c34a78d452c1f335d5.GetSortQueryParameterType `uriparametername:"sort"`
Expand Down
Loading

0 comments on commit 2c03a82

Please sign in to comment.