Class: ApolloDeploySignalSdk::WebhookDeliveryResponse

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

Overview

Schema type: WebhookDeliveryResponse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, project_id:, webhook_endpoint_id:, event_type:, status:, attempt_count:, last_status_code:, last_error:, response_body_snippet:, next_attempt_at:, created_at:, updated_at:) ⇒ WebhookDeliveryResponse

Returns a new instance of WebhookDeliveryResponse.

Parameters:

  • id (String)

    , project_id [String], webhook_endpoint_id [String], event_type [String], status [String], attempt_count [Integer], last_status_code [Integer, nil], last_error [String, nil], response_body_snippet [String, nil], next_attempt_at [String, nil], created_at [String], updated_at [String]



3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3386

def initialize(id: , project_id: , webhook_endpoint_id: , event_type: , status: , attempt_count: , last_status_code: , last_error: , response_body_snippet: , next_attempt_at: , created_at: , updated_at: )
  @id = id
  @project_id = project_id
  @webhook_endpoint_id = webhook_endpoint_id
  @event_type = event_type
  @status = status
  @attempt_count = attempt_count
  @last_status_code = last_status_code
  @last_error = last_error
  @response_body_snippet = response_body_snippet
  @next_attempt_at = next_attempt_at
  @created_at = created_at
  @updated_at = updated_at
end

Instance Attribute Details

#attempt_countInteger

Returns:

  • (Integer)


3371
3372
3373
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3371

def attempt_count
  @attempt_count
end

#created_atString

Returns:

  • (String)


3381
3382
3383
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3381

def created_at
  @created_at
end

#event_typeString

Returns:

  • (String)


3367
3368
3369
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3367

def event_type
  @event_type
end

#idString

Returns:

  • (String)


3361
3362
3363
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3361

def id
  @id
end

#last_errorString?

Returns:

  • (String, nil)


3375
3376
3377
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3375

def last_error
  @last_error
end

#last_status_codeInteger?

Returns:

  • (Integer, nil)


3373
3374
3375
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3373

def last_status_code
  @last_status_code
end

#next_attempt_atString?

Returns:

  • (String, nil)


3379
3380
3381
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3379

def next_attempt_at
  @next_attempt_at
end

#project_idString

Returns:

  • (String)


3363
3364
3365
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3363

def project_id
  @project_id
end

#response_body_snippetString?

Returns:

  • (String, nil)


3377
3378
3379
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3377

def response_body_snippet
  @response_body_snippet
end

#statusString

Returns:

  • (String)


3369
3370
3371
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3369

def status
  @status
end

#updated_atString

Returns:

  • (String)


3383
3384
3385
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3383

def updated_at
  @updated_at
end

#webhook_endpoint_idString

Returns:

  • (String)


3365
3366
3367
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3365

def webhook_endpoint_id
  @webhook_endpoint_id
end

Class Method Details

.from_json(attributes) ⇒ WebhookDeliveryResponse

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3422

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],
    webhook_endpoint_id: attributes.key?("webhookEndpointId") ? attributes["webhookEndpointId"] : attributes[:webhook_endpoint_id],
    event_type: attributes.key?("eventType") ? attributes["eventType"] : attributes[:event_type],
    status: attributes.key?("status") ? attributes["status"] : attributes[:status],
    attempt_count: attributes.key?("attemptCount") ? attributes["attemptCount"] : attributes[:attempt_count],
    last_status_code: attributes.key?("lastStatusCode") ? attributes["lastStatusCode"] : attributes[:last_status_code],
    last_error: attributes.key?("lastError") ? attributes["lastError"] : attributes[:last_error],
    response_body_snippet: attributes.key?("responseBodySnippet") ? attributes["responseBodySnippet"] : attributes[:response_body_snippet],
    next_attempt_at: attributes.key?("nextAttemptAt") ? attributes["nextAttemptAt"] : attributes[:next_attempt_at],
    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



3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3402

def to_h
  {
    id: @id,
    project_id: @project_id,
    webhook_endpoint_id: @webhook_endpoint_id,
    event_type: @event_type,
    status: @status,
    attempt_count: @attempt_count,
    last_status_code: @last_status_code,
    last_error: @last_error,
    response_body_snippet: @response_body_snippet,
    next_attempt_at: @next_attempt_at,
    created_at: @created_at,
    updated_at: @updated_at,
  }.compact
end