Class: OCI::AiVision::Models::AnalyzeVideoStreamResult

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/ai_vision/models/analyze_video_stream_result.rb

Overview

Video stream analysis results.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AnalyzeVideoStreamResult

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



104
105
106
107
108
109
110
111
112
113
114
115
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/oci/ai_vision/models/analyze_video_stream_result.rb', line 104

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.ontology_classes = attributes[:'ontologyClasses'] if attributes[:'ontologyClasses']

  raise 'You cannot provide both :ontologyClasses and :ontology_classes' if attributes.key?(:'ontologyClasses') && attributes.key?(:'ontology_classes')

  self.ontology_classes = attributes[:'ontology_classes'] if attributes[:'ontology_classes']

  self. = attributes[:'videoStreamMetadata'] if attributes[:'videoStreamMetadata']

  raise 'You cannot provide both :videoStreamMetadata and :video_stream_metadata' if attributes.key?(:'videoStreamMetadata') && attributes.key?(:'video_stream_metadata')

  self. = attributes[:'video_stream_metadata'] if attributes[:'video_stream_metadata']

  self.image_data = attributes[:'imageData'] if attributes[:'imageData']

  raise 'You cannot provide both :imageData and :image_data' if attributes.key?(:'imageData') && attributes.key?(:'image_data')

  self.image_data = attributes[:'image_data'] if attributes[:'image_data']

  self.stream_job_id = attributes[:'streamJobId'] if attributes[:'streamJobId']

  raise 'You cannot provide both :streamJobId and :stream_job_id' if attributes.key?(:'streamJobId') && attributes.key?(:'stream_job_id')

  self.stream_job_id = attributes[:'stream_job_id'] if attributes[:'stream_job_id']

  self.stream_source_id = attributes[:'streamSourceId'] if attributes[:'streamSourceId']

  raise 'You cannot provide both :streamSourceId and :stream_source_id' if attributes.key?(:'streamSourceId') && attributes.key?(:'stream_source_id')

  self.stream_source_id = attributes[:'stream_source_id'] if attributes[:'stream_source_id']

  self.timestamp = attributes[:'timestamp'] if attributes[:'timestamp']

  self.video_stream_objects = attributes[:'videoStreamObjects'] if attributes[:'videoStreamObjects']

  raise 'You cannot provide both :videoStreamObjects and :video_stream_objects' if attributes.key?(:'videoStreamObjects') && attributes.key?(:'video_stream_objects')

  self.video_stream_objects = attributes[:'video_stream_objects'] if attributes[:'video_stream_objects']

  self.object_tracking_model_versions = attributes[:'objectTrackingModelVersions'] if attributes[:'objectTrackingModelVersions']

  raise 'You cannot provide both :objectTrackingModelVersions and :object_tracking_model_versions' if attributes.key?(:'objectTrackingModelVersions') && attributes.key?(:'object_tracking_model_versions')

  self.object_tracking_model_versions = attributes[:'object_tracking_model_versions'] if attributes[:'object_tracking_model_versions']

  self.object_detection_model_versions = attributes[:'objectDetectionModelVersions'] if attributes[:'objectDetectionModelVersions']

  raise 'You cannot provide both :objectDetectionModelVersions and :object_detection_model_versions' if attributes.key?(:'objectDetectionModelVersions') && attributes.key?(:'object_detection_model_versions')

  self.object_detection_model_versions = attributes[:'object_detection_model_versions'] if attributes[:'object_detection_model_versions']

  self.errors = attributes[:'errors'] if attributes[:'errors']
end

Instance Attribute Details

#errorsArray<OCI::AiVision::Models::ProcessingError>

Array of possible errors.



50
51
52
# File 'lib/oci/ai_vision/models/analyze_video_stream_result.rb', line 50

def errors
  @errors
end

#image_dataString

Base 64 encoded frame

Returns:

  • (String)


20
21
22
# File 'lib/oci/ai_vision/models/analyze_video_stream_result.rb', line 20

def image_data
  @image_data
end

#object_detection_model_versionsArray<OCI::AiVision::Models::ModelVersionDetails>

List of Object Detection model versions.



46
47
48
# File 'lib/oci/ai_vision/models/analyze_video_stream_result.rb', line 46

def object_detection_model_versions
  @object_detection_model_versions
end

#object_tracking_model_versionsArray<OCI::AiVision::Models::ModelVersionDetails>

List of Object Tracking model versions.



42
43
44
# File 'lib/oci/ai_vision/models/analyze_video_stream_result.rb', line 42

def object_tracking_model_versions
  @object_tracking_model_versions
end

#ontology_classesOCI::AiVision::Models::OntologyClass



12
13
14
# File 'lib/oci/ai_vision/models/analyze_video_stream_result.rb', line 12

def ontology_classes
  @ontology_classes
end

#stream_job_idString

[Required] OCID of streamJob.

Returns:

  • (String)


25
26
27
# File 'lib/oci/ai_vision/models/analyze_video_stream_result.rb', line 25

def stream_job_id
  @stream_job_id
end

#stream_source_idString

[Required] OCID of StreamSource.

Returns:

  • (String)


30
31
32
# File 'lib/oci/ai_vision/models/analyze_video_stream_result.rb', line 30

def stream_source_id
  @stream_source_id
end

#timestampString

[Required] time stamp of frame in utc.

Returns:

  • (String)


34
35
36
# File 'lib/oci/ai_vision/models/analyze_video_stream_result.rb', line 34

def timestamp
  @timestamp
end

#video_stream_metadataOCI::AiVision::Models::VideoStreamMetadata

This attribute is required.



16
17
18
# File 'lib/oci/ai_vision/models/analyze_video_stream_result.rb', line 16

def 
  @video_stream_metadata
end

#video_stream_objectsArray<OCI::AiVision::Models::VideoStreamObject>

Tracked objects in a video stream.



38
39
40
# File 'lib/oci/ai_vision/models/analyze_video_stream_result.rb', line 38

def video_stream_objects
  @video_stream_objects
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/oci/ai_vision/models/analyze_video_stream_result.rb', line 53

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'ontology_classes': :'ontologyClasses',
    'video_stream_metadata': :'videoStreamMetadata',
    'image_data': :'imageData',
    'stream_job_id': :'streamJobId',
    'stream_source_id': :'streamSourceId',
    'timestamp': :'timestamp',
    'video_stream_objects': :'videoStreamObjects',
    'object_tracking_model_versions': :'objectTrackingModelVersions',
    'object_detection_model_versions': :'objectDetectionModelVersions',
    'errors': :'errors'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/oci/ai_vision/models/analyze_video_stream_result.rb', line 71

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'ontology_classes': :'OCI::AiVision::Models::OntologyClass',
    'video_stream_metadata': :'OCI::AiVision::Models::VideoStreamMetadata',
    'image_data': :'String',
    'stream_job_id': :'String',
    'stream_source_id': :'String',
    'timestamp': :'String',
    'video_stream_objects': :'Array<OCI::AiVision::Models::VideoStreamObject>',
    'object_tracking_model_versions': :'Array<OCI::AiVision::Models::ModelVersionDetails>',
    'object_detection_model_versions': :'Array<OCI::AiVision::Models::ModelVersionDetails>',
    'errors': :'Array<OCI::AiVision::Models::ProcessingError>'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/oci/ai_vision/models/analyze_video_stream_result.rb', line 170

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    ontology_classes == other.ontology_classes &&
     == other. &&
    image_data == other.image_data &&
    stream_job_id == other.stream_job_id &&
    stream_source_id == other.stream_source_id &&
    timestamp == other.timestamp &&
    video_stream_objects == other.video_stream_objects &&
    object_tracking_model_versions == other.object_tracking_model_versions &&
    object_detection_model_versions == other.object_detection_model_versions &&
    errors == other.errors
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/oci/ai_vision/models/analyze_video_stream_result.rb', line 209

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


189
190
191
# File 'lib/oci/ai_vision/models/analyze_video_stream_result.rb', line 189

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



198
199
200
# File 'lib/oci/ai_vision/models/analyze_video_stream_result.rb', line 198

def hash
  [ontology_classes, , image_data, stream_job_id, stream_source_id, timestamp, video_stream_objects, object_tracking_model_versions, object_detection_model_versions, errors].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



242
243
244
245
246
247
248
249
250
251
# File 'lib/oci/ai_vision/models/analyze_video_stream_result.rb', line 242

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



236
237
238
# File 'lib/oci/ai_vision/models/analyze_video_stream_result.rb', line 236

def to_s
  to_hash.to_s
end