Class: ApolloDeploySignalSdkRails::SuppressionResponse

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

Overview

Schema type: SuppressionResponse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, project_id:, email:, reason:, created_at:, contact_id: nil) ⇒ SuppressionResponse

Returns a new instance of SuppressionResponse.

Parameters:

  • id (String)

    , project_id [String], email [String], reason [String], created_at [String], contact_id [String, nil]



1659
1660
1661
1662
1663
1664
1665
1666
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1659

def initialize(id: , project_id: , email: , reason: , created_at: , contact_id: nil)
  @id = id
  @project_id = project_id
  @email = email
  @reason = reason
  @created_at = created_at
  @contact_id = contact_id
end

Instance Attribute Details

#contact_idString?

Returns:

  • (String, nil)


1656
1657
1658
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1656

def contact_id
  @contact_id
end

#created_atString

Returns:

  • (String)


1654
1655
1656
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1654

def created_at
  @created_at
end

#emailString

Returns:

  • (String)


1650
1651
1652
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1650

def email
  @email
end

#idString

Returns:

  • (String)


1646
1647
1648
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1646

def id
  @id
end

#project_idString

Returns:

  • (String)


1648
1649
1650
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1648

def project_id
  @project_id
end

#reasonString

Returns:

  • (String)


1652
1653
1654
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1652

def reason
  @reason
end

Class Method Details

.from_json(attributes) ⇒ SuppressionResponse

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1683

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

  new(
    id: attributes.key?("id") ? attributes["id"] : attributes[:id],
    project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id],
    email: attributes.key?("email") ? attributes["email"] : attributes[:email],
    reason: attributes.key?("reason") ? attributes["reason"] : attributes[:reason],
    created_at: attributes.key?("createdAt") ? attributes["createdAt"] : attributes[:created_at],
    contact_id: attributes.key?("contactId") ? attributes["contactId"] : attributes[:contact_id],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1669

def to_h
  {
    id: @id,
    project_id: @project_id,
    email: @email,
    reason: @reason,
    created_at: @created_at,
    contact_id: @contact_id,
  }.compact
end