Class: ApolloDeploySignalSdk::SuppressionImportRowSerializable

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

Overview

Schema type: SuppressionImportRowSerializable

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(email:, reason: nil) ⇒ SuppressionImportRowSerializable

Returns a new instance of SuppressionImportRowSerializable.

Parameters:

  • email (String)

    , reason [String, nil]



1822
1823
1824
1825
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1822

def initialize(email: , reason: nil)
  @email = email
  @reason = reason
end

Instance Attribute Details

#emailString

Returns:

  • (String)


1817
1818
1819
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1817

def email
  @email
end

#reasonString?

Returns:

  • (String, nil)


1819
1820
1821
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1819

def reason
  @reason
end

Class Method Details

.from_json(attributes) ⇒ SuppressionImportRowSerializable

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



1838
1839
1840
1841
1842
1843
1844
1845
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1838

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

  new(
    email: attributes.key?("email") ? attributes["email"] : attributes[:email],
    reason: attributes.key?("reason") ? attributes["reason"] : attributes[:reason],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



1828
1829
1830
1831
1832
1833
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1828

def to_h
  {
    email: @email,
    reason: @reason,
  }.compact
end