Class: ApolloDeploySignalSdkRails::WebhookResponse
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdkRails::WebhookResponse
- Defined in:
- lib/apollo_deploy_signal_sdk_rails/types.rb
Overview
Schema type: WebhookResponse
Instance Attribute Summary collapse
- #created_at ⇒ String
- #enabled ⇒ Boolean
- #events ⇒ Array<String>
- #filters ⇒ Array<WebhookFilterSerializable>
- #id ⇒ String
- #name ⇒ String
- #project_id ⇒ String
- #transformations ⇒ Array<WebhookTransformationSerializable>
- #updated_at ⇒ String
- #url ⇒ String
Class Method Summary collapse
-
.from_json(attributes) ⇒ WebhookResponse
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(id:, project_id:, name:, url:, events:, enabled:, filters:, transformations:, created_at:, updated_at:) ⇒ WebhookResponse
constructor
A new instance of WebhookResponse.
-
#to_h ⇒ Hash
A hash representation of this object.
Constructor Details
#initialize(id:, project_id:, name:, url:, events:, enabled:, filters:, transformations:, created_at:, updated_at:) ⇒ WebhookResponse
Returns a new instance of WebhookResponse.
3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3274 def initialize(id: , project_id: , name: , url: , events: , enabled: , filters: , transformations: , created_at: , updated_at: ) @id = id @project_id = project_id @name = name @url = url @events = events @enabled = enabled @filters = filters @transformations = transformations @created_at = created_at @updated_at = updated_at end |
Instance Attribute Details
#created_at ⇒ String
3269 3270 3271 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3269 def created_at @created_at end |
#enabled ⇒ Boolean
3263 3264 3265 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3263 def enabled @enabled end |
#events ⇒ Array<String>
3261 3262 3263 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3261 def events @events end |
#filters ⇒ Array<WebhookFilterSerializable>
3265 3266 3267 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3265 def filters @filters end |
#id ⇒ String
3253 3254 3255 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3253 def id @id end |
#name ⇒ String
3257 3258 3259 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3257 def name @name end |
#project_id ⇒ String
3255 3256 3257 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3255 def project_id @project_id end |
#transformations ⇒ Array<WebhookTransformationSerializable>
3267 3268 3269 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3267 def transformations @transformations end |
#updated_at ⇒ String
3271 3272 3273 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3271 def updated_at @updated_at end |
#url ⇒ String
3259 3260 3261 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3259 def url @url end |
Class Method Details
.from_json(attributes) ⇒ WebhookResponse
Create an instance from a parsed JSON hash.
3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3306 def self.from_json(attributes) return nil unless attributes.is_a?(Hash) new( id: attributes.key?("id") ? attributes["id"] : attributes[:id], project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id], name: attributes.key?("name") ? attributes["name"] : attributes[:name], url: attributes.key?("url") ? attributes["url"] : attributes[:url], events: attributes.key?("events") ? attributes["events"] : attributes[:events], enabled: attributes.key?("enabled") ? attributes["enabled"] : attributes[:enabled], filters: attributes.key?("filters") ? attributes["filters"] : attributes[:filters], transformations: attributes.key?("transformations") ? attributes["transformations"] : attributes[:transformations], created_at: attributes.key?("createdAt") ? attributes["createdAt"] : attributes[:created_at], updated_at: attributes.key?("updatedAt") ? attributes["updatedAt"] : attributes[:updated_at], ) end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of this object.
3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3288 def to_h { id: @id, project_id: @project_id, name: @name, url: @url, events: @events, enabled: @enabled, filters: @filters, transformations: @transformations, created_at: @created_at, updated_at: @updated_at, }.compact end |