Class: WalmartApIs::CreateReportScheduleSpecification
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- WalmartApIs::CreateReportScheduleSpecification
- Defined in:
- lib/walmart_ap_is/models/create_report_schedule_specification.rb
Overview
CreateReportScheduleSpecification Model.
Instance Attribute Summary collapse
-
#marketplace_ids ⇒ Array[MarketplaceId]
TODO: Write general description for this method.
-
#next_report_creation_time ⇒ DateTime
When to first run the schedule (default now).
-
#period ⇒ Period1
TODO: Write general description for this method.
-
#report_options ⇒ Hash[String, String]
TODO: Write general description for this method.
-
#report_type ⇒ String
TODO: Write general description for this method.
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(report_type:, period:, marketplace_ids: SKIP, report_options: SKIP, next_report_creation_time: SKIP, additional_properties: nil) ⇒ CreateReportScheduleSpecification
constructor
A new instance of CreateReportScheduleSpecification.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_next_report_creation_time ⇒ Object
-
#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(report_type:, period:, marketplace_ids: SKIP, report_options: SKIP, next_report_creation_time: SKIP, additional_properties: nil) ⇒ CreateReportScheduleSpecification
Returns a new instance of CreateReportScheduleSpecification.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/walmart_ap_is/models/create_report_schedule_specification.rb', line 58 def initialize(report_type:, period:, marketplace_ids: SKIP, report_options: SKIP, next_report_creation_time: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @report_type = report_type @period = period @marketplace_ids = marketplace_ids unless marketplace_ids == SKIP @report_options = unless == SKIP unless next_report_creation_time == SKIP @next_report_creation_time = next_report_creation_time end @additional_properties = additional_properties end |
Instance Attribute Details
#marketplace_ids ⇒ Array[MarketplaceId]
TODO: Write general description for this method
23 24 25 |
# File 'lib/walmart_ap_is/models/create_report_schedule_specification.rb', line 23 def marketplace_ids @marketplace_ids end |
#next_report_creation_time ⇒ DateTime
When to first run the schedule (default now)
31 32 33 |
# File 'lib/walmart_ap_is/models/create_report_schedule_specification.rb', line 31 def next_report_creation_time @next_report_creation_time end |
#period ⇒ Period1
TODO: Write general description for this method
19 20 21 |
# File 'lib/walmart_ap_is/models/create_report_schedule_specification.rb', line 19 def period @period end |
#report_options ⇒ Hash[String, String]
TODO: Write general description for this method
27 28 29 |
# File 'lib/walmart_ap_is/models/create_report_schedule_specification.rb', line 27 def @report_options end |
#report_type ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/walmart_ap_is/models/create_report_schedule_specification.rb', line 15 def report_type @report_type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/walmart_ap_is/models/create_report_schedule_specification.rb', line 76 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. report_type = hash.key?('reportType') ? hash['reportType'] : nil period = hash.key?('period') ? hash['period'] : nil marketplace_ids = hash.key?('marketplaceIds') ? hash['marketplaceIds'] : SKIP = hash.key?('reportOptions') ? hash['reportOptions'] : SKIP next_report_creation_time = if hash.key?('nextReportCreationTime') (DateTimeHelper.from_rfc3339(hash['nextReportCreationTime']) if hash['nextReportCreationTime']) else SKIP end # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. CreateReportScheduleSpecification.new(report_type: report_type, period: period, marketplace_ids: marketplace_ids, report_options: , next_report_creation_time: next_report_creation_time, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 42 |
# File 'lib/walmart_ap_is/models/create_report_schedule_specification.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['report_type'] = 'reportType' @_hash['period'] = 'period' @_hash['marketplace_ids'] = 'marketplaceIds' @_hash['report_options'] = 'reportOptions' @_hash['next_report_creation_time'] = 'nextReportCreationTime' @_hash end |
.nullables ⇒ Object
An array for nullable fields
54 55 56 |
# File 'lib/walmart_ap_is/models/create_report_schedule_specification.rb', line 54 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
45 46 47 48 49 50 51 |
# File 'lib/walmart_ap_is/models/create_report_schedule_specification.rb', line 45 def self.optionals %w[ marketplace_ids report_options next_report_creation_time ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
120 121 122 123 124 125 126 |
# File 'lib/walmart_ap_is/models/create_report_schedule_specification.rb', line 120 def inspect class_name = self.class.name.split('::').last "<#{class_name} report_type: #{@report_type.inspect}, period: #{@period.inspect},"\ " marketplace_ids: #{@marketplace_ids.inspect}, report_options: #{@report_options.inspect},"\ " next_report_creation_time: #{@next_report_creation_time.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_custom_next_report_creation_time ⇒ Object
107 108 109 |
# File 'lib/walmart_ap_is/models/create_report_schedule_specification.rb', line 107 def to_custom_next_report_creation_time DateTimeHelper.to_rfc3339(next_report_creation_time) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
112 113 114 115 116 117 |
# File 'lib/walmart_ap_is/models/create_report_schedule_specification.rb', line 112 def to_s class_name = self.class.name.split('::').last "<#{class_name} report_type: #{@report_type}, period: #{@period}, marketplace_ids:"\ " #{@marketplace_ids}, report_options: #{@report_options}, next_report_creation_time:"\ " #{@next_report_creation_time}, additional_properties: #{@additional_properties}>" end |