Class: Verizon::RegisterCallbackRequest

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

Overview

Request to register a callback.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(name = nil, url = nil, username = SKIP, password = SKIP) ⇒ RegisterCallbackRequest

Returns a new instance of RegisterCallbackRequest.



53
54
55
56
57
58
# File 'lib/verizon/models/register_callback_request.rb', line 53

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

Instance Attribute Details

#nameString

The name of the callback service that you want to subscribe to.

Returns:

  • (String)


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

def name
  @name
end

#passwordString

The password that the M2M Platform should return in the callback messages.

Returns:

  • (String)


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

def password
  @password
end

#urlString

The address on your server where you have enabled a listening service for callback messages.

Returns:

  • (String)


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

def url
  @url
end

#usernameString

The user name that the M2M Platform should return in the callback messages.

Returns:

  • (String)


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

def username
  @username
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

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

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

.namesObject

A mapping from model property names to API property names.



31
32
33
34
35
36
37
38
# File 'lib/verizon/models/register_callback_request.rb', line 31

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

.nullablesObject

An array for nullable fields



49
50
51
# File 'lib/verizon/models/register_callback_request.rb', line 49

def self.nullables
  []
end

.optionalsObject

An array for optional fields



41
42
43
44
45
46
# File 'lib/verizon/models/register_callback_request.rb', line 41

def self.optionals
  %w[
    username
    password
  ]
end