Class: Unit::Webhook::PatchWebhookRequest
- Inherits:
-
Object
- Object
- Unit::Webhook::PatchWebhookRequest
- Defined in:
- lib/unit/models/webhook/patch_webhook_request.rb
Instance Attribute Summary collapse
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#include_resources ⇒ Object
readonly
Returns the value of attribute include_resources.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#subscription_type ⇒ Object
readonly
Returns the value of attribute subscription_type.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#webhook_id ⇒ Object
readonly
Returns the value of attribute webhook_id.
Instance Method Summary collapse
-
#initialize(webhook_id, label, url, content_type, token, include_resources = nil, subscription_type = nil) ⇒ PatchWebhookRequest
constructor
A new instance of PatchWebhookRequest.
- #to_json_api ⇒ Object
Constructor Details
#initialize(webhook_id, label, url, content_type, token, include_resources = nil, subscription_type = nil) ⇒ PatchWebhookRequest
Returns a new instance of PatchWebhookRequest.
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/unit/models/webhook/patch_webhook_request.rb', line 17 def initialize(webhook_id, label, url, content_type, token, include_resources = nil, subscription_type = nil) @webhook_id = webhook_id @label = label @url = url @token = token @content_type = content_type @include_resources = include_resources @subscription_type = subscription_type end |
Instance Attribute Details
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
8 9 10 |
# File 'lib/unit/models/webhook/patch_webhook_request.rb', line 8 def content_type @content_type end |
#include_resources ⇒ Object (readonly)
Returns the value of attribute include_resources.
8 9 10 |
# File 'lib/unit/models/webhook/patch_webhook_request.rb', line 8 def include_resources @include_resources end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
8 9 10 |
# File 'lib/unit/models/webhook/patch_webhook_request.rb', line 8 def label @label end |
#subscription_type ⇒ Object (readonly)
Returns the value of attribute subscription_type.
8 9 10 |
# File 'lib/unit/models/webhook/patch_webhook_request.rb', line 8 def subscription_type @subscription_type end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
8 9 10 |
# File 'lib/unit/models/webhook/patch_webhook_request.rb', line 8 def token @token end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
8 9 10 |
# File 'lib/unit/models/webhook/patch_webhook_request.rb', line 8 def url @url end |
#webhook_id ⇒ Object (readonly)
Returns the value of attribute webhook_id.
8 9 10 |
# File 'lib/unit/models/webhook/patch_webhook_request.rb', line 8 def webhook_id @webhook_id end |
Instance Method Details
#to_json_api ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/unit/models/webhook/patch_webhook_request.rb', line 28 def to_json_api payload = { data: { type: "webhook", attributes: { label: label, url: url, contentType: content_type, token: token, includeResources: include_resources, subscriptionType: subscription_type } } } payload[:data][:attributes].compact! payload.to_json end |