Class: ApolloDeploySignalSdkRails::WebhookResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/apollo_deploy_signal_sdk_rails/types.rb

Overview

Schema type: WebhookResponse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, project_id:, name:, url:, events:, enabled:, filters:, transformations:, created_at:, updated_at:) ⇒ WebhookResponse

Returns a new instance of WebhookResponse.

Parameters:

  • id (String)

    , project_id [String], name [String], url [String], events [Array], enabled [Boolean], filters [Array], transformations [Array], created_at [String], updated_at [String]



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_atString

Returns:

  • (String)


3269
3270
3271
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3269

def created_at
  @created_at
end

#enabledBoolean

Returns:

  • (Boolean)


3263
3264
3265
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3263

def enabled
  @enabled
end

#eventsArray<String>

Returns:

  • (Array<String>)


3261
3262
3263
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3261

def events
  @events
end

#filtersArray<WebhookFilterSerializable>

Returns:



3265
3266
3267
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3265

def filters
  @filters
end

#idString

Returns:

  • (String)


3253
3254
3255
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3253

def id
  @id
end

#nameString

Returns:

  • (String)


3257
3258
3259
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3257

def name
  @name
end

#project_idString

Returns:

  • (String)


3255
3256
3257
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3255

def project_id
  @project_id
end

#transformationsArray<WebhookTransformationSerializable>



3267
3268
3269
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3267

def transformations
  @transformations
end

#updated_atString

Returns:

  • (String)


3271
3272
3273
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3271

def updated_at
  @updated_at
end

#urlString

Returns:

  • (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.

Parameters:

  • attributes (Hash)

Returns:



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_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    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