Class: Hook0::Generated::SubscriptionPostTarget

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

Overview

The SubscriptionPostTarget the API declares.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(headers:, method_:, type:, url:) ⇒ SubscriptionPostTarget

Returns a new instance of SubscriptionPostTarget.

Parameters:

  • headers (Object)

    carries headers.

  • method_ (String)

    carries method.

  • type (String)

    carries type.

  • url (String)

    carries url.



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

#headersObject (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

#typeObject (readonly)

Returns the value of attribute type.



2971
2972
2973
# File 'lib/hook0/generated/models.rb', line 2971

def type
  @type
end

#urlObject (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.

Parameters:

  • value (Object)

    the JSON document the API answered

Returns:



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.

Parameters:

  • other (Object)

Returns:

  • (Boolean)


3018
3019
3020
# File 'lib/hook0/generated/models.rb', line 3018

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

#hashInteger

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

Returns:

  • (Integer)


3026
3027
3028
# File 'lib/hook0/generated/models.rb', line 3026

def hash
  to_h.hash
end

#to_hHash{String => Object}

Write one back the way the API reads it.

Returns:

  • (Hash{String => Object})


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