Class: Verizon::AnomalyDetectionRequest

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

Overview

Anomaly detection request.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(account_name = SKIP, request_type = SKIP, sensitivity_parameter = SKIP) ⇒ AnomalyDetectionRequest

Returns a new instance of AnomalyDetectionRequest.



49
50
51
52
53
54
# File 'lib/verizon/models/anomaly_detection_request.rb', line 49

def initialize( = SKIP, request_type = SKIP,
               sensitivity_parameter = SKIP)
  @account_name =  unless  == SKIP
  @request_type = request_type unless request_type == SKIP
  @sensitivity_parameter = sensitivity_parameter unless sensitivity_parameter == SKIP
end

Instance Attribute Details

#account_nameString

The name of a billing account. An account name is usually numeric, and must include any leading zeros.

Returns:

  • (String)


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

def 
  @account_name
end

#request_typeString

The type of request being made. anomaly is the request to activate anomaly detection.

Returns:

  • (String)


20
21
22
# File 'lib/verizon/models/anomaly_detection_request.rb', line 20

def request_type
  @request_type
end

#sensitivity_parameterSensitivityParameters

Details for sensitivity parameters.



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

def sensitivity_parameter
  @sensitivity_parameter
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/verizon/models/anomaly_detection_request.rb', line 57

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('accountName') ? hash['accountName'] : SKIP
  request_type = hash.key?('requestType') ? hash['requestType'] : SKIP
  sensitivity_parameter = SensitivityParameters.from_hash(hash['sensitivityParameter']) if
    hash['sensitivityParameter']

  # Create object from extracted values.
  AnomalyDetectionRequest.new(,
                              request_type,
                              sensitivity_parameter)
end

.namesObject

A mapping from model property names to API property names.



27
28
29
30
31
32
33
# File 'lib/verizon/models/anomaly_detection_request.rb', line 27

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_name'] = 'accountName'
  @_hash['request_type'] = 'requestType'
  @_hash['sensitivity_parameter'] = 'sensitivityParameter'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



36
37
38
39
40
41
42
# File 'lib/verizon/models/anomaly_detection_request.rb', line 36

def self.optionals
  %w[
    account_name
    request_type
    sensitivity_parameter
  ]
end