Skip to content
This repository was archived by the owner on Aug 14, 2024. It is now read-only.

Commit d58fccf

Browse files
author
Karsten Senz
authored
Make id attribute of Shipcloud::Webhook accessible (#32)
1 parent 8d86621 commit d58fccf

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## [Unreleased]
22
### Added
33
- Add attr_reader for `id` to class `Shipcloud::Address` to be able to get the id of a created address
4+
- Add attr_reader for `id` to class `Shipcloud::Webhook` to be able to get the id of a created webhook
45

56
### Changed
67

lib/shipcloud/webhook.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class Webhook < Base
33
include Shipcloud::Operations::All
44
include Shipcloud::Operations::Delete
55

6-
attr_reader :url, :event_types, :deactivated
6+
attr_reader :id, :url, :event_types, :deactivated
77

88
def self.index_response_root
99
"webhooks"

spec/shipcloud/webhooks_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
describe Shipcloud::Webhook do
44
valid_attributes = {
5+
id: "583cfd8b-77c7-4447-a3a0-1568bb9cc553",
56
url: "https://example.com/webhook",
67
event_types: ["shipment.tracking.delayed", "shipment.tracking.delivered"]
78
}
@@ -11,6 +12,7 @@
1112
webhook = Shipcloud::Webhook.new(valid_attributes)
1213
expect(webhook.url).to eq "https://example.com/webhook"
1314
expect(webhook.event_types).to eq ["shipment.tracking.delayed", "shipment.tracking.delivered"]
15+
expect(webhook.id).to eq "583cfd8b-77c7-4447-a3a0-1568bb9cc553"
1416
end
1517
end
1618

0 commit comments

Comments
 (0)