Class: Verizon::ProvisioningHistory
- Defined in:
- lib/verizon/models/provisioning_history.rb
Overview
The provisioning history of a specified device during a specified time period.
Instance Attribute Summary collapse
-
#event_by ⇒ String
The user who performed the provisioning event.
-
#event_type ⇒ String
The provisioning action:Activate,Suspend,Restore,Deactivate,Device Move.
-
#extended_attributes ⇒ Array[CustomFields]
Any extended attributes for the event, as Key and Value pairs.
-
#mdn ⇒ String
The MDN assigned to the device after the provisioning event.
-
#msisdn ⇒ String
The MSISDN assigned to the device after the provisioning event.
-
#occurred_at ⇒ String
The date and time when the provisioning event occured.
-
#service_plan ⇒ String
The service plan of the device after the provisioning event occurred.
-
#status ⇒ String
The success or failure of the provisioning event.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(occurred_at = SKIP, status = SKIP, event_by = SKIP, event_type = SKIP, mdn = SKIP, msisdn = SKIP, service_plan = SKIP, extended_attributes = SKIP) ⇒ ProvisioningHistory
constructor
A new instance of ProvisioningHistory.
Methods inherited from BaseModel
Constructor Details
#initialize(occurred_at = SKIP, status = SKIP, event_by = SKIP, event_type = SKIP, mdn = SKIP, msisdn = SKIP, service_plan = SKIP, extended_attributes = SKIP) ⇒ ProvisioningHistory
Returns a new instance of ProvisioningHistory.
78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/verizon/models/provisioning_history.rb', line 78 def initialize(occurred_at = SKIP, status = SKIP, event_by = SKIP, event_type = SKIP, mdn = SKIP, msisdn = SKIP, service_plan = SKIP, extended_attributes = SKIP) @occurred_at = occurred_at unless occurred_at == SKIP @status = status unless status == SKIP @event_by = event_by unless event_by == SKIP @event_type = event_type unless event_type == SKIP @mdn = mdn unless mdn == SKIP @msisdn = msisdn unless msisdn == SKIP @service_plan = service_plan unless service_plan == SKIP @extended_attributes = extended_attributes unless extended_attributes == SKIP end |
Instance Attribute Details
#event_by ⇒ String
The user who performed the provisioning event.
23 24 25 |
# File 'lib/verizon/models/provisioning_history.rb', line 23 def event_by @event_by end |
#event_type ⇒ String
The provisioning action:Activate,Suspend,Restore,Deactivate,Device Move.
27 28 29 |
# File 'lib/verizon/models/provisioning_history.rb', line 27 def event_type @event_type end |
#extended_attributes ⇒ Array[CustomFields]
Any extended attributes for the event, as Key and Value pairs.
43 44 45 |
# File 'lib/verizon/models/provisioning_history.rb', line 43 def extended_attributes @extended_attributes end |
#mdn ⇒ String
The MDN assigned to the device after the provisioning event.
31 32 33 |
# File 'lib/verizon/models/provisioning_history.rb', line 31 def mdn @mdn end |
#msisdn ⇒ String
The MSISDN assigned to the device after the provisioning event.
35 36 37 |
# File 'lib/verizon/models/provisioning_history.rb', line 35 def msisdn @msisdn end |
#occurred_at ⇒ String
The date and time when the provisioning event occured.
15 16 17 |
# File 'lib/verizon/models/provisioning_history.rb', line 15 def occurred_at @occurred_at end |
#service_plan ⇒ String
The service plan of the device after the provisioning event occurred.
39 40 41 |
# File 'lib/verizon/models/provisioning_history.rb', line 39 def service_plan @service_plan end |
#status ⇒ String
The success or failure of the provisioning event.
19 20 21 |
# File 'lib/verizon/models/provisioning_history.rb', line 19 def status @status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
92 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 |
# File 'lib/verizon/models/provisioning_history.rb', line 92 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. occurred_at = hash.key?('occurredAt') ? hash['occurredAt'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP event_by = hash.key?('eventBy') ? hash['eventBy'] : SKIP event_type = hash.key?('eventType') ? hash['eventType'] : SKIP mdn = hash.key?('mdn') ? hash['mdn'] : SKIP msisdn = hash.key?('msisdn') ? hash['msisdn'] : SKIP service_plan = hash.key?('servicePlan') ? hash['servicePlan'] : SKIP # Parameter is an array, so we need to iterate through it extended_attributes = nil unless hash['extendedAttributes'].nil? extended_attributes = [] hash['extendedAttributes'].each do |structure| extended_attributes << (CustomFields.from_hash(structure) if structure) end end extended_attributes = SKIP unless hash.key?('extendedAttributes') # Create object from extracted values. ProvisioningHistory.new(occurred_at, status, event_by, event_type, mdn, msisdn, service_plan, extended_attributes) end |
.names ⇒ Object
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/provisioning_history.rb', line 46 def self.names @_hash = {} if @_hash.nil? @_hash['occurred_at'] = 'occurredAt' @_hash['status'] = 'status' @_hash['event_by'] = 'eventBy' @_hash['event_type'] = 'eventType' @_hash['mdn'] = 'mdn' @_hash['msisdn'] = 'msisdn' @_hash['service_plan'] = 'servicePlan' @_hash['extended_attributes'] = 'extendedAttributes' @_hash end |
.nullables ⇒ Object
An array for nullable fields
74 75 76 |
# File 'lib/verizon/models/provisioning_history.rb', line 74 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/verizon/models/provisioning_history.rb', line 60 def self.optionals %w[ occurred_at status event_by event_type mdn msisdn service_plan extended_attributes ] end |