Class: NewStoreApi::CreateDataRequest
- Defined in:
- lib/new_store_api/models/create_data_request.rb
Overview
Create data request.
Instance Attribute Summary collapse
-
#content ⇒ Binary
The file content to store.
-
#content_type ⇒ String
The media type of the content data.
-
#ttl ⇒ Integer
Time to live in days, will be kept indefinitely if not set.
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.
Instance Method Summary collapse
-
#initialize(content = nil, content_type = nil, ttl = SKIP) ⇒ CreateDataRequest
constructor
A new instance of CreateDataRequest.
-
#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(content = nil, content_type = nil, ttl = SKIP) ⇒ CreateDataRequest
Returns a new instance of CreateDataRequest.
45 46 47 48 49 |
# File 'lib/new_store_api/models/create_data_request.rb', line 45 def initialize(content = nil, content_type = nil, ttl = SKIP) @content = content @content_type = content_type @ttl = ttl unless ttl == SKIP end |
Instance Attribute Details
#content ⇒ Binary
The file content to store.
14 15 16 |
# File 'lib/new_store_api/models/create_data_request.rb', line 14 def content @content end |
#content_type ⇒ String
The media type of the content data.
18 19 20 |
# File 'lib/new_store_api/models/create_data_request.rb', line 18 def content_type @content_type end |
#ttl ⇒ Integer
Time to live in days, will be kept indefinitely if not set.
22 23 24 |
# File 'lib/new_store_api/models/create_data_request.rb', line 22 def ttl @ttl end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/new_store_api/models/create_data_request.rb', line 52 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. content = hash.key?('content') ? hash['content'] : nil content_type = hash.key?('content_type') ? hash['content_type'] : nil ttl = hash.key?('ttl') ? hash['ttl'] : SKIP # Create object from extracted values. CreateDataRequest.new(content, content_type, ttl) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 31 |
# File 'lib/new_store_api/models/create_data_request.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['content'] = 'content' @_hash['content_type'] = 'content_type' @_hash['ttl'] = 'ttl' @_hash end |
.nullables ⇒ Object
An array for nullable fields
41 42 43 |
# File 'lib/new_store_api/models/create_data_request.rb', line 41 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 37 38 |
# File 'lib/new_store_api/models/create_data_request.rb', line 34 def self.optionals %w[ ttl ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
73 74 75 76 77 |
# File 'lib/new_store_api/models/create_data_request.rb', line 73 def inspect class_name = self.class.name.split('::').last "<#{class_name} content: #{@content.inspect}, content_type: #{@content_type.inspect}, ttl:"\ " #{@ttl.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
67 68 69 70 |
# File 'lib/new_store_api/models/create_data_request.rb', line 67 def to_s class_name = self.class.name.split('::').last "<#{class_name} content: #{@content}, content_type: #{@content_type}, ttl: #{@ttl}>" end |