Class: Verizon::CreateTargetRequest
- Defined in:
- lib/verizon/models/create_target_request.rb
Overview
Details of the target that you want to create.
Instance Attribute Summary collapse
-
#accountidentifier ⇒ AccountIdentifier
The ID of the authenticating billing account, in the format ‘“billingaccountid”:“1234567890-12345”`.
-
#address ⇒ String
The endpoint for notifications or data streams.
-
#addressscheme ⇒ String
The transport format.
-
#billingaccountid ⇒ String
The ID of the authenticating billing account.
-
#description ⇒ String
Descriptive information about the target.
-
#externalid ⇒ String
Security identification string created by a POST /targets/actions/newextid request.
-
#fields ⇒ CreateTargetRequestFields
The transport format.
-
#key1 ⇒ String
OAuth 2.0 bearer token.
-
#kind ⇒ String
Identifies the resource kind.
-
#name ⇒ String
Name of the target.
-
#oauth ⇒ TargetAuthentication
OAuth 2 token and refresh token for TS to stream events to Target.
-
#region ⇒ String
AWS region value.
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, billingaccountid = SKIP, kind = SKIP, address = SKIP, addressscheme = SKIP, fields = SKIP, description = SKIP, externalid = SKIP, name = SKIP, region = SKIP, key1 = SKIP, oauth = SKIP) ⇒ CreateTargetRequest
constructor
A new instance of CreateTargetRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(accountidentifier = SKIP, billingaccountid = SKIP, kind = SKIP, address = SKIP, addressscheme = SKIP, fields = SKIP, description = SKIP, externalid = SKIP, name = SKIP, region = SKIP, key1 = SKIP, oauth = SKIP) ⇒ CreateTargetRequest
Returns a new instance of CreateTargetRequest.
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/verizon/models/create_target_request.rb', line 109 def initialize(accountidentifier = SKIP, billingaccountid = SKIP, kind = SKIP, address = SKIP, addressscheme = SKIP, fields = SKIP, description = SKIP, externalid = SKIP, name = SKIP, region = SKIP, key1 = SKIP, oauth = SKIP) @accountidentifier = accountidentifier unless accountidentifier == SKIP @billingaccountid = billingaccountid unless billingaccountid == SKIP @kind = kind unless kind == SKIP @address = address unless address == SKIP @addressscheme = addressscheme unless addressscheme == SKIP @fields = fields unless fields == SKIP @description = description unless description == SKIP @externalid = externalid unless externalid == SKIP @name = name unless name == SKIP @region = region unless region == SKIP @key1 = key1 unless key1 == SKIP @oauth = oauth unless oauth == 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_target_request.rb', line 15 def accountidentifier @accountidentifier end |
#address ⇒ String
The endpoint for notifications or data streams. The format depends on the selected ‘addressscheme`.<br />`streamrest` requires a `host:port` value <br />`streamawsiot` requres a valid ARN.
29 30 31 |
# File 'lib/verizon/models/create_target_request.rb', line 29 def address @address end |
#addressscheme ⇒ String
The transport format. Valid values are: <br />streamawsiot - streamed data to an AWS account <br />streamrest - streamed REST data to a defined endpoint.
35 36 37 |
# File 'lib/verizon/models/create_target_request.rb', line 35 def addressscheme @addressscheme end |
#billingaccountid ⇒ String
The ID of the authenticating billing account.
19 20 21 |
# File 'lib/verizon/models/create_target_request.rb', line 19 def billingaccountid @billingaccountid end |
#description ⇒ String
Descriptive information about the target.
45 46 47 |
# File 'lib/verizon/models/create_target_request.rb', line 45 def description @description end |
#externalid ⇒ String
Security identification string created by a POST /targets/actions/newextid request.
50 51 52 |
# File 'lib/verizon/models/create_target_request.rb', line 50 def externalid @externalid end |
#fields ⇒ CreateTargetRequestFields
The transport format. Valid values are: <br />streamawsiot - streamed data to an AWS account <br />streamrest - streamed REST data to a defined endpoint.
41 42 43 |
# File 'lib/verizon/models/create_target_request.rb', line 41 def fields @fields end |
#key1 ⇒ String
OAuth 2.0 bearer token.
62 63 64 |
# File 'lib/verizon/models/create_target_request.rb', line 62 def key1 @key1 end |
#kind ⇒ String
Identifies the resource kind. Targets are ts.target.
23 24 25 |
# File 'lib/verizon/models/create_target_request.rb', line 23 def kind @kind end |
#name ⇒ String
Name of the target.
54 55 56 |
# File 'lib/verizon/models/create_target_request.rb', line 54 def name @name end |
#oauth ⇒ TargetAuthentication
OAuth 2 token and refresh token for TS to stream events to Target.
66 67 68 |
# File 'lib/verizon/models/create_target_request.rb', line 66 def oauth @oauth end |
#region ⇒ String
AWS region value.
58 59 60 |
# File 'lib/verizon/models/create_target_request.rb', line 58 def region @region 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 |
# File 'lib/verizon/models/create_target_request.rb', line 128 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. accountidentifier = AccountIdentifier.from_hash(hash['accountidentifier']) if hash['accountidentifier'] billingaccountid = hash.key?('billingaccountid') ? hash['billingaccountid'] : SKIP kind = hash.key?('kind') ? hash['kind'] : SKIP address = hash.key?('address') ? hash['address'] : SKIP addressscheme = hash.key?('addressscheme') ? hash['addressscheme'] : SKIP fields = CreateTargetRequestFields.from_hash(hash['fields']) if hash['fields'] description = hash.key?('description') ? hash['description'] : SKIP externalid = hash.key?('externalid') ? hash['externalid'] : SKIP name = hash.key?('name') ? hash['name'] : SKIP region = hash.key?('region') ? hash['region'] : SKIP key1 = hash.key?('key1') ? hash['key1'] : SKIP oauth = TargetAuthentication.from_hash(hash['oauth']) if hash['oauth'] # Create object from extracted values. CreateTargetRequest.new(accountidentifier, billingaccountid, kind, address, addressscheme, fields, description, externalid, name, region, key1, oauth) end |
.names ⇒ Object
A mapping from model property names to API property names.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/verizon/models/create_target_request.rb', line 69 def self.names @_hash = {} if @_hash.nil? @_hash['accountidentifier'] = 'accountidentifier' @_hash['billingaccountid'] = 'billingaccountid' @_hash['kind'] = 'kind' @_hash['address'] = 'address' @_hash['addressscheme'] = 'addressscheme' @_hash['fields'] = 'fields' @_hash['description'] = 'description' @_hash['externalid'] = 'externalid' @_hash['name'] = 'name' @_hash['region'] = 'region' @_hash['key1'] = 'key1' @_hash['oauth'] = 'oauth' @_hash end |
.nullables ⇒ Object
An array for nullable fields
105 106 107 |
# File 'lib/verizon/models/create_target_request.rb', line 105 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/verizon/models/create_target_request.rb', line 87 def self.optionals %w[ accountidentifier billingaccountid kind address addressscheme fields description externalid name region key1 oauth ] end |