Class: Hook0::Generated::SubscriptionPostTarget
- Inherits:
-
Object
- Object
- Hook0::Generated::SubscriptionPostTarget
- Defined in:
- lib/hook0/generated/models.rb
Overview
The SubscriptionPostTarget 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) ⇒ SubscriptionPostTarget
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:) ⇒ SubscriptionPostTarget
constructor
A new instance of SubscriptionPostTarget.
-
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
Constructor Details
#initialize(headers:, method_:, type:, url:) ⇒ SubscriptionPostTarget
Returns a new instance of SubscriptionPostTarget.
2980 2981 2982 2983 2984 2985 2986 |
# File 'lib/hook0/generated/models.rb', line 2980 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.
2971 2972 2973 |
# File 'lib/hook0/generated/models.rb', line 2971 def headers @headers end |
#method_ ⇒ Object (readonly)
Returns the value of attribute method_.
2971 2972 2973 |
# File 'lib/hook0/generated/models.rb', line 2971 def method_ @method_ end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
2971 2972 2973 |
# File 'lib/hook0/generated/models.rb', line 2971 def type @type end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
2971 2972 2973 |
# File 'lib/hook0/generated/models.rb', line 2971 def url @url end |
Class Method Details
.from_json(value) ⇒ SubscriptionPostTarget
Read one out of what the API answered.
2992 2993 2994 2995 2996 2997 2998 2999 3000 |
# File 'lib/hook0/generated/models.rb', line 2992 def self.from_json(value) fields = Runtime.as_fields(value, "SubscriptionPostTarget") 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.
3018 3019 3020 |
# File 'lib/hook0/generated/models.rb', line 3018 def ==(other) other.is_a?(SubscriptionPostTarget) && to_h == other.to_h end |
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
3026 3027 3028 |
# File 'lib/hook0/generated/models.rb', line 3026 def hash to_h.hash end |
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
3005 3006 3007 3008 3009 3010 3011 3012 |
# File 'lib/hook0/generated/models.rb', line 3005 def to_h out = {} out["headers"] = @headers out["method"] = @method_ out["type"] = @type out["url"] = @url out end |