Class: Verizon::Triggervalues

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/verizon/models/triggervalues.rb

Overview

Triggervalues Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(trigger_id = SKIP, trigger_name = SKIP, account_name = SKIP, organization_name = SKIP, trigger_category = SKIP, trigger_attributes = SKIP, created_at = SKIP, modified_at = SKIP) ⇒ Triggervalues

Returns a new instance of Triggervalues.



78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/verizon/models/triggervalues.rb', line 78

def initialize(trigger_id = SKIP, trigger_name = SKIP,  = SKIP,
               organization_name = SKIP, trigger_category = SKIP,
               trigger_attributes = SKIP, created_at = SKIP,
               modified_at = SKIP)
  @trigger_id = trigger_id unless trigger_id == SKIP
  @trigger_name = trigger_name unless trigger_name == SKIP
  @account_name =  unless  == SKIP
  @organization_name = organization_name unless organization_name == SKIP
  @trigger_category = trigger_category unless trigger_category == SKIP
  @trigger_attributes = trigger_attributes unless trigger_attributes == SKIP
  @created_at = created_at unless created_at == SKIP
  @modified_at = modified_at unless modified_at == SKIP
end

Instance Attribute Details

#account_nameString

TODO: Write general description for this method

Returns:

  • (String)


23
24
25
# File 'lib/verizon/models/triggervalues.rb', line 23

def 
  @account_name
end

#created_atDateTime

TODO: Write general description for this method

Returns:

  • (DateTime)


39
40
41
# File 'lib/verizon/models/triggervalues.rb', line 39

def created_at
  @created_at
end

#modified_atDateTime

TODO: Write general description for this method

Returns:

  • (DateTime)


43
44
45
# File 'lib/verizon/models/triggervalues.rb', line 43

def modified_at
  @modified_at
end

#organization_nameString

TODO: Write general description for this method

Returns:

  • (String)


27
28
29
# File 'lib/verizon/models/triggervalues.rb', line 27

def organization_name
  @organization_name
end

#trigger_attributesArray[KeyDataPercentage50]

TODO: Write general description for this method

Returns:



35
36
37
# File 'lib/verizon/models/triggervalues.rb', line 35

def trigger_attributes
  @trigger_attributes
end

#trigger_categoryString

TODO: Write general description for this method

Returns:

  • (String)


31
32
33
# File 'lib/verizon/models/triggervalues.rb', line 31

def trigger_category
  @trigger_category
end

#trigger_idString

TODO: Write general description for this method

Returns:

  • (String)


15
16
17
# File 'lib/verizon/models/triggervalues.rb', line 15

def trigger_id
  @trigger_id
end

#trigger_nameString

TODO: Write general description for this method

Returns:

  • (String)


19
20
21
# File 'lib/verizon/models/triggervalues.rb', line 19

def trigger_name
  @trigger_name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/verizon/models/triggervalues.rb', line 93

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  trigger_id = hash.key?('triggerId') ? hash['triggerId'] : SKIP
  trigger_name = hash.key?('triggerName') ? hash['triggerName'] : SKIP
   = hash.key?('accountName') ? hash['accountName'] : SKIP
  organization_name =
    hash.key?('organizationName') ? hash['organizationName'] : SKIP
  trigger_category =
    hash.key?('triggerCategory') ? hash['triggerCategory'] : SKIP
  trigger_attributes = hash.key?('triggerAttributes') ? APIHelper.deserialize_union_type(
    UnionTypeLookUp.get(:KeysChunk), hash['triggerAttributes']
  ) : SKIP
  created_at = if hash.key?('createdAt')
                 (DateTimeHelper.from_rfc3339(hash['createdAt']) if hash['createdAt'])
               else
                 SKIP
               end
  modified_at = if hash.key?('modifiedAt')
                  (DateTimeHelper.from_rfc3339(hash['modifiedAt']) if hash['modifiedAt'])
                else
                  SKIP
                end

  # Create object from extracted values.
  Triggervalues.new(trigger_id,
                    trigger_name,
                    ,
                    organization_name,
                    trigger_category,
                    trigger_attributes,
                    created_at,
                    modified_at)
end

.namesObject

A mapping from model property names to API property names.



46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/verizon/models/triggervalues.rb', line 46

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['trigger_id'] = 'triggerId'
  @_hash['trigger_name'] = 'triggerName'
  @_hash['account_name'] = 'accountName'
  @_hash['organization_name'] = 'organizationName'
  @_hash['trigger_category'] = 'triggerCategory'
  @_hash['trigger_attributes'] = 'triggerAttributes'
  @_hash['created_at'] = 'createdAt'
  @_hash['modified_at'] = 'modifiedAt'
  @_hash
end

.nullablesObject

An array for nullable fields



74
75
76
# File 'lib/verizon/models/triggervalues.rb', line 74

def self.nullables
  []
end

.optionalsObject

An array for optional fields



60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/verizon/models/triggervalues.rb', line 60

def self.optionals
  %w[
    trigger_id
    trigger_name
    account_name
    organization_name
    trigger_category
    trigger_attributes
    created_at
    modified_at
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:

  • The (Triggervalues | Hash)

    value against the validation is performed.



139
140
141
142
143
144
145
# File 'lib/verizon/models/triggervalues.rb', line 139

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



157
158
159
160
161
162
163
164
# File 'lib/verizon/models/triggervalues.rb', line 157

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} trigger_id: #{@trigger_id.inspect}, trigger_name: #{@trigger_name.inspect},"\
  " account_name: #{@account_name.inspect}, organization_name: #{@organization_name.inspect},"\
  " trigger_category: #{@trigger_category.inspect}, trigger_attributes:"\
  " #{@trigger_attributes.inspect}, created_at: #{@created_at.inspect}, modified_at:"\
  " #{@modified_at.inspect}>"
end

#to_custom_created_atObject



129
130
131
# File 'lib/verizon/models/triggervalues.rb', line 129

def to_custom_created_at
  DateTimeHelper.to_rfc3339(created_at)
end

#to_custom_modified_atObject



133
134
135
# File 'lib/verizon/models/triggervalues.rb', line 133

def to_custom_modified_at
  DateTimeHelper.to_rfc3339(modified_at)
end

#to_sObject

Provides a human-readable string representation of the object.



148
149
150
151
152
153
154
# File 'lib/verizon/models/triggervalues.rb', line 148

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} trigger_id: #{@trigger_id}, trigger_name: #{@trigger_name}, account_name:"\
  " #{@account_name}, organization_name: #{@organization_name}, trigger_category:"\
  " #{@trigger_category}, trigger_attributes: #{@trigger_attributes}, created_at:"\
  " #{@created_at}, modified_at: #{@modified_at}>"
end