Skip to content

Commit

Permalink
Floor plan batch update
Browse files Browse the repository at this point in the history
  • Loading branch information
stashjones committed Nov 28, 2024
1 parent 8ff3cc9 commit ba1bf81
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Meraki.Api/Data/FloorPlanBatchDevicesUpdateRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace Meraki.Api.Data;

/// <summary>
/// FloorPlanBatchDevicesUpdateRequest
/// </summary>
[DataContract]
public class FloorPlanBatchDevicesUpdateRequest
{
/// <summary>
/// List of floorplan assignments to update. Up to 100 floor plan assignments can be provided in a request.
/// </summary>
[DataMember(Name = "assignments")]
public List<FloorPlanBatchDevicesUpdateRequestAssignment> Assignments { get; set; } = new();

}
21 changes: 21 additions & 0 deletions Meraki.Api/Data/FloorPlanBatchDevicesUpdateRequestAssignment.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace Meraki.Api.Data;

/// <summary>
/// FloorPlanBatchDevicesUpdateRequestAssignment
/// </summary>
[DataContract]
public class FloorPlanBatchDevicesUpdateRequestAssignment
{
/// <summary>
/// Serial of the device to change the floor plan assignment for
/// </summary>
[DataMember(Name = "serial")]
public string Serial { get; set; } = string.Empty;

/// <summary>
/// Floorplan to be assigned or unassigned
/// </summary>
[DataMember(Name = "floorPlan")]
public FloorPlanBatchDevicesUpdateRequestAssignment FloorPlan { get; set; } = new();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace Meraki.Api.Data;

/// <summary>
/// FloorPlanBatchDevicesUpdateRequestAssignmentFloorPlan
/// </summary>
[DataContract]
public class FloorPlanBatchDevicesUpdateRequestAssignmentFloorPlan
{
/// <summary>
/// The ID of the floor plan to assign the device to, or null to unassign the device from its floor plan
/// </summary>
[DataMember(Name = "id")]
public string Id { get; set; } = string.Empty;

}
16 changes: 16 additions & 0 deletions Meraki.Api/Data/FloorPlanBatchDevicesUpdateResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace Meraki.Api.Data;

/// <summary>
/// FloorPlanBatchDevicesUpdateResponse
/// </summary>
[DataContract]
public class FloorPlanBatchDevicesUpdateResponse
{
/// <summary>
/// Status of attempt to update device floorplan assignments
/// </summary>
[ApiAccess(ApiAccess.Read)]
[DataMember(Name = "success")]
public bool Success { get; set; }

}
14 changes: 14 additions & 0 deletions Meraki.Api/Interfaces/General/Networks/INetworksFloorplans.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,18 @@ Task DeleteNetworkFloorPlanAsync(
string floorPlanId,
CancellationToken cancellationToken = default
);

/// <summary>
/// Update floorplan assignments for a batch of devices
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="networkId">The network id</param>
/// <param name="floorPlanBatchDevicesUpdateRequest">The request body</param>
[ApiOperationId("batchNetworkFloorPlansDevicesUpdate\r\n")]
[Delete("/networks/{networkId}/floorPlans/{floorPlanId}")]
Task<FloorPlanBatchDevicesUpdateResponse> BatchNetworkFloorPlansDevicesUpdateAsync(
string networkId,
[Body] FloorPlanBatchDevicesUpdateRequest floorPlanBatchDevicesUpdateRequest
CancellationToken cancellationToken = default
);
}

0 comments on commit ba1bf81

Please sign in to comment.