Class: Hook0::Generated::ApplicationSecretPost

Inherits:
Object
  • Object
show all
Defined in:
lib/hook0/generated/models.rb

Overview

The ApplicationSecretPost the API declares.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(application_id:, name: nil) ⇒ ApplicationSecretPost

Returns a new instance of ApplicationSecretPost.

Parameters:

  • application_id (String)

    carries application_id.

  • name (String, nil) (defaults to: nil)

    carries name.



673
674
675
676
677
# File 'lib/hook0/generated/models.rb', line 673

def initialize(application_id:, name: nil)
  @application_id = application_id
  @name = name
  freeze
end

Instance Attribute Details

#application_idObject (readonly)

Returns the value of attribute application_id.



668
669
670
# File 'lib/hook0/generated/models.rb', line 668

def application_id
  @application_id
end

#nameObject (readonly)

Returns the value of attribute name.



668
669
670
# File 'lib/hook0/generated/models.rb', line 668

def name
  @name
end

Class Method Details

.from_json(value) ⇒ ApplicationSecretPost

Read one out of what the API answered.

Parameters:

  • value (Object)

    the JSON document the API answered

Returns:



683
684
685
686
687
688
689
# File 'lib/hook0/generated/models.rb', line 683

def self.from_json(value)
  fields = Runtime.as_fields(value, "ApplicationSecretPost")
  new(
    application_id: Runtime.read(fields, "application_id", Runtime::UUID),
    name: Runtime.maybe(fields, "name", Runtime::TEXT)
  )
end

Instance Method Details

#==(other) ⇒ Boolean Also known as: eql?

Whether that value carries the same members as this one.

Parameters:

  • other (Object)

Returns:

  • (Boolean)


705
706
707
# File 'lib/hook0/generated/models.rb', line 705

def ==(other)
  other.is_a?(ApplicationSecretPost) && to_h == other.to_h
end

#hashInteger

A value two equal instances share, so that either may key a hash.

Returns:

  • (Integer)


713
714
715
# File 'lib/hook0/generated/models.rb', line 713

def hash
  to_h.hash
end

#to_hHash{String => Object}

Write one back the way the API reads it.

Returns:

  • (Hash{String => Object})


694
695
696
697
698
699
# File 'lib/hook0/generated/models.rb', line 694

def to_h
  out = {}
  out["application_id"] = @application_id
  out["name"] = @name unless @name.nil?
  out
end