Class: ApolloDeploySignalSdk::CreateWebhookBody
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdk::CreateWebhookBody
- Defined in:
- lib/apollo_deploy_signal_sdk/types.rb
Overview
Schema type: CreateWebhookBody
Instance Attribute Summary collapse
- #events ⇒ Array<String>
- #filters ⇒ Array<WebhookFilterSerializable>
- #name ⇒ String?
- #secret ⇒ String?
- #transformations ⇒ Array<WebhookTransformationSerializable>
- #url ⇒ String
Class Method Summary collapse
-
.from_json(attributes) ⇒ CreateWebhookBody
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(url:, events:, name: nil, secret: nil, filters: nil, transformations: nil) ⇒ CreateWebhookBody
constructor
A new instance of CreateWebhookBody.
-
#to_h ⇒ Hash
A hash representation of this object.
Constructor Details
#initialize(url:, events:, name: nil, secret: nil, filters: nil, transformations: nil) ⇒ CreateWebhookBody
Returns a new instance of CreateWebhookBody.
3492 3493 3494 3495 3496 3497 3498 3499 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3492 def initialize(url: , events: , name: nil, secret: nil, filters: nil, transformations: nil) @url = url @events = events @name = name @secret = secret @filters = filters @transformations = transformations end |
Instance Attribute Details
#events ⇒ Array<String>
3481 3482 3483 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3481 def events @events end |
#filters ⇒ Array<WebhookFilterSerializable>
3487 3488 3489 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3487 def filters @filters end |
#name ⇒ String?
3483 3484 3485 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3483 def name @name end |
#secret ⇒ String?
3485 3486 3487 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3485 def secret @secret end |
#transformations ⇒ Array<WebhookTransformationSerializable>
3489 3490 3491 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3489 def transformations @transformations end |
#url ⇒ String
3479 3480 3481 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3479 def url @url end |
Class Method Details
.from_json(attributes) ⇒ CreateWebhookBody
Create an instance from a parsed JSON hash.
3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3516 def self.from_json(attributes) return nil unless attributes.is_a?(Hash) new( url: attributes.key?("url") ? attributes["url"] : attributes[:url], events: attributes.key?("events") ? attributes["events"] : attributes[:events], name: attributes.key?("name") ? attributes["name"] : attributes[:name], secret: attributes.key?("secret") ? attributes["secret"] : attributes[:secret], filters: attributes.key?("filters") ? attributes["filters"] : attributes[:filters], transformations: attributes.key?("transformations") ? attributes["transformations"] : attributes[:transformations], ) end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of this object.
3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3502 def to_h { url: @url, events: @events, name: @name, secret: @secret, filters: @filters, transformations: @transformations, }.compact end |