Class: NewStoreApi::JobDownloadResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/new_store_api/models/job_download_response.rb

Overview

Response model for job download URLs.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(expiration_minutes = nil, generated_at = nil, job_id = nil, signed_urls = nil, tenant = nil) ⇒ JobDownloadResponse

Returns a new instance of JobDownloadResponse.



53
54
55
56
57
58
59
60
# File 'lib/new_store_api/models/job_download_response.rb', line 53

def initialize(expiration_minutes = nil, generated_at = nil, job_id = nil,
               signed_urls = nil, tenant = nil)
  @expiration_minutes = expiration_minutes
  @generated_at = generated_at
  @job_id = job_id
  @signed_urls = signed_urls
  @tenant = tenant
end

Instance Attribute Details

#expiration_minutesInteger

URL expiration time in minutes

Returns:

  • (Integer)


14
15
16
# File 'lib/new_store_api/models/job_download_response.rb', line 14

def expiration_minutes
  @expiration_minutes
end

#generated_atString

Timestamp when URLs were generated (ISO 8601 format)

Returns:

  • (String)


18
19
20
# File 'lib/new_store_api/models/job_download_response.rb', line 18

def generated_at
  @generated_at
end

#job_idString

Unique job identifier

Returns:

  • (String)


22
23
24
# File 'lib/new_store_api/models/job_download_response.rb', line 22

def job_id
  @job_id
end

#signed_urlsArray[String]

List of signed URLs for downloading results

Returns:

  • (Array[String])


26
27
28
# File 'lib/new_store_api/models/job_download_response.rb', line 26

def signed_urls
  @signed_urls
end

#tenantString

Tenant identifier

Returns:

  • (String)


30
31
32
# File 'lib/new_store_api/models/job_download_response.rb', line 30

def tenant
  @tenant
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/new_store_api/models/job_download_response.rb', line 63

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  expiration_minutes =
    hash.key?('expiration_minutes') ? hash['expiration_minutes'] : nil
  generated_at = hash.key?('generated_at') ? hash['generated_at'] : nil
  job_id = hash.key?('job_id') ? hash['job_id'] : nil
  signed_urls = hash.key?('signed_urls') ? hash['signed_urls'] : nil
  tenant = hash.key?('tenant') ? hash['tenant'] : nil

  # Create object from extracted values.
  JobDownloadResponse.new(expiration_minutes,
                          generated_at,
                          job_id,
                          signed_urls,
                          tenant)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
41
# File 'lib/new_store_api/models/job_download_response.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['expiration_minutes'] = 'expiration_minutes'
  @_hash['generated_at'] = 'generated_at'
  @_hash['job_id'] = 'job_id'
  @_hash['signed_urls'] = 'signed_urls'
  @_hash['tenant'] = 'tenant'
  @_hash
end

.nullablesObject

An array for nullable fields



49
50
51
# File 'lib/new_store_api/models/job_download_response.rb', line 49

def self.nullables
  []
end

.optionalsObject

An array for optional fields



44
45
46
# File 'lib/new_store_api/models/job_download_response.rb', line 44

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



90
91
92
93
94
95
# File 'lib/new_store_api/models/job_download_response.rb', line 90

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} expiration_minutes: #{@expiration_minutes.inspect}, generated_at:"\
  " #{@generated_at.inspect}, job_id: #{@job_id.inspect}, signed_urls:"\
  " #{@signed_urls.inspect}, tenant: #{@tenant.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



83
84
85
86
87
# File 'lib/new_store_api/models/job_download_response.rb', line 83

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} expiration_minutes: #{@expiration_minutes}, generated_at: #{@generated_at},"\
  " job_id: #{@job_id}, signed_urls: #{@signed_urls}, tenant: #{@tenant}>"
end