Class: Hook0::Generated::SubscriptionTarget
- Inherits:
-
Object
- Object
- Hook0::Generated::SubscriptionTarget
- Defined in:
- lib/hook0/generated/models.rb
Overview
The SubscriptionTarget the API declares.
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#method_ ⇒ Object
readonly
Returns the value of attribute method_.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
-
.from_json(value) ⇒ SubscriptionTarget
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(headers:, method_:, type:, url:) ⇒ SubscriptionTarget
constructor
A new instance of SubscriptionTarget.
-
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
Constructor Details
#initialize(headers:, method_:, type:, url:) ⇒ SubscriptionTarget
Returns a new instance of SubscriptionTarget.
3042 3043 3044 3045 3046 3047 3048 |
# File 'lib/hook0/generated/models.rb', line 3042 def initialize(headers:, method_:, type:, url:) @headers = headers @method_ = method_ @type = type @url = url freeze end |
Instance Attribute Details
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
3033 3034 3035 |
# File 'lib/hook0/generated/models.rb', line 3033 def headers @headers end |
#method_ ⇒ Object (readonly)
Returns the value of attribute method_.
3033 3034 3035 |
# File 'lib/hook0/generated/models.rb', line 3033 def method_ @method_ end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3033 3034 3035 |
# File 'lib/hook0/generated/models.rb', line 3033 def type @type end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
3033 3034 3035 |
# File 'lib/hook0/generated/models.rb', line 3033 def url @url end |
Class Method Details
.from_json(value) ⇒ SubscriptionTarget
Read one out of what the API answered.
3054 3055 3056 3057 3058 3059 3060 3061 3062 |
# File 'lib/hook0/generated/models.rb', line 3054 def self.from_json(value) fields = Runtime.as_fields(value, "SubscriptionTarget") new( headers: Runtime.read(fields, "headers", Runtime::JSON_VALUE), method_: Runtime.read(fields, "method", Runtime::TEXT), type: Runtime.read(fields, "type", Runtime::TEXT), url: Runtime.read(fields, "url", Runtime::TEXT) ) end |
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Whether that value carries the same members as this one.
3080 3081 3082 |
# File 'lib/hook0/generated/models.rb', line 3080 def ==(other) other.is_a?(SubscriptionTarget) && to_h == other.to_h end |
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
3088 3089 3090 |
# File 'lib/hook0/generated/models.rb', line 3088 def hash to_h.hash end |
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
3067 3068 3069 3070 3071 3072 3073 3074 |
# File 'lib/hook0/generated/models.rb', line 3067 def to_h out = {} out["headers"] = @headers out["method"] = @method_ out["type"] = @type out["url"] = @url out end |