Class: Copyleaks::CopyleaksAiImageDetectionScannedDocumentModel

Inherits:
Object
  • Object
show all
Defined in:
lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionScannedDocumentModel.rb

Overview

Metadata about the AI image detection scan operation.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scan_id: nil, actual_credits: nil, expected_credits: nil, creation_time: nil) ⇒ CopyleaksAiImageDetectionScannedDocumentModel

Initialize a new CopyleaksAiImageDetectionScannedDocumentModel

Parameters:

  • scan_id (String) (defaults to: nil)

    The unique identifier for this scan

  • actual_credits (Integer) (defaults to: nil)

    The actual number of credits consumed by this scan

  • expected_credits (Integer) (defaults to: nil)

    The expected number of credits for this scan

  • creation_time (String) (defaults to: nil)

    ISO 8601 timestamp of when the scan was created



48
49
50
51
52
53
# File 'lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionScannedDocumentModel.rb', line 48

def initialize(scan_id: nil, actual_credits: nil, expected_credits: nil, creation_time: nil)
  @scan_id = scan_id
  @actual_credits = actual_credits
  @expected_credits = expected_credits
  @creation_time = creation_time
end

Instance Attribute Details

#actual_creditsObject

The actual number of credits consumed by this scan.



34
35
36
# File 'lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionScannedDocumentModel.rb', line 34

def actual_credits
  @actual_credits
end

#creation_timeObject

ISO 8601 timestamp of when the scan was created.



40
41
42
# File 'lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionScannedDocumentModel.rb', line 40

def creation_time
  @creation_time
end

#expected_creditsObject

The expected number of credits for this scan.



37
38
39
# File 'lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionScannedDocumentModel.rb', line 37

def expected_credits
  @expected_credits
end

#scan_idObject

The unique identifier for this scan.



31
32
33
# File 'lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionScannedDocumentModel.rb', line 31

def scan_id
  @scan_id
end

Class Method Details

.from_json(json_hash) ⇒ Object

Create instance from JSON hash



56
57
58
59
60
61
62
63
64
65
# File 'lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionScannedDocumentModel.rb', line 56

def self.from_json(json_hash)
  return nil if json_hash.nil?

  new(
    scan_id: json_hash['scanId'],
    actual_credits: json_hash['actualCredits'],
    expected_credits: json_hash['expectedCredits'],
    creation_time: json_hash['creationTime']
  )
end

Instance Method Details

#to_json(*args) ⇒ Object

Convert to JSON



68
69
70
71
72
73
74
75
# File 'lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionScannedDocumentModel.rb', line 68

def to_json(*args)
  {
    'scanId' => @scan_id,
    'actualCredits' => @actual_credits,
    'expectedCredits' => @expected_credits,
    'creationTime' => @creation_time
  }.to_json(*args)
end