Class: Verizon::RegisteredCallbacks

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

Overview

List of registered callback endpoints.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(aname = SKIP, name = SKIP, url = SKIP, username = SKIP, password = SKIP) ⇒ RegisteredCallbacks

Returns a new instance of RegisteredCallbacks.



61
62
63
64
65
66
67
68
# File 'lib/verizon/models/registered_callbacks.rb', line 61

def initialize(aname = SKIP, name = SKIP, url = SKIP, username = SKIP,
               password = SKIP)
  @aname = aname unless aname == SKIP
  @name = name unless name == SKIP
  @url = url unless url == SKIP
  @username = username unless username == SKIP
  @password = password unless password == SKIP
end

Instance Attribute Details

#anameString

The name of the billing account for which callback messages will be sent.

Returns:

  • (String)


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

def aname
  @aname
end

#nameString

The name of the callback service, which identifies the type and format of messages that will be sent to the registered URL. This will be ‘Fota’ for the Software Management Services callback.

Returns:

  • (String)


20
21
22
# File 'lib/verizon/models/registered_callbacks.rb', line 20

def name
  @name
end

#passwordString

The password that ThingSpace will return in the callback messages.

Returns:

  • (String)


32
33
34
# File 'lib/verizon/models/registered_callbacks.rb', line 32

def password
  @password
end

#urlString

The address to which callback messages will be sent.

Returns:

  • (String)


24
25
26
# File 'lib/verizon/models/registered_callbacks.rb', line 24

def url
  @url
end

#usernameString

The user name that ThingSpace will return in the callback messages.

Returns:

  • (String)


28
29
30
# File 'lib/verizon/models/registered_callbacks.rb', line 28

def username
  @username
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/verizon/models/registered_callbacks.rb', line 71

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  aname = hash.key?('aname') ? hash['aname'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  url = hash.key?('url') ? hash['url'] : SKIP
  username = hash.key?('username') ? hash['username'] : SKIP
  password = hash.key?('password') ? hash['password'] : SKIP

  # Create object from extracted values.
  RegisteredCallbacks.new(aname,
                          name,
                          url,
                          username,
                          password)
end

.namesObject

A mapping from model property names to API property names.



35
36
37
38
39
40
41
42
43
# File 'lib/verizon/models/registered_callbacks.rb', line 35

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['aname'] = 'aname'
  @_hash['name'] = 'name'
  @_hash['url'] = 'url'
  @_hash['username'] = 'username'
  @_hash['password'] = 'password'
  @_hash
end

.nullablesObject

An array for nullable fields



57
58
59
# File 'lib/verizon/models/registered_callbacks.rb', line 57

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    aname
    name
    url
    username
    password
  ]
end