Class: ApolloDeploySignalSdk::WebhookFilterSerializable
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdk::WebhookFilterSerializable
- Defined in:
- lib/apollo_deploy_signal_sdk/types.rb
Overview
Schema type: WebhookFilterSerializable
Instance Attribute Summary collapse
Class Method Summary collapse
-
.from_json(attributes) ⇒ WebhookFilterSerializable
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(field:, operator:, value: nil) ⇒ WebhookFilterSerializable
constructor
A new instance of WebhookFilterSerializable.
-
#to_h ⇒ Hash
A hash representation of this object.
Constructor Details
#initialize(field:, operator:, value: nil) ⇒ WebhookFilterSerializable
Returns a new instance of WebhookFilterSerializable.
3167 3168 3169 3170 3171 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3167 def initialize(field: , operator: , value: nil) @field = field @operator = operator @value = value end |
Instance Attribute Details
#field ⇒ String
3160 3161 3162 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3160 def field @field end |
#operator ⇒ String
3162 3163 3164 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3162 def operator @operator end |
#value ⇒ String?
3164 3165 3166 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3164 def value @value end |
Class Method Details
.from_json(attributes) ⇒ WebhookFilterSerializable
Create an instance from a parsed JSON hash.
3185 3186 3187 3188 3189 3190 3191 3192 3193 |
# File 'lib/apollo_deploy_signal_sdk/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_h ⇒ Hash
Returns a hash representation of this object.
3174 3175 3176 3177 3178 3179 3180 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3174 def to_h { field: @field, operator: @operator, value: @value, }.compact end |