Class: Verizon::CreateTargetRequest

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

Overview

Details of the target 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, 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

#accountidentifierAccountIdentifier

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

Returns:



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

def accountidentifier
  @accountidentifier
end

#addressString

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.

Returns:

  • (String)


29
30
31
# File 'lib/verizon/models/create_target_request.rb', line 29

def address
  @address
end

#addressschemeString

The transport format. Valid values are: <br />streamawsiot - streamed data to an AWS account <br />streamrest - streamed REST data to a defined endpoint.

Returns:

  • (String)


35
36
37
# File 'lib/verizon/models/create_target_request.rb', line 35

def addressscheme
  @addressscheme
end

#billingaccountidString

The ID of the authenticating billing account.

Returns:

  • (String)


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

def billingaccountid
  @billingaccountid
end

#descriptionString

Descriptive information about the target.

Returns:

  • (String)


45
46
47
# File 'lib/verizon/models/create_target_request.rb', line 45

def description
  @description
end

#externalidString

Security identification string created by a POST /targets/actions/newextid request.

Returns:

  • (String)


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

def externalid
  @externalid
end

#fieldsCreateTargetRequestFields

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

#key1String

OAuth 2.0 bearer token.

Returns:

  • (String)


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

def key1
  @key1
end

#kindString

Identifies the resource kind. Targets are ts.target.

Returns:

  • (String)


23
24
25
# File 'lib/verizon/models/create_target_request.rb', line 23

def kind
  @kind
end

#nameString

Name of the target.

Returns:

  • (String)


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

def name
  @name
end

#oauthTargetAuthentication

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

#regionString

AWS region value.

Returns:

  • (String)


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

.namesObject

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

.nullablesObject

An array for nullable fields



105
106
107
# File 'lib/verizon/models/create_target_request.rb', line 105

def self.nullables
  []
end

.optionalsObject

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