Skip to content

Commit

Permalink
v0.4.28
Browse files Browse the repository at this point in the history
  • Loading branch information
tmunzer committed Jan 6, 2025
1 parent 5d75364 commit 7f73b67
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 187 deletions.
32 changes: 14 additions & 18 deletions doc/controllers/orgs-user-ma-cs.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ SearchOrgUserMacs(
labels []string,
limit *int,
page *int) (
models.ApiResponse[models.UserMacsSearch],
models.ApiResponse[[]models.UserMac],
error)
```

Expand All @@ -338,7 +338,7 @@ SearchOrgUserMacs(

## Response Type

[`models.UserMacsSearch`](../../doc/models/user-macs-search.md)
[`[]models.UserMac`](../../doc/models/user-mac.md)

## Example Usage

Expand Down Expand Up @@ -368,22 +368,18 @@ if err != nil {
## Example Response *(as JSON)*

```json
{
"limit": 100,
"page": 1,
"results": [
{
"id": "111cafd2-ba1b-5169-bfcb-9cdf1d473ddb",
"labels": [
"flor1",
"bld4"
],
"mac": "921b638445cd",
"notes": "mac address refers to Canon printers",
"vlan": "30"
}
]
}
[
{
"id": "111cafd2-ba1b-5169-bfcb-9cdf1d473ddb",
"labels": [
"flor1",
"bld4"
],
"mac": "921b638445cd",
"notes": "mac address refers to Canon printers",
"vlan": "30"
}
]
```

## Errors
Expand Down
80 changes: 0 additions & 80 deletions doc/models/user-macs-search.md

This file was deleted.

2 changes: 1 addition & 1 deletion mistapi/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ func NewClient(configuration Configuration) ClientInterface {
configuration: configuration,
}

client.userAgent = utilities.UpdateUserAgent("SDK 2412.1.13")
client.userAgent = utilities.UpdateUserAgent("SDK 2412.1.14")
client.callBuilderFactory = callBuilderHandler(
func(server string) string {
if server == "" {
Expand Down
83 changes: 0 additions & 83 deletions mistapi/models/user_macs_search.go

This file was deleted.

8 changes: 4 additions & 4 deletions mistapi/orgs_user_ma_cs.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (o *OrgsUserMACs) ImportOrgUserMacs(
}

// SearchOrgUserMacs takes context, orgId, mac, labels, limit, page as parameters and
// returns an models.ApiResponse with models.UserMacsSearch data and
// returns an models.ApiResponse with []models.UserMac data and
// an error if there was an issue with the request or response.
// Search Org User MACs
func (o *OrgsUserMACs) SearchOrgUserMacs(
Expand All @@ -139,7 +139,7 @@ func (o *OrgsUserMACs) SearchOrgUserMacs(
labels []string,
limit *int,
page *int) (
models.ApiResponse[models.UserMacsSearch],
models.ApiResponse[[]models.UserMac],
error) {
req := o.prepareRequest(ctx, "GET", "/api/v1/orgs/%v/usermacs/search")
req.AppendTemplateParams(orgId)
Expand Down Expand Up @@ -174,13 +174,13 @@ func (o *OrgsUserMACs) SearchOrgUserMacs(
req.QueryParam("page", *page)
}

var result models.UserMacsSearch
var result []models.UserMac
decoder, resp, err := req.CallAsJson()
if err != nil {
return models.NewApiResponse(result, resp), err
}

result, err = utilities.DecodeResults[models.UserMacsSearch](decoder)
result, err = utilities.DecodeResults[[]models.UserMac](decoder)
return models.NewApiResponse(result, resp), err
}

Expand Down
2 changes: 1 addition & 1 deletion mistapi/orgs_user_ma_cs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestOrgsUserMACsTestSearchOrgUserMacs(t *testing.T) {
testHelper.NewTestHeader(true,"Content-Type","application/json"),
}
testHelper.CheckResponseHeaders(t, apiResponse.Response.Header, expectedHeaders, true)
expected := `{"limit":100,"page":1,"results":[{"id":"111cafd2-ba1b-5169-bfcb-9cdf1d473ddb","labels":["flor1","bld4"],"mac":"921b638445cd","notes":"mac address refers to Canon printers","vlan":"30"}]}`
expected := `[{"id":"111cafd2-ba1b-5169-bfcb-9cdf1d473ddb","labels":["flor1","bld4"],"mac":"921b638445cd","notes":"mac address refers to Canon printers","vlan":"30"}]`
testHelper.KeysBodyMatcher(t, expected, apiResponse.Response.Body, false, false)
}

Expand Down

0 comments on commit 7f73b67

Please sign in to comment.