Class: Verizon::CreateSubscriptionRequest

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

Overview

The details of the subscription that you want to create.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(accountidentifier = SKIP, description = SKIP, disabled = SKIP, email = SKIP, filter = SKIP, billingaccountid = SKIP, streamkind = SKIP, targetid = SKIP, name = SKIP, allowaggregation = SKIP) ⇒ CreateSubscriptionRequest

Returns a new instance of CreateSubscriptionRequest.



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/verizon/models/create_subscription_request.rb', line 100

def initialize(accountidentifier = SKIP, description = SKIP,
               disabled = SKIP, email = SKIP, filter = SKIP,
               billingaccountid = SKIP, streamkind = SKIP, targetid = SKIP,
               name = SKIP, allowaggregation = SKIP)
  @accountidentifier = accountidentifier unless accountidentifier == SKIP
  @description = description unless description == SKIP
  @disabled = disabled unless disabled == SKIP
  @email = email unless email == SKIP
  @filter = filter unless filter == SKIP
  @billingaccountid = billingaccountid unless billingaccountid == SKIP
  @streamkind = streamkind unless streamkind == SKIP
  @targetid = targetid unless targetid == SKIP
  @name = name unless name == SKIP
  @allowaggregation = allowaggregation unless allowaggregation == SKIP
end

Instance Attribute Details

#accountidentifierAccountIdentifier

The ID of the authenticating billing account, in the format ‘“billingaccountid”:“1234567890-12345”`.

Returns:



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

def accountidentifier
  @accountidentifier
end

#allowaggregationTrueClass | FalseClass

Setting this value to ‘false` prevents the data returned from being aggregated and makes the data easier to parse.

Returns:

  • (TrueClass | FalseClass)


61
62
63
# File 'lib/verizon/models/create_subscription_request.rb', line 61

def allowaggregation
  @allowaggregation
end

#billingaccountidString

String containing a $filter object with a property and value to filter out non-matching events.

Returns:

  • (String)


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

def billingaccountid
  @billingaccountid
end

#descriptionString

Descriptive information about the subscription.

Returns:

  • (String)


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

def description
  @description
end

#disabledTrueClass | FalseClass

Enable or disable the subscription. A disabled subscription will not send any data.

Returns:

  • (TrueClass | FalseClass)


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

def disabled
  @disabled
end

#emailString

The address to which any error reports should be delivered.

Returns:

  • (String)


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

def email
  @email
end

#filterString

String containing a $filter object with a property and value to filter out non-matching events.

Returns:

  • (String)


33
34
35
# File 'lib/verizon/models/create_subscription_request.rb', line 33

def filter
  @filter
end

#nameString

Name of the subscription.

Returns:

  • (String)


56
57
58
# File 'lib/verizon/models/create_subscription_request.rb', line 56

def name
  @name
end

#streamkindString

The type of event data to send via this subscription. This will be ‘ts.event` in most cases. Other event types are `ts.event.diagnostics` for device diagnostic data, `ts.event.configuration` for device configuration events, or `ts.event.security`. Note that the device ThingSpace client must support sending specific event types for anything other than `ts.event`.

Returns:

  • (String)


47
48
49
# File 'lib/verizon/models/create_subscription_request.rb', line 47

def streamkind
  @streamkind
end

#targetidString

The ID of the target resource to be used when dispatching events. The corresponding target should have a “stream” addressscheme.

Returns:

  • (String)


52
53
54
# File 'lib/verizon/models/create_subscription_request.rb', line 52

def targetid
  @targetid
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  accountidentifier = AccountIdentifier.from_hash(hash['accountidentifier']) if
    hash['accountidentifier']
  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
  billingaccountid =
    hash.key?('billingaccountid') ? hash['billingaccountid'] : SKIP
  streamkind = hash.key?('streamkind') ? hash['streamkind'] : SKIP
  targetid = hash.key?('targetid') ? hash['targetid'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  allowaggregation =
    hash.key?('allowaggregation') ? hash['allowaggregation'] : SKIP

  # Create object from extracted values.
  CreateSubscriptionRequest.new(accountidentifier,
                                description,
                                disabled,
                                email,
                                filter,
                                billingaccountid,
                                streamkind,
                                targetid,
                                name,
                                allowaggregation)
end

.namesObject

A mapping from model property names to API property names.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/verizon/models/create_subscription_request.rb', line 64

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['accountidentifier'] = 'accountidentifier'
  @_hash['description'] = 'description'
  @_hash['disabled'] = 'disabled'
  @_hash['email'] = 'email'
  @_hash['filter'] = 'filter'
  @_hash['billingaccountid'] = 'billingaccountid'
  @_hash['streamkind'] = 'streamkind'
  @_hash['targetid'] = 'targetid'
  @_hash['name'] = 'name'
  @_hash['allowaggregation'] = 'allowaggregation'
  @_hash
end

.nullablesObject

An array for nullable fields



96
97
98
# File 'lib/verizon/models/create_subscription_request.rb', line 96

def self.nullables
  []
end

.optionalsObject

An array for optional fields



80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/verizon/models/create_subscription_request.rb', line 80

def self.optionals
  %w[
    accountidentifier
    description
    disabled
    email
    filter
    billingaccountid
    streamkind
    targetid
    name
    allowaggregation
  ]
end