Class: ApolloDeploySignalSdkRails::CreateWebhookBody

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

Overview

Schema type: CreateWebhookBody

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of CreateWebhookBody.

Parameters:

  • url (String)

    , events [Array], name [String, nil], secret [String, nil], filters [Array], transformations [Array]



3492
3493
3494
3495
3496
3497
3498
3499
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3492

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

Instance Attribute Details

#eventsArray<String>

Returns:

  • (Array<String>)


3481
3482
3483
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3481

def events
  @events
end

#filtersArray<WebhookFilterSerializable>

Returns:



3487
3488
3489
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3487

def filters
  @filters
end

#nameString?

Returns:

  • (String, nil)


3483
3484
3485
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3483

def name
  @name
end

#secretString?

Returns:

  • (String, nil)


3485
3486
3487
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3485

def secret
  @secret
end

#transformationsArray<WebhookTransformationSerializable>



3489
3490
3491
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3489

def transformations
  @transformations
end

#urlString

Returns:

  • (String)


3479
3480
3481
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3479

def url
  @url
end

Class Method Details

.from_json(attributes) ⇒ CreateWebhookBody

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3516

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

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



3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3502

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