Skip to content

Commit

Permalink
Add missing attributes to the Zone API responses (#138)
Browse files Browse the repository at this point in the history
* add fields to zone struct
  • Loading branch information
AGS4NO authored Dec 12, 2023
1 parent 2411cdb commit 505a8a6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ This project uses [Semantic Versioning 2.0.0](http://semver.org/).

## main

ENHANCEMENTS:

- NEW: Added `Secondary`, `LastTransferredAt`, `Active` to `Zone` (dnsimple/dnsimple-csharp)

## 0.16.0

FEATURES:
Expand Down
6 changes: 6 additions & 0 deletions src/dnsimple-test/Services/ZonesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public void Zones()
Assert.That(zones.First().AccountId, Is.EqualTo(1010));
Assert.That(zones.First().Name, Is.EqualTo("example-alpha.com"));
Assert.That(zones.First().Reverse, Is.False);
Assert.That(zones.First().Secondary, Is.False);
Assert.That(zones.First().LastTransferredAt, Is.Null);
Assert.That(zones.First().Active, Is.True);
Assert.That(zones.First().CreatedAt, Is.EqualTo(CreatedAt));
Assert.That(zones.First().UpdatedAt, Is.EqualTo(UpdatedAt));
});
Expand Down Expand Up @@ -126,6 +129,9 @@ public void GetZone(long accountId, string zoneName, string expectedUrl)
Assert.That(zone.AccountId, Is.EqualTo(accountId));
Assert.That(zone.Name, Is.EqualTo(zoneName));
Assert.That(zone.Reverse, Is.False);
Assert.That(zone.Secondary, Is.False);
Assert.That(zone.LastTransferredAt, Is.Null);
Assert.That(zone.Active, Is.True);
Assert.That(zone.CreatedAt, Is.EqualTo(CreatedAt));
Assert.That(zone.UpdatedAt, Is.EqualTo(UpdatedAt));

Expand Down
2 changes: 1 addition & 1 deletion src/dnsimple-test/fixtures/v2/api/getZone/success.http
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ X-Request-Id: 93182033-a215-484e-a107-5235fa48001c
X-Runtime: 0.177942
Strict-Transport-Security: max-age=31536000

{"data":{"id":1,"account_id":1010,"name":"example-alpha.com","reverse":false,"created_at":"2015-04-23T07:40:03Z","updated_at":"2015-04-23T07:40:03Z"}}
{"data":{"id":1,"account_id":1010,"name":"example-alpha.com","reverse":false,"secondary":false,"last_transferred_at":null,"active":true,"created_at":"2015-04-23T07:40:03Z","updated_at":"2015-04-23T07:40:03Z"}}
2 changes: 1 addition & 1 deletion src/dnsimple-test/fixtures/v2/api/listZones/success.http
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ X-Request-Id: 01be9fa5-3a00-4d51-a927-f17587cb67ec
X-Runtime: 0.037083
Strict-Transport-Security: max-age=31536000

{"data":[{"id":1,"account_id":1010,"name":"example-alpha.com","reverse":false,"created_at":"2015-04-23T07:40:03Z","updated_at":"2015-04-23T07:40:03Z"},{"id":2,"account_id":1010,"name":"example-beta.com","reverse":true,"created_at":"2015-04-23T07:40:03Z","updated_at":"2015-04-23T07:40:03Z"}],"pagination":{"current_page":1,"per_page":30,"total_entries":2,"total_pages":1}}
{"data":[{"id":1,"account_id":1010,"name":"example-alpha.com","reverse":false,"secondary":false,"last_transferred_at":null,"active":true,"created_at":"2015-04-23T07:40:03Z","updated_at":"2015-04-23T07:40:03Z"},{"id":2,"account_id":1010,"name":"example-beta.com","reverse":false,"secondary":false,"last_transferred_at":null,"active":true,"created_at":"2015-04-23T07:40:03Z","updated_at":"2015-04-23T07:40:03Z"}],"pagination":{"current_page":1,"per_page":30,"total_entries":2,"total_pages":1}}
3 changes: 3 additions & 0 deletions src/dnsimple/Services/Zones.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ public struct Zone
public long AccountId { get; set; }
public string Name { get; set; }
public bool Reverse { get; set; }
public bool Secondary { get; set; }
public Nullable<DateTime> LastTransferredAt { get; set; }
public bool Active { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime UpdatedAt { get; set; }
}
Expand Down

0 comments on commit 505a8a6

Please sign in to comment.