Class: ApolloDeploySignalSdkRails::WebhookFilterSerializable

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

Overview

Schema type: WebhookFilterSerializable

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(field:, operator:, value: nil) ⇒ WebhookFilterSerializable

Returns a new instance of WebhookFilterSerializable.

Parameters:

  • field (String)

    , operator [String], value [String, nil]



3167
3168
3169
3170
3171
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3167

def initialize(field: , operator: , value: nil)
  @field = field
  @operator = operator
  @value = value
end

Instance Attribute Details

#fieldString

Returns:

  • (String)


3160
3161
3162
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3160

def field
  @field
end

#operatorString

Returns:

  • (String)


3162
3163
3164
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3162

def operator
  @operator
end

#valueString?

Returns:

  • (String, nil)


3164
3165
3166
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3164

def value
  @value
end

Class Method Details

.from_json(attributes) ⇒ WebhookFilterSerializable

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



3185
3186
3187
3188
3189
3190
3191
3192
3193
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3185

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

  new(
    field: attributes.key?("field") ? attributes["field"] : attributes[:field],
    operator: attributes.key?("operator") ? attributes["operator"] : attributes[:operator],
    value: attributes.key?("value") ? attributes["value"] : attributes[:value],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



3174
3175
3176
3177
3178
3179
3180
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3174

def to_h
  {
    field: @field,
    operator: @operator,
    value: @value,
  }.compact
end