Class: Verizon::CreateSubscriptionRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::CreateSubscriptionRequest
- Defined in:
- lib/verizon/models/create_subscription_request.rb
Overview
The details of the subscription that you want to create.
Instance Attribute Summary collapse
-
#accountidentifier ⇒ AccountIdentifier
The ID of the authenticating billing account, in the format ‘“billingaccountid”:“1234567890-12345”`.
-
#allowaggregation ⇒ TrueClass | FalseClass
Setting this value to ‘false` prevents the data returned from being aggregated and makes the data easier to parse.
-
#billingaccountid ⇒ String
String containing a $filter object with a property and value to filter out non-matching events.
-
#description ⇒ String
Descriptive information about the subscription.
-
#disabled ⇒ TrueClass | FalseClass
Enable or disable the subscription.
-
#email ⇒ String
The address to which any error reports should be delivered.
-
#filter ⇒ String
String containing a $filter object with a property and value to filter out non-matching events.
-
#name ⇒ String
Name of the subscription.
-
#streamkind ⇒ String
The type of event data to send via this subscription.
-
#targetid ⇒ String
The ID of the target resource to be used when dispatching events.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(accountidentifier = SKIP, description = SKIP, disabled = SKIP, email = SKIP, filter = SKIP, billingaccountid = SKIP, streamkind = SKIP, targetid = SKIP, name = SKIP, allowaggregation = SKIP) ⇒ CreateSubscriptionRequest
constructor
A new instance of CreateSubscriptionRequest.
Methods inherited from BaseModel
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
#accountidentifier ⇒ AccountIdentifier
The ID of the authenticating billing account, in the format ‘“billingaccountid”:“1234567890-12345”`.
15 16 17 |
# File 'lib/verizon/models/create_subscription_request.rb', line 15 def accountidentifier @accountidentifier end |
#allowaggregation ⇒ TrueClass | FalseClass
Setting this value to ‘false` prevents the data returned from being aggregated and makes the data easier to parse.
61 62 63 |
# File 'lib/verizon/models/create_subscription_request.rb', line 61 def allowaggregation @allowaggregation end |
#billingaccountid ⇒ String
String containing a $filter object with a property and value to filter out non-matching events.
38 39 40 |
# File 'lib/verizon/models/create_subscription_request.rb', line 38 def billingaccountid @billingaccountid end |
#description ⇒ String
Descriptive information about the subscription.
19 20 21 |
# File 'lib/verizon/models/create_subscription_request.rb', line 19 def description @description end |
#disabled ⇒ TrueClass | FalseClass
Enable or disable the subscription. A disabled subscription will not send any data.
24 25 26 |
# File 'lib/verizon/models/create_subscription_request.rb', line 24 def disabled @disabled end |
#email ⇒ String
The address to which any error reports should be delivered.
28 29 30 |
# File 'lib/verizon/models/create_subscription_request.rb', line 28 def email @email end |
#filter ⇒ String
String containing a $filter object with a property and value to filter out non-matching events.
33 34 35 |
# File 'lib/verizon/models/create_subscription_request.rb', line 33 def filter @filter end |
#name ⇒ String
Name of the subscription.
56 57 58 |
# File 'lib/verizon/models/create_subscription_request.rb', line 56 def name @name end |
#streamkind ⇒ String
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`.
47 48 49 |
# File 'lib/verizon/models/create_subscription_request.rb', line 47 def streamkind @streamkind end |
#targetid ⇒ String
The ID of the target resource to be used when dispatching events. The corresponding target should have a “stream” addressscheme.
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 |
.names ⇒ Object
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 |
.nullables ⇒ Object
An array for nullable fields
96 97 98 |
# File 'lib/verizon/models/create_subscription_request.rb', line 96 def self.nullables [] end |
.optionals ⇒ Object
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 |