Class: Hook0::Generated::EventTypePost

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

Overview

The EventTypePost the API declares.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(application_id:, resource_type:, service:, verb:) ⇒ EventTypePost

Returns a new instance of EventTypePost.

Parameters:

  • application_id (String)

    carries application_id.

  • resource_type (String)

    carries resource_type.

  • service (String)

    carries service.

  • verb (String)

    carries verb.



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_idObject (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_typeObject (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

#serviceObject (readonly)

Returns the value of attribute service.



970
971
972
# File 'lib/hook0/generated/models.rb', line 970

def service
  @service
end

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

Parameters:

  • value (Object)

    the JSON document the API answered

Returns:



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.

Parameters:

  • other (Object)

Returns:

  • (Boolean)


1017
1018
1019
# File 'lib/hook0/generated/models.rb', line 1017

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

#hashInteger

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

Returns:

  • (Integer)


1025
1026
1027
# File 'lib/hook0/generated/models.rb', line 1025

def hash
  to_h.hash
end

#to_hHash{String => Object}

Write one back the way the API reads it.

Returns:

  • (Hash{String => Object})


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