Class: Verizon::Target

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

Overview

Target resource definition.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(address = SKIP, addressscheme = SKIP, billingaccountid = SKIP, createdon = SKIP, externalid = SKIP, id = SKIP, kind = SKIP, lastupdated = SKIP, name = SKIP, region = SKIP, version = SKIP, versionid = SKIP, description = SKIP) ⇒ Target

Returns a new instance of Target.



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/verizon/models/target.rb', line 107

def initialize(address = SKIP, addressscheme = SKIP,
               billingaccountid = SKIP, createdon = SKIP, externalid = SKIP,
               id = SKIP, kind = SKIP, lastupdated = SKIP, name = SKIP,
               region = SKIP, version = SKIP, versionid = SKIP,
               description = SKIP)
  @address = address unless address == SKIP
  @addressscheme = addressscheme unless addressscheme == SKIP
  @billingaccountid = billingaccountid unless billingaccountid == SKIP
  @createdon = createdon unless createdon == SKIP
  @externalid = externalid unless externalid == SKIP
  @id = id unless id == SKIP
  @kind = kind unless kind == SKIP
  @lastupdated = lastupdated unless lastupdated == SKIP
  @name = name unless name == SKIP
  @region = region unless region == SKIP
  @version = version unless version == SKIP
  @versionid = versionid unless versionid == SKIP
  @description = description unless description == SKIP
end

Instance Attribute Details

#addressString

The endpoint for data streams.

Returns:

  • (String)


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

def address
  @address
end

#addressschemeString

The transport format.

Returns:

  • (String)


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

def addressscheme
  @addressscheme
end

#billingaccountidString

The billing account ID.

Returns:

  • (String)


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

def billingaccountid
  @billingaccountid
end

#createdonString

The date the resource was created.

Returns:

  • (String)


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

def createdon
  @createdon
end

#descriptionString

Description of the target.

Returns:

  • (String)


62
63
64
# File 'lib/verizon/models/target.rb', line 62

def description
  @description
end

#externalidString

Security identification string.

Returns:

  • (String)


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

def externalid
  @externalid
end

#idString

ThingSpace unique ID for the target that was created.

Returns:

  • (String)


34
35
36
# File 'lib/verizon/models/target.rb', line 34

def id
  @id
end

#kindString

Identifies the resource kind. Targets are ts.target.

Returns:

  • (String)


38
39
40
# File 'lib/verizon/models/target.rb', line 38

def kind
  @kind
end

#lastupdatedString

The date the resource was last updated.

Returns:

  • (String)


42
43
44
# File 'lib/verizon/models/target.rb', line 42

def lastupdated
  @lastupdated
end

#nameString

Name of the target.

Returns:

  • (String)


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

def name
  @name
end

#regionString

AWS region value.

Returns:

  • (String)


50
51
52
# File 'lib/verizon/models/target.rb', line 50

def region
  @region
end

#versionString

Version of the underlying schema resource.

Returns:

  • (String)


54
55
56
# File 'lib/verizon/models/target.rb', line 54

def version
  @version
end

#versionidString

The version of the resource.

Returns:

  • (String)


58
59
60
# File 'lib/verizon/models/target.rb', line 58

def versionid
  @versionid
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/verizon/models/target.rb', line 128

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  address = hash.key?('address') ? hash['address'] : SKIP
  addressscheme = hash.key?('addressscheme') ? hash['addressscheme'] : SKIP
  billingaccountid =
    hash.key?('billingaccountid') ? hash['billingaccountid'] : SKIP
  createdon = hash.key?('createdon') ? hash['createdon'] : SKIP
  externalid = hash.key?('externalid') ? hash['externalid'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  kind = hash.key?('kind') ? hash['kind'] : SKIP
  lastupdated = hash.key?('lastupdated') ? hash['lastupdated'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  region = hash.key?('region') ? hash['region'] : SKIP
  version = hash.key?('version') ? hash['version'] : SKIP
  versionid = hash.key?('versionid') ? hash['versionid'] : SKIP
  description = hash.key?('description') ? hash['description'] : SKIP

  # Create object from extracted values.
  Target.new(address,
             addressscheme,
             billingaccountid,
             createdon,
             externalid,
             id,
             kind,
             lastupdated,
             name,
             region,
             version,
             versionid,
             description)
end

.namesObject

A mapping from model property names to API property names.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/verizon/models/target.rb', line 65

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['address'] = 'address'
  @_hash['addressscheme'] = 'addressscheme'
  @_hash['billingaccountid'] = 'billingaccountid'
  @_hash['createdon'] = 'createdon'
  @_hash['externalid'] = 'externalid'
  @_hash['id'] = 'id'
  @_hash['kind'] = 'kind'
  @_hash['lastupdated'] = 'lastupdated'
  @_hash['name'] = 'name'
  @_hash['region'] = 'region'
  @_hash['version'] = 'version'
  @_hash['versionid'] = 'versionid'
  @_hash['description'] = 'description'
  @_hash
end

.nullablesObject

An array for nullable fields



103
104
105
# File 'lib/verizon/models/target.rb', line 103

def self.nullables
  []
end

.optionalsObject

An array for optional fields



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/verizon/models/target.rb', line 84

def self.optionals
  %w[
    address
    addressscheme
    billingaccountid
    createdon
    externalid
    id
    kind
    lastupdated
    name
    region
    version
    versionid
    description
  ]
end