Class: Verizon::ConnectivityManagementCallback

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

Overview

Includes callback listeners that were registered through the Connectivity Management API.

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 = SKIP, password = SKIP, service_name = SKIP, url = SKIP, username = SKIP) ⇒ ConnectivityManagementCallback

Returns a new instance of ConnectivityManagementCallback.



64
65
66
67
68
69
70
71
# File 'lib/verizon/models/connectivity_management_callback.rb', line 64

def initialize( = SKIP, password = SKIP, service_name = SKIP,
               url = SKIP, username = SKIP)
  @account_name =  unless  == SKIP
  @password = password unless password == SKIP
  @service_name = service_name unless service_name == SKIP
  @url = url unless url == SKIP
  @username = username unless username == SKIP
end

Instance Attribute Details

#account_nameString

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

Returns:

  • (String)


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

def 
  @account_name
end

#passwordString

The password defined when a URL was registered for the callback service, or an empty string if no password was defined.

Returns:

  • (String)


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

def password
  @password
end

#service_nameString

The name of the callback service, which identifies the type and format of messages that will be sent to the registered URL.

Returns:

  • (String)


25
26
27
# File 'lib/verizon/models/connectivity_management_callback.rb', line 25

def service_name
  @service_name
end

#urlString

The address of the callback listening service where the ThingSpace Platform will send callback messages for the service type.

Returns:

  • (String)


30
31
32
# File 'lib/verizon/models/connectivity_management_callback.rb', line 30

def url
  @url
end

#usernameString

The username defined when a URL was registered for the callback service, or an empty string if no username was defined.

Returns:

  • (String)


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

def username
  @username
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

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

  # Create object from extracted values.
  ConnectivityManagementCallback.new(,
                                     password,
                                     service_name,
                                     url,
                                     username)
end

.namesObject

A mapping from model property names to API property names.



38
39
40
41
42
43
44
45
46
# File 'lib/verizon/models/connectivity_management_callback.rb', line 38

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_name'] = 'accountName'
  @_hash['password'] = 'password'
  @_hash['service_name'] = 'serviceName'
  @_hash['url'] = 'url'
  @_hash['username'] = 'username'
  @_hash
end

.nullablesObject

An array for nullable fields



60
61
62
# File 'lib/verizon/models/connectivity_management_callback.rb', line 60

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    account_name
    password
    service_name
    url
    username
  ]
end