Class: Verizon::Subscription

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

Overview

Subscription 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(configurationfailures = SKIP, createdon = SKIP, delegateid = SKIP, description = SKIP, disabled = SKIP, email = SKIP, filter = SKIP, id = SKIP, kind = SKIP, laststreamingstatus = SKIP, laststreamingtime = SKIP, lastupdated = SKIP, name = SKIP, networkfailures = SKIP, streamfailures = SKIP, streamkind = SKIP, targetid = SKIP, targettype = SKIP, version = SKIP, versionid = SKIP) ⇒ Subscription

Returns a new instance of Subscription.



149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/verizon/models/subscription.rb', line 149

def initialize(configurationfailures = SKIP, createdon = SKIP,
               delegateid = SKIP, description = SKIP, disabled = SKIP,
               email = SKIP, filter = SKIP, id = SKIP, kind = SKIP,
               laststreamingstatus = SKIP, laststreamingtime = SKIP,
               lastupdated = SKIP, name = SKIP, networkfailures = SKIP,
               streamfailures = SKIP, streamkind = SKIP, targetid = SKIP,
               targettype = SKIP, version = SKIP, versionid = SKIP)
  @configurationfailures = configurationfailures unless configurationfailures == SKIP
  @createdon = createdon unless createdon == SKIP
  @delegateid = delegateid unless delegateid == SKIP
  @description = description unless description == SKIP
  @disabled = disabled unless disabled == SKIP
  @email = email unless email == SKIP
  @filter = filter unless filter == SKIP
  @id = id unless id == SKIP
  @kind = kind unless kind == SKIP
  @laststreamingstatus = laststreamingstatus unless laststreamingstatus == SKIP
  @laststreamingtime = laststreamingtime unless laststreamingtime == SKIP
  @lastupdated = lastupdated unless lastupdated == SKIP
  @name = name unless name == SKIP
  @networkfailures = networkfailures unless networkfailures == SKIP
  @streamfailures = streamfailures unless streamfailures == SKIP
  @streamkind = streamkind unless streamkind == SKIP
  @targetid = targetid unless targetid == SKIP
  @targettype = targettype unless targettype == SKIP
  @version = version unless version == SKIP
  @versionid = versionid unless versionid == SKIP
end

Instance Attribute Details

#configurationfailuresInteger

The number of streaming failures due to faulty configuration.

Returns:

  • (Integer)


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

def configurationfailures
  @configurationfailures
end

#createdonString

The number of streaming failures due to faulty configuration.

Returns:

  • (String)


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

def createdon
  @createdon
end

#delegateidString

Not currently used.

Returns:

  • (String)


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

def delegateid
  @delegateid
end

#descriptionString

Description of the subscription.

Returns:

  • (String)


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

def description
  @description
end

#disabledTrueClass | FalseClass

Whether the subscription is currently sending data.

Returns:

  • (TrueClass | FalseClass)


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

def disabled
  @disabled
end

#emailString

The address to which any error reports should be delivered.

Returns:

  • (String)


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

def email
  @email
end

#filterString

Filter for events.

Returns:

  • (String)


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

def filter
  @filter
end

#idString

ThingSpace unique ID for the subscription that was created.

Returns:

  • (String)


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

def id
  @id
end

#kindString

Identifies the resource kind.

Returns:

  • (String)


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

def kind
  @kind
end

#laststreamingstatusString

Possible values: success or fail.

Returns:

  • (String)


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

def laststreamingstatus
  @laststreamingstatus
end

#laststreamingtimeString

The date and time that the last stream send was attempted.

Returns:

  • (String)


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

def laststreamingtime
  @laststreamingtime
end

#lastupdatedString

The date the resource was last updated.

Returns:

  • (String)


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

def lastupdated
  @lastupdated
end

#nameString

Name of the subscription.

Returns:

  • (String)


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

def name
  @name
end

#networkfailuresInteger

The number of failures due to network problems.

Returns:

  • (Integer)


66
67
68
# File 'lib/verizon/models/subscription.rb', line 66

def networkfailures
  @networkfailures
end

#streamfailuresInteger

The number of failures due to network problems.

Returns:

  • (Integer)


70
71
72
# File 'lib/verizon/models/subscription.rb', line 70

def streamfailures
  @streamfailures
end

#streamkindString

The event type that will be sent in the data stream.

Returns:

  • (String)


74
75
76
# File 'lib/verizon/models/subscription.rb', line 74

def streamkind
  @streamkind
end

#targetidString

Target to be used for dispatching events.

Returns:

  • (String)


78
79
80
# File 'lib/verizon/models/subscription.rb', line 78

def targetid
  @targetid
end

#targettypeString

Target to be used for dispatching events.

Returns:

  • (String)


82
83
84
# File 'lib/verizon/models/subscription.rb', line 82

def targettype
  @targettype
end

#versionString

Version of the underlying schema resource.

Returns:

  • (String)


86
87
88
# File 'lib/verizon/models/subscription.rb', line 86

def version
  @version
end

#versionidString

The version of the resource.

Returns:

  • (String)


90
91
92
# File 'lib/verizon/models/subscription.rb', line 90

def versionid
  @versionid
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/verizon/models/subscription.rb', line 179

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  configurationfailures =
    hash.key?('configurationfailures') ? hash['configurationfailures'] : SKIP
  createdon = hash.key?('createdon') ? hash['createdon'] : SKIP
  delegateid = hash.key?('delegateid') ? hash['delegateid'] : SKIP
  description = hash.key?('description') ? hash['description'] : SKIP
  disabled = hash.key?('disabled') ? hash['disabled'] : SKIP
  email = hash.key?('email') ? hash['email'] : SKIP
  filter = hash.key?('filter') ? hash['filter'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  kind = hash.key?('kind') ? hash['kind'] : SKIP
  laststreamingstatus =
    hash.key?('laststreamingstatus') ? hash['laststreamingstatus'] : SKIP
  laststreamingtime =
    hash.key?('laststreamingtime') ? hash['laststreamingtime'] : SKIP
  lastupdated = hash.key?('lastupdated') ? hash['lastupdated'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  networkfailures =
    hash.key?('networkfailures') ? hash['networkfailures'] : SKIP
  streamfailures =
    hash.key?('streamfailures') ? hash['streamfailures'] : SKIP
  streamkind = hash.key?('streamkind') ? hash['streamkind'] : SKIP
  targetid = hash.key?('targetid') ? hash['targetid'] : SKIP
  targettype = hash.key?('targettype') ? hash['targettype'] : SKIP
  version = hash.key?('version') ? hash['version'] : SKIP
  versionid = hash.key?('versionid') ? hash['versionid'] : SKIP

  # Create object from extracted values.
  Subscription.new(configurationfailures,
                   createdon,
                   delegateid,
                   description,
                   disabled,
                   email,
                   filter,
                   id,
                   kind,
                   laststreamingstatus,
                   laststreamingtime,
                   lastupdated,
                   name,
                   networkfailures,
                   streamfailures,
                   streamkind,
                   targetid,
                   targettype,
                   version,
                   versionid)
end

.namesObject

A mapping from model property names to API property names.



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/verizon/models/subscription.rb', line 93

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['configurationfailures'] = 'configurationfailures'
  @_hash['createdon'] = 'createdon'
  @_hash['delegateid'] = 'delegateid'
  @_hash['description'] = 'description'
  @_hash['disabled'] = 'disabled'
  @_hash['email'] = 'email'
  @_hash['filter'] = 'filter'
  @_hash['id'] = 'id'
  @_hash['kind'] = 'kind'
  @_hash['laststreamingstatus'] = 'laststreamingstatus'
  @_hash['laststreamingtime'] = 'laststreamingtime'
  @_hash['lastupdated'] = 'lastupdated'
  @_hash['name'] = 'name'
  @_hash['networkfailures'] = 'networkfailures'
  @_hash['streamfailures'] = 'streamfailures'
  @_hash['streamkind'] = 'streamkind'
  @_hash['targetid'] = 'targetid'
  @_hash['targettype'] = 'targettype'
  @_hash['version'] = 'version'
  @_hash['versionid'] = 'versionid'
  @_hash
end

.nullablesObject

An array for nullable fields



145
146
147
# File 'lib/verizon/models/subscription.rb', line 145

def self.nullables
  []
end

.optionalsObject

An array for optional fields



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/verizon/models/subscription.rb', line 119

def self.optionals
  %w[
    configurationfailures
    createdon
    delegateid
    description
    disabled
    email
    filter
    id
    kind
    laststreamingstatus
    laststreamingtime
    lastupdated
    name
    networkfailures
    streamfailures
    streamkind
    targetid
    targettype
    version
    versionid
  ]
end