Class: Hook0::Generated::EventTypePost
- Inherits:
-
Object
- Object
- Hook0::Generated::EventTypePost
- Defined in:
- lib/hook0/generated/models.rb
Overview
The EventTypePost the API declares.
Instance Attribute Summary collapse
-
#application_id ⇒ Object
readonly
Returns the value of attribute application_id.
-
#resource_type ⇒ Object
readonly
Returns the value of attribute resource_type.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
-
#verb ⇒ Object
readonly
Returns the value of attribute verb.
Class Method Summary collapse
-
.from_json(value) ⇒ EventTypePost
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:, resource_type:, service:, verb:) ⇒ EventTypePost
constructor
A new instance of EventTypePost.
-
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
Constructor Details
#initialize(application_id:, resource_type:, service:, verb:) ⇒ EventTypePost
Returns a new instance of EventTypePost.
979 980 981 982 983 984 985 |
# File 'lib/hook0/generated/models.rb', line 979 def initialize(application_id:, resource_type:, service:, verb:) @application_id = application_id @resource_type = resource_type @service = service @verb = verb freeze end |
Instance Attribute Details
#application_id ⇒ Object (readonly)
Returns the value of attribute application_id.
970 971 972 |
# File 'lib/hook0/generated/models.rb', line 970 def application_id @application_id end |
#resource_type ⇒ Object (readonly)
Returns the value of attribute resource_type.
970 971 972 |
# File 'lib/hook0/generated/models.rb', line 970 def resource_type @resource_type end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
970 971 972 |
# File 'lib/hook0/generated/models.rb', line 970 def service @service end |
#verb ⇒ Object (readonly)
Returns the value of attribute verb.
970 971 972 |
# File 'lib/hook0/generated/models.rb', line 970 def verb @verb end |
Class Method Details
.from_json(value) ⇒ EventTypePost
Read one out of what the API answered.
991 992 993 994 995 996 997 998 999 |
# File 'lib/hook0/generated/models.rb', line 991 def self.from_json(value) fields = Runtime.as_fields(value, "EventTypePost") new( application_id: Runtime.read(fields, "application_id", Runtime::UUID), resource_type: Runtime.read(fields, "resource_type", Runtime::TEXT), service: Runtime.read(fields, "service", Runtime::TEXT), verb: Runtime.read(fields, "verb", Runtime::TEXT) ) end |
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Whether that value carries the same members as this one.
1017 1018 1019 |
# File 'lib/hook0/generated/models.rb', line 1017 def ==(other) other.is_a?(EventTypePost) && to_h == other.to_h end |
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
1025 1026 1027 |
# File 'lib/hook0/generated/models.rb', line 1025 def hash to_h.hash end |
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
1004 1005 1006 1007 1008 1009 1010 1011 |
# File 'lib/hook0/generated/models.rb', line 1004 def to_h out = {} out["application_id"] = @application_id out["resource_type"] = @resource_type out["service"] = @service out["verb"] = @verb out end |