Class: Hook0::Generated::ApplicationSecretPost
- Inherits:
-
Object
- Object
- Hook0::Generated::ApplicationSecretPost
- Defined in:
- lib/hook0/generated/models.rb
Overview
The ApplicationSecretPost the API declares.
Instance Attribute Summary collapse
-
#application_id ⇒ Object
readonly
Returns the value of attribute application_id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
-
.from_json(value) ⇒ ApplicationSecretPost
Read one out of what the API answered.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
(also: #eql?)
Whether that value carries the same members as this one.
-
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
-
#initialize(application_id:, name: nil) ⇒ ApplicationSecretPost
constructor
A new instance of ApplicationSecretPost.
-
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
Constructor Details
#initialize(application_id:, name: nil) ⇒ ApplicationSecretPost
Returns a new instance of ApplicationSecretPost.
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_id ⇒ Object (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 |
#name ⇒ Object (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.
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.
705 706 707 |
# File 'lib/hook0/generated/models.rb', line 705 def ==(other) other.is_a?(ApplicationSecretPost) && to_h == other.to_h end |
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
713 714 715 |
# File 'lib/hook0/generated/models.rb', line 713 def hash to_h.hash end |
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
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 |