Class: Verizon::NotificationReportStatusRequest

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

Overview

NotificationReportStatusRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(account_name = nil, device = nil, request_type = nil, request_expiration_time = SKIP) ⇒ NotificationReportStatusRequest

Returns a new instance of NotificationReportStatusRequest.



50
51
52
53
54
55
56
# File 'lib/verizon/models/notification_report_status_request.rb', line 50

def initialize( = nil, device = nil, request_type = nil,
               request_expiration_time = SKIP)
  @account_name = 
  @device = device
  @request_type = request_type
  @request_expiration_time = request_expiration_time unless request_expiration_time == SKIP
end

Instance Attribute Details

#account_nameString

The name of a billing account.

Returns:

  • (String)


14
15
16
# File 'lib/verizon/models/notification_report_status_request.rb', line 14

def 
  @account_name
end

#deviceDeviceId

An identifier for a single device.

Returns:



18
19
20
# File 'lib/verizon/models/notification_report_status_request.rb', line 18

def device
  @device
end

#request_expiration_timeString

The time at which the request expires.

Returns:

  • (String)


26
27
28
# File 'lib/verizon/models/notification_report_status_request.rb', line 26

def request_expiration_time
  @request_expiration_time
end

#request_typeString

The type of request.

Returns:

  • (String)


22
23
24
# File 'lib/verizon/models/notification_report_status_request.rb', line 22

def request_type
  @request_type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/verizon/models/notification_report_status_request.rb', line 59

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('accountName') ? hash['accountName'] : nil
  device = DeviceId.from_hash(hash['device']) if hash['device']
  request_type = hash.key?('requestType') ? hash['requestType'] : nil
  request_expiration_time =
    hash.key?('requestExpirationTime') ? hash['requestExpirationTime'] : SKIP

  # Create object from extracted values.
  NotificationReportStatusRequest.new(,
                                      device,
                                      request_type,
                                      request_expiration_time)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
36
# File 'lib/verizon/models/notification_report_status_request.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_name'] = 'accountName'
  @_hash['device'] = 'device'
  @_hash['request_type'] = 'requestType'
  @_hash['request_expiration_time'] = 'requestExpirationTime'
  @_hash
end

.nullablesObject

An array for nullable fields



46
47
48
# File 'lib/verizon/models/notification_report_status_request.rb', line 46

def self.nullables
  []
end

.optionalsObject

An array for optional fields



39
40
41
42
43
# File 'lib/verizon/models/notification_report_status_request.rb', line 39

def self.optionals
  %w[
    request_expiration_time
  ]
end