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