Skip to content

feat: map the Organizations-area response members from the 1.74.0 gap report - #417

Open
danielabbatt wants to merge 1 commit into
fix/response-shape-defectsfrom
feat/map-organizations-members
Open

feat: map the Organizations-area response members from the 1.74.0 gap report#417
danielabbatt wants to merge 1 commit into
fix/response-shape-defectsfrom
feat/map-organizations-members

Conversation

@danielabbatt

Copy link
Copy Markdown
Contributor

Stacked on #416#415

Base is fix/response-shape-defects. Merge #415 and #416 first (merge commits), then retarget this to main. Changelog label 1.74.9 assumes that order.

What

The first per-area batch from gap-report-v1.74.0.md: 30 Organizations-area members the spec documents that the models lacked, across 17 classes. Types and read/write access come from the spec; XML docs are the spec descriptions.

Kind Count Notes
Scalars on existing classes 15 LoginSecurity.EnforceLockedIpSessions, NextUpgrade.Strategy, SamlIdp.SsoLoginUrl/.VisionConsumerUrl, OrganizationDevice.Imei, …
Nested objects 9 3 reuse existing product types (FirmwareProducts.CampusGateway, both SwitchCatalyst), 6 need new classes
New classes 6 NextUpgradePredownload, NetworkStatusSummaryGroup, NetworkStatusSummaryPermissions, OrganizationAdaptivePolicyOverviewLimits, OrganizationAssuranceAlertsOverviewByTypeItemNetwork, WebhookAlertTypeExample

NextUpgrade.Strategy is a string? rather than an enum (minimizeClientDowntime / minimizeUpgradeTime) so an unlisted value can't break deserialization.

Three corrections, not just additions

The diff surfaced three models in this area that never matched the API. Reading their old members always gave defaults, so changing them is breaking only in the type-system sense:

  1. OrganizationAssuranceAlertsOverviewByTypeItem was a copy of the by-network item (AlertCount, NetworkId, NetworkName, SeverityCounts). The API sends type, categoryType, severity, count, networkCount, networks, deviceTypes, deviceTags, lastAlertedAt, lastResolvedAt. Rebuilt to that; …SeverityCount is [Obsolete].
  2. WebhookAlertType had the example payload's 19 fields flattened onto the alert type. The API sends {alertTypeId, alertType, example}. The flattened ones are [Obsolete] pointing at the new Example, which also carries five fields they never had.
  3. OrganizationDevicesSyslogServersRolesByNetworkItem.AvailableRoles mapped availableRoles; the API sends available. DataMember fixed, C# name kept.

Verification

dotnet build Meraki.Api.slnx -c Debug   Build succeeded, 0 Error(s), 6 pre-existing CS0618 warnings
Meraki.Api.Test (Data namespace)        Total: 30, Errors: 0, Failed: 0   (7 new in OrganizationsMemberTests)
Meraki.Api.Test (Workflows)             Total: 12, Errors: 0, Failed: 0

All 18 edited model files kept their BOM state and CRLF. No code outside Data referenced the corrected members.

Next

Remaining areas in the report, largest first: SM (27), Appliance (25), Wireless (19), General (10), Camera (8), CellularGateway (7), Switch (7), Sensor (6), LiveTools (2), Licensing (1).

… report

Thirty members the v1.74.0 spec documents that the models lacked, the first
of the per-area batches. Scalars on eleven existing classes, and nested
objects backed by six new classes (NextUpgradePredownload,
NetworkStatusSummaryGroup, NetworkStatusSummaryPermissions,
OrganizationAdaptivePolicyOverviewLimits,
OrganizationAssuranceAlertsOverviewByTypeItemNetwork,
WebhookAlertTypeExample). Read-only except where the spec puts the member on
a request body.

Three models in the area never matched the API and are corrected:

  OrganizationAssuranceAlertsOverviewByTypeItem carried a copy of the
  by-network item's members; it now has the documented shape and the old
  SeverityCount type is [Obsolete].
  WebhookAlertType had the example payload's fields flattened onto the alert
  type; the API sends them under "example". They are [Obsolete] at the top
  level and available on Example.
  OrganizationDevicesSyslogServersRolesByNetworkItem mapped "availableRoles";
  the API sends "available". C# name unchanged.

OrganizationsMemberTests covers the new members and the corrected shapes.
@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 medium

Alerts:
⚠ 1 issue (≤ 0 issues of at least minor severity)

Results:
1 new issue

Category Results
Complexity 1 medium

View in Codacy

🟢 Metrics 4 complexity

Metric Results
Complexity 4

View in Codacy

AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant