Class: Hook0::Generated::OrganizationInfoUsers

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

Overview

The OrganizationInfoUsers the API declares.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(email:, first_name:, last_name:, role:, user_id:) ⇒ OrganizationInfoUsers

Returns a new instance of OrganizationInfoUsers.

Parameters:

  • email (String)

    carries email.

  • first_name (String)

    carries first_name.

  • last_name (String)

    carries last_name.

  • role (String)

    carries role.

  • user_id (String)

    carries user_id.



1865
1866
1867
1868
1869
1870
1871
1872
# File 'lib/hook0/generated/models.rb', line 1865

def initialize(email:, first_name:, last_name:, role:, user_id:)
  @email = email
  @first_name = first_name
  @last_name = last_name
  @role = role
  @user_id = user_id
  freeze
end

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



1854
1855
1856
# File 'lib/hook0/generated/models.rb', line 1854

def email
  @email
end

#first_nameObject (readonly)

Returns the value of attribute first_name.



1854
1855
1856
# File 'lib/hook0/generated/models.rb', line 1854

def first_name
  @first_name
end

#last_nameObject (readonly)

Returns the value of attribute last_name.



1854
1855
1856
# File 'lib/hook0/generated/models.rb', line 1854

def last_name
  @last_name
end

#roleObject (readonly)

Returns the value of attribute role.



1854
1855
1856
# File 'lib/hook0/generated/models.rb', line 1854

def role
  @role
end

#user_idObject (readonly)

Returns the value of attribute user_id.



1854
1855
1856
# File 'lib/hook0/generated/models.rb', line 1854

def user_id
  @user_id
end

Class Method Details

.from_json(value) ⇒ OrganizationInfoUsers

Read one out of what the API answered.

Parameters:

  • value (Object)

    the JSON document the API answered

Returns:



1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
# File 'lib/hook0/generated/models.rb', line 1878

def self.from_json(value)
  fields = Runtime.as_fields(value, "OrganizationInfoUsers")
  new(
    email: Runtime.read(fields, "email", Runtime::TEXT),
    first_name: Runtime.read(fields, "first_name", Runtime::TEXT),
    last_name: Runtime.read(fields, "last_name", Runtime::TEXT),
    role: Runtime.read(fields, "role", Runtime::TEXT),
    user_id: Runtime.read(fields, "user_id", Runtime::UUID)
  )
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)


1906
1907
1908
# File 'lib/hook0/generated/models.rb', line 1906

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

#hashInteger

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

Returns:

  • (Integer)


1914
1915
1916
# File 'lib/hook0/generated/models.rb', line 1914

def hash
  to_h.hash
end

#to_hHash{String => Object}

Write one back the way the API reads it.

Returns:

  • (Hash{String => Object})


1892
1893
1894
1895
1896
1897
1898
1899
1900
# File 'lib/hook0/generated/models.rb', line 1892

def to_h
  out = {}
  out["email"] = @email
  out["first_name"] = @first_name
  out["last_name"] = @last_name
  out["role"] = @role
  out["user_id"] = @user_id
  out
end