Class: ApolloDeploySignalSdk::WebhookCreateResponse

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

Overview

Schema type: WebhookCreateResponse

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:, secret:) ⇒ WebhookCreateResponse

Returns a new instance of WebhookCreateResponse.

Parameters:

  • id (String)

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



3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3556

def initialize(id: , project_id: , name: , url: , events: , enabled: , filters: , transformations: , created_at: , updated_at: , secret: )
  @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
  @secret = secret
end

Instance Attribute Details

#created_atString

Returns:

  • (String)


3549
3550
3551
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3549

def created_at
  @created_at
end

#enabledBoolean

Returns:

  • (Boolean)


3543
3544
3545
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3543

def enabled
  @enabled
end

#eventsArray<String>

Returns:

  • (Array<String>)


3541
3542
3543
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3541

def events
  @events
end

#filtersArray<WebhookFilterSerializable>

Returns:



3545
3546
3547
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3545

def filters
  @filters
end

#idString

Returns:

  • (String)


3533
3534
3535
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3533

def id
  @id
end

#nameString

Returns:

  • (String)


3537
3538
3539
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3537

def name
  @name
end

#project_idString

Returns:

  • (String)


3535
3536
3537
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3535

def project_id
  @project_id
end

#secretString

Returns:

  • (String)


3553
3554
3555
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3553

def secret
  @secret
end

#transformationsArray<WebhookTransformationSerializable>



3547
3548
3549
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3547

def transformations
  @transformations
end

#updated_atString

Returns:

  • (String)


3551
3552
3553
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3551

def updated_at
  @updated_at
end

#urlString

Returns:

  • (String)


3539
3540
3541
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3539

def url
  @url
end

Class Method Details

.from_json(attributes) ⇒ WebhookCreateResponse

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3590

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],
    secret: attributes.key?("secret") ? attributes["secret"] : attributes[:secret],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3571

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,
    secret: @secret,
  }.compact
end