diff --git a/CHANGELOG.md b/CHANGELOG.md index 6383497d..8eaeab63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [5.0.7] - 2025-01-27 +### Fixed +- Enhanced error handling in API client retry logic by adding `resp.IsError()` check before returning responses. +- Fixed type definition in `RequestApplianceUpdateNetworkApplianceFirewallL3FirewallRules` struct by changing `Rules` field from `*[]RequestApplianceUpdateNetworkApplianceFirewallL3FirewallRulesRules` to `[]RequestApplianceUpdateNetworkApplianceFirewallL3FirewallRulesRules` (removed pointer from slice). + ## [5.0.6] - 2025-07-29 ### Added - Fix `port` type, from `*int` to `string`. @@ -1492,4 +1497,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [5.0.4]: https://github.com/meraki/dashboard-api-go/compare/v5.0.3...5.0.4 [5.0.5]: https://github.com/meraki/dashboard-api-go/compare/v5.0.4...5.0.5 [5.0.6]: https://github.com/meraki/dashboard-api-go/compare/v5.0.5...5.0.6 -[Unreleased]: https://github.com/meraki/dashboard-api-go/compare/v5.0.6...main \ No newline at end of file +[5.0.7]: https://github.com/meraki/dashboard-api-go/compare/v5.0.6...5.0.7 +[Unreleased]: https://github.com/meraki/dashboard-api-go/compare/v5.0.7...main \ No newline at end of file diff --git a/sdk/api_client.go b/sdk/api_client.go index 37cc72b6..92d6297e 100644 --- a/sdk/api_client.go +++ b/sdk/api_client.go @@ -719,6 +719,9 @@ func doWithRetriesAndNotResult( } if resp != nil && resp.StatusCode() != http.StatusTooManyRequests { + if resp.IsError() { + return resp, fmt.Errorf("error with operation: %s", resp.Request.URL) + } return resp, nil } diff --git a/sdk/appliance.go b/sdk/appliance.go index 994029fa..319b1516 100644 --- a/sdk/appliance.go +++ b/sdk/appliance.go @@ -2428,8 +2428,8 @@ type RequestApplianceUpdateNetworkApplianceFirewallInboundFirewallRulesRules str SyslogEnabled *bool `json:"syslogEnabled,omitempty"` // Log this rule to syslog (true or false, boolean value) - only applicable if a syslog has been configured (optional) } type RequestApplianceUpdateNetworkApplianceFirewallL3FirewallRules struct { - Rules *[]RequestApplianceUpdateNetworkApplianceFirewallL3FirewallRulesRules `json:"rules,omitempty"` // An ordered array of the firewall rules (not including the default rule) - SyslogDefaultRule *bool `json:"syslogDefaultRule,omitempty"` // Log the special default rule (boolean value - enable only if you've configured a syslog server) (optional) + Rules []RequestApplianceUpdateNetworkApplianceFirewallL3FirewallRulesRules `json:"rules"` // An ordered array of the firewall rules (not including the default rule) + SyslogDefaultRule *bool `json:"syslogDefaultRule,omitempty"` // Log the special default rule (boolean value - enable only if you've configured a syslog server) (optional) } type RequestApplianceUpdateNetworkApplianceFirewallL3FirewallRulesRules struct { Comment string `json:"comment,omitempty"` // Description of the rule (optional)