Skip to content

Commit

Permalink
Correct autogen overwrite routine (#154)
Browse files Browse the repository at this point in the history
* Correct autogen overwrite routine

* update replace filter pattern and regenerate

* adjust backoff routine for inconsistent role assignment def
  • Loading branch information
patrickcping authored Apr 24, 2023
1 parent 97f7523 commit 128580f
Show file tree
Hide file tree
Showing 32 changed files with 927 additions and 2 deletions.
12 changes: 12 additions & 0 deletions agreementmanagement/client_ext.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"log"
"net/http"
"regexp"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -92,11 +93,22 @@ func testForRetryable(r *http.Response, err error, currentBackoff time.Duration)
if err != nil {
if genericOAError, ok := err.(GenericOpenAPIError); ok && genericOAError.Model() != nil {
// We have an application level error

if modelError, ok := genericOAError.Model().(P1Error); ok {

// Test for unexpected errors
if strings.EqualFold(modelError.GetCode(), "UNEXPECTED_ERROR") {
log.Printf("Unexpected error detected, available for retry")
return backoff, true
}

// Test for inconsistent role state
m, _ := regexp.MatchString(`^Role assignment [a-z0-9\-]* cannot be deleted as it is read only`, modelError.GetMessage())

if m {
log.Printf("Inconsistent role assignment, available for retry")
return backoff, true
}
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions authorize/client_ext.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"log"
"net/http"
"regexp"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -92,11 +93,22 @@ func testForRetryable(r *http.Response, err error, currentBackoff time.Duration)
if err != nil {
if genericOAError, ok := err.(GenericOpenAPIError); ok && genericOAError.Model() != nil {
// We have an application level error

if modelError, ok := genericOAError.Model().(P1Error); ok {

// Test for unexpected errors
if strings.EqualFold(modelError.GetCode(), "UNEXPECTED_ERROR") {
log.Printf("Unexpected error detected, available for retry")
return backoff, true
}

// Test for inconsistent role state
m, _ := regexp.MatchString(`^Role assignment [a-z0-9\-]* cannot be deleted as it is read only`, modelError.GetMessage())

if m {
log.Printf("Inconsistent role assignment, available for retry")
return backoff, true
}
}
}
}
Expand Down
20 changes: 20 additions & 0 deletions management/api_active_identity_counts.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions management/api_applications.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions management/api_audit_activities.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions management/api_authentications_per_application.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions management/api_capabilities.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions management/api_gateways.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions management/api_integration_catalog.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 128580f

Please sign in to comment.