-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update webhook model with signature header
add signature header to webhook.rb ut with factory lint
- Loading branch information
1 parent
f4494c0
commit dc30954
Showing
4 changed files
with
65 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs. | ||
The version of the OpenAPI document: 0.0.1-alpha | ||
Contact: [email protected] | ||
Generated by: https://openapi-generator.tech | ||
Generator version: 7.7.0 | ||
|
@@ -36,6 +36,9 @@ class Webhook | |
# The date and time the webhook was last updated. | ||
attr_accessor :updated_at | ||
|
||
# The header that will contain the signature of the webhook payload. | ||
attr_accessor :signature_header | ||
|
||
class EnumAttributeValidator | ||
attr_reader :datatype | ||
attr_reader :allowable_values | ||
|
@@ -67,7 +70,8 @@ def self.attribute_map | |
:'event_filters' => :'event_filters', | ||
:'notification_uri' => :'notification_uri', | ||
:'created_at' => :'created_at', | ||
:'updated_at' => :'updated_at' | ||
:'updated_at' => :'updated_at', | ||
:'signature_header' => :'signature_header' | ||
} | ||
end | ||
|
||
|
@@ -85,14 +89,15 @@ def self.openapi_types | |
:'event_filters' => :'Array<WebhookEventFilter>', | ||
:'notification_uri' => :'String', | ||
:'created_at' => :'Time', | ||
:'updated_at' => :'Time' | ||
:'updated_at' => :'Time', | ||
:'signature_header' => :'String' | ||
} | ||
end | ||
|
||
# List of attributes with nullable: true | ||
def self.openapi_nullable | ||
Set.new([ | ||
]) | ||
]) | ||
end | ||
|
||
# Initializes the object | ||
|
@@ -139,6 +144,10 @@ def initialize(attributes = {}) | |
if attributes.key?(:'updated_at') | ||
self.updated_at = attributes[:'updated_at'] | ||
end | ||
|
||
if attributes.key?(:'signature_header') | ||
self.signature_header = attributes[:'signature_header'] | ||
end | ||
end | ||
|
||
# Show invalid properties with the reasons. Usually used together with valid? | ||
|
@@ -161,13 +170,14 @@ def valid? | |
def ==(o) | ||
return true if self.equal?(o) | ||
self.class == o.class && | ||
id == o.id && | ||
network_id == o.network_id && | ||
event_type == o.event_type && | ||
event_filters == o.event_filters && | ||
notification_uri == o.notification_uri && | ||
created_at == o.created_at && | ||
updated_at == o.updated_at | ||
id == o.id && | ||
network_id == o.network_id && | ||
event_type == o.event_type && | ||
event_filters == o.event_filters && | ||
notification_uri == o.notification_uri && | ||
created_at == o.created_at && | ||
updated_at == o.updated_at && | ||
signature_header == o.signature_header | ||
end | ||
|
||
# @see the `==` method | ||
|
@@ -179,7 +189,7 @@ def eql?(o) | |
# Calculates hash code according to all attributes. | ||
# @return [Integer] Hash code | ||
def hash | ||
[id, network_id, event_type, event_filters, notification_uri, created_at, updated_at].hash | ||
[id, network_id, event_type, event_filters, notification_uri, created_at, updated_at, signature_header].hash | ||
end | ||
|
||
# Builds the object from hash | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# frozen_string_literal: true | ||
|
||
FactoryBot.define do | ||
factory :webhook_model, class: 'Coinbase::Client::Webhook' do | ||
id { 'webhook_id' } | ||
network_id { :base_sepolia } | ||
event_type { 'erc20_transfer' } | ||
event_filters { [{ 'contract_address' => '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913' }] } | ||
notification_uri { 'https://example.com/notify' } | ||
signature_header { 'example_header' } | ||
|
||
trait :updated_uri do | ||
notification_uri { build(:notification_uri) } | ||
end | ||
end | ||
|
||
factory :webhook, class: 'Coinbase::Webhook' do | ||
transient do | ||
model { build(:webhook_model) } | ||
end | ||
|
||
initialize_with { new(model) } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters