Class: Verizon::FotaV1CallbackRegistrationRequest

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

Overview

Callback endpoint information.

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) ⇒ FotaV1CallbackRegistrationRequest

Returns a new instance of FotaV1CallbackRegistrationRequest.



53
54
55
56
57
58
# File 'lib/verizon/models/fota_v1_callback_registration_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, which must be ‘Fota’ for Software Management Services callbacks.

Returns:

  • (String)


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

def name
  @name
end

#passwordString

The password that ThingSpace should return in the callback messages.

Returns:

  • (String)


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

def password
  @password
end

#urlString

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

Returns:

  • (String)


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

def url
  @url
end

#usernameString

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

Returns:

  • (String)


24
25
26
# File 'lib/verizon/models/fota_v1_callback_registration_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/fota_v1_callback_registration_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.
  FotaV1CallbackRegistrationRequest.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/fota_v1_callback_registration_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/fota_v1_callback_registration_request.rb', line 49

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    username
    password
  ]
end