Class: ApolloDeploySignalSdkRails::UpdateWebhookBody

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

Overview

Schema type: UpdateWebhookBody

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name: nil, url: nil, events: nil, secret: nil, enabled: nil, filters: nil, transformations: nil) ⇒ UpdateWebhookBody

Returns a new instance of UpdateWebhookBody.

Parameters:

  • name (String, nil) (defaults to: nil)

    , url [String, nil], events [Array], secret [String, nil], enabled [Boolean, nil], filters [Array], transformations [Array]



3627
3628
3629
3630
3631
3632
3633
3634
3635
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3627

def initialize(name: nil, url: nil, events: nil, secret: nil, enabled: nil, filters: nil, transformations: nil)
  @name = name
  @url = url
  @events = events
  @secret = secret
  @enabled = enabled
  @filters = filters
  @transformations = transformations
end

Instance Attribute Details

#enabledBoolean?

Returns:

  • (Boolean, nil)


3620
3621
3622
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3620

def enabled
  @enabled
end

#eventsArray<String>

Returns:

  • (Array<String>)


3616
3617
3618
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3616

def events
  @events
end

#filtersArray<WebhookFilterSerializable>

Returns:



3622
3623
3624
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3622

def filters
  @filters
end

#nameString?

Returns:

  • (String, nil)


3612
3613
3614
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3612

def name
  @name
end

#secretString?

Returns:

  • (String, nil)


3618
3619
3620
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3618

def secret
  @secret
end

#transformationsArray<WebhookTransformationSerializable>



3624
3625
3626
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3624

def transformations
  @transformations
end

#urlString?

Returns:

  • (String, nil)


3614
3615
3616
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3614

def url
  @url
end

Class Method Details

.from_json(attributes) ⇒ UpdateWebhookBody

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3653

def self.from_json(attributes)
  return nil unless attributes.is_a?(Hash)

  new(
    name: attributes.key?("name") ? attributes["name"] : attributes[:name],
    url: attributes.key?("url") ? attributes["url"] : attributes[:url],
    events: attributes.key?("events") ? attributes["events"] : attributes[:events],
    secret: attributes.key?("secret") ? attributes["secret"] : attributes[:secret],
    enabled: attributes.key?("enabled") ? attributes["enabled"] : attributes[:enabled],
    filters: attributes.key?("filters") ? attributes["filters"] : attributes[:filters],
    transformations: attributes.key?("transformations") ? attributes["transformations"] : attributes[:transformations],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3638

def to_h
  {
    name: @name,
    url: @url,
    events: @events,
    secret: @secret,
    enabled: @enabled,
    filters: @filters,
    transformations: @transformations,
  }.compact
end