Class: Verizon::GeoFenceConfigurationRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::GeoFenceConfigurationRequest
- Defined in:
- lib/verizon/models/geo_fence_configuration_request.rb
Overview
Request for /api/v1/application/configurations/geofence POST endpoint. It requires the vendorId, geofence, messageStandard, messages and isActive fields to be populated.
Instance Attribute Summary collapse
-
#description ⇒ String
Description of the configuration.
-
#geo_fence ⇒ EtxGeoFence
The GeoJSON representation of geofence.
-
#is_active ⇒ TrueClass | FalseClass
List of predefined messages that belongs to the geofence.
-
#message_standard ⇒ MessageStandardEnum
Select which V2X messaging standard will be used for the message generation.
-
#messages ⇒ Array[Object]
List of predefined messages that belongs to the geofence.
-
#name ⇒ String
Name of the configuration.
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(geo_fence = nil, messages = nil, is_active = nil, name = SKIP, description = SKIP, message_standard = MessageStandardEnum::SAE) ⇒ GeoFenceConfigurationRequest
constructor
A new instance of GeoFenceConfigurationRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(geo_fence = nil, messages = nil, is_active = nil, name = SKIP, description = SKIP, message_standard = MessageStandardEnum::SAE) ⇒ GeoFenceConfigurationRequest
Returns a new instance of GeoFenceConfigurationRequest.
80 81 82 83 84 85 86 87 88 89 |
# File 'lib/verizon/models/geo_fence_configuration_request.rb', line 80 def initialize(geo_fence = nil, = nil, is_active = nil, name = SKIP, description = SKIP, = MessageStandardEnum::SAE) @name = name unless name == SKIP @description = description unless description == SKIP @geo_fence = geo_fence @message_standard = unless == SKIP @messages = @is_active = is_active end |
Instance Attribute Details
#description ⇒ String
Description of the configuration.
20 21 22 |
# File 'lib/verizon/models/geo_fence_configuration_request.rb', line 20 def description @description end |
#geo_fence ⇒ EtxGeoFence
The GeoJSON representation of geofence. Geofence supports the following geometry types: LineString, Polygon, MultiLineString, and MultiPolygon. The system only supports a single Feature in the FeatureCollection, so only one Line, Polygon, MultiLine or MultiPolygon can be defined within one Geofencing configuration.
28 29 30 |
# File 'lib/verizon/models/geo_fence_configuration_request.rb', line 28 def geo_fence @geo_fence end |
#is_active ⇒ TrueClass | FalseClass
List of predefined messages that belongs to the geofence. These are the messages that are sent out by the system when the Trigger Condition for the message is met.
52 53 54 |
# File 'lib/verizon/models/geo_fence_configuration_request.rb', line 52 def is_active @is_active end |
#message_standard ⇒ MessageStandardEnum
Select which V2X messaging standard will be used for the message generation. The following options are supported:
- "etsi": The message will be generated using the ETSI (European)
standard (e.g. DENM).
- "sae": The message will be generated using the SAE J2735 (North
American) standard (e.g. RSA, TIM).
- if not sent while POST, defaults to "sae"
- mandatory to send "etsi" standard here, if ETSI messages are being
sent in config
40 41 42 |
# File 'lib/verizon/models/geo_fence_configuration_request.rb', line 40 def @message_standard end |
#messages ⇒ Array[Object]
List of predefined messages that belongs to the geofence. These are the messages that are sent out by the system when the Trigger Condition for the message is met.
46 47 48 |
# File 'lib/verizon/models/geo_fence_configuration_request.rb', line 46 def @messages end |
#name ⇒ String
Name of the configuration.
16 17 18 |
# File 'lib/verizon/models/geo_fence_configuration_request.rb', line 16 def name @name end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/verizon/models/geo_fence_configuration_request.rb', line 92 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. geo_fence = EtxGeoFence.from_hash(hash['geoFence']) if hash['geoFence'] = hash.key?('messages') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:Message4), hash['messages'] ) : nil is_active = hash.key?('isActive') ? hash['isActive'] : nil name = hash.key?('name') ? hash['name'] : SKIP description = hash.key?('description') ? hash['description'] : SKIP = hash['messageStandard'] ||= MessageStandardEnum::SAE # Create object from extracted values. GeoFenceConfigurationRequest.new(geo_fence, , is_active, name, description, ) end |
.names ⇒ Object
A mapping from model property names to API property names.
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/verizon/models/geo_fence_configuration_request.rb', line 55 def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'name' @_hash['description'] = 'description' @_hash['geo_fence'] = 'geoFence' @_hash['message_standard'] = 'messageStandard' @_hash['messages'] = 'messages' @_hash['is_active'] = 'isActive' @_hash end |
.nullables ⇒ Object
An array for nullable fields
76 77 78 |
# File 'lib/verizon/models/geo_fence_configuration_request.rb', line 76 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
67 68 69 70 71 72 73 |
# File 'lib/verizon/models/geo_fence_configuration_request.rb', line 67 def self.optionals %w[ name description message_standard ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/verizon/models/geo_fence_configuration_request.rb', line 116 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.geo_fence, ->(val) { EtxGeoFence.validate(val) }, is_model_hash: true) and UnionTypeLookUp.get(:Message4) .validate(value.) and APIHelper.valid_type?(value.is_active, ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass }) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['geoFence'], ->(val) { EtxGeoFence.validate(val) }, is_model_hash: true) and UnionTypeLookUp.get(:Message4) .validate(value['messages']) and APIHelper.valid_type?(value['isActive'], ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass }) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
150 151 152 153 154 155 |
# File 'lib/verizon/models/geo_fence_configuration_request.rb', line 150 def inspect class_name = self.class.name.split('::').last "<#{class_name} name: #{@name.inspect}, description: #{@description.inspect}, geo_fence:"\ " #{@geo_fence.inspect}, message_standard: #{@message_standard.inspect}, messages:"\ " #{@messages.inspect}, is_active: #{@is_active.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
143 144 145 146 147 |
# File 'lib/verizon/models/geo_fence_configuration_request.rb', line 143 def to_s class_name = self.class.name.split('::').last "<#{class_name} name: #{@name}, description: #{@description}, geo_fence: #{@geo_fence},"\ " message_standard: #{@message_standard}, messages: #{@messages}, is_active: #{@is_active}>" end |