walmart-apimatic-sdk 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +176 -0
  4. data/bin/console +15 -0
  5. data/lib/walmart_ap_is/api_helper.rb +10 -0
  6. data/lib/walmart_ap_is/apis/base_api.rb +67 -0
  7. data/lib/walmart_ap_is/apis/cppreference_api.rb +60 -0
  8. data/lib/walmart_ap_is/apis/detail_api.rb +58 -0
  9. data/lib/walmart_ap_is/apis/feeds_api.rb +79 -0
  10. data/lib/walmart_ap_is/apis/feeds_feed_type_incentive_enrollment_api.rb +66 -0
  11. data/lib/walmart_ap_is/apis/feeds_feed_type_price_and_promotion_api.rb +86 -0
  12. data/lib/walmart_ap_is/apis/feeds_feed_type_walmart_funded_incentives_enrollment_api.rb +75 -0
  13. data/lib/walmart_ap_is/apis/get_pricing_insights_api.rb +60 -0
  14. data/lib/walmart_ap_is/apis/incentives_api.rb +93 -0
  15. data/lib/walmart_ap_is/apis/m_strategy_collection_id_api.rb +118 -0
  16. data/lib/walmart_ap_is/apis/misc_api.rb +23 -0
  17. data/lib/walmart_ap_is/apis/price_api.rb +63 -0
  18. data/lib/walmart_ap_is/apis/repricer_feeds_api.rb +64 -0
  19. data/lib/walmart_ap_is/apis/strategies_api.rb +56 -0
  20. data/lib/walmart_ap_is/apis/strategy_api.rb +63 -0
  21. data/lib/walmart_ap_is/apis/token_api.rb +98 -0
  22. data/lib/walmart_ap_is/apis/wfpreference_api.rb +68 -0
  23. data/lib/walmart_ap_is/client.rb +163 -0
  24. data/lib/walmart_ap_is/configuration.rb +165 -0
  25. data/lib/walmart_ap_is/exceptions/api_exception.rb +21 -0
  26. data/lib/walmart_ap_is/http/api_response.rb +19 -0
  27. data/lib/walmart_ap_is/http/auth/basic_auth.rb +62 -0
  28. data/lib/walmart_ap_is/http/http_call_back.rb +10 -0
  29. data/lib/walmart_ap_is/http/http_method_enum.rb +10 -0
  30. data/lib/walmart_ap_is/http/http_request.rb +10 -0
  31. data/lib/walmart_ap_is/http/http_response.rb +10 -0
  32. data/lib/walmart_ap_is/http/proxy_settings.rb +22 -0
  33. data/lib/walmart_ap_is/logging/configuration/api_logging_configuration.rb +186 -0
  34. data/lib/walmart_ap_is/logging/sdk_logger.rb +17 -0
  35. data/lib/walmart_ap_is/models/assign_unassign_items_to_from_repricer_strategy_request.rb +92 -0
  36. data/lib/walmart_ap_is/models/base_model.rb +110 -0
  37. data/lib/walmart_ap_is/models/client_credentials_res.rb +82 -0
  38. data/lib/walmart_ap_is/models/create_repricer_strategy_request.rb +149 -0
  39. data/lib/walmart_ap_is/models/current_price.rb +82 -0
  40. data/lib/walmart_ap_is/models/filter.rb +90 -0
  41. data/lib/walmart_ap_is/models/get_pricing_insights_request.rb +109 -0
  42. data/lib/walmart_ap_is/models/incentives_enrollment.rb +95 -0
  43. data/lib/walmart_ap_is/models/item.rb +239 -0
  44. data/lib/walmart_ap_is/models/item1.rb +73 -0
  45. data/lib/walmart_ap_is/models/item_feed_header.rb +119 -0
  46. data/lib/walmart_ap_is/models/item_identifiers.rb +72 -0
  47. data/lib/walmart_ap_is/models/item_price_response.rb +90 -0
  48. data/lib/walmart_ap_is/models/json1.rb +73 -0
  49. data/lib/walmart_ap_is/models/mp_item.rb +74 -0
  50. data/lib/walmart_ap_is/models/mp_item_feed_header.rb +91 -0
  51. data/lib/walmart_ap_is/models/page_context.rb +102 -0
  52. data/lib/walmart_ap_is/models/pricing.rb +84 -0
  53. data/lib/walmart_ap_is/models/pricing_insights_response_list.rb +328 -0
  54. data/lib/walmart_ap_is/models/program_action.rb +83 -0
  55. data/lib/walmart_ap_is/models/program_action1.rb +83 -0
  56. data/lib/walmart_ap_is/models/program_action_feed_header.rb +147 -0
  57. data/lib/walmart_ap_is/models/programs.rb +80 -0
  58. data/lib/walmart_ap_is/models/programs1.rb +75 -0
  59. data/lib/walmart_ap_is/models/promo_discount.rb +90 -0
  60. data/lib/walmart_ap_is/models/refresh_token_res.rb +82 -0
  61. data/lib/walmart_ap_is/models/scopes.rb +142 -0
  62. data/lib/walmart_ap_is/models/search_criteria.rb +82 -0
  63. data/lib/walmart_ap_is/models/set_up_cap_sku_all_legacy_request.rb +85 -0
  64. data/lib/walmart_ap_is/models/sort.rb +82 -0
  65. data/lib/walmart_ap_is/models/status_info.rb +85 -0
  66. data/lib/walmart_ap_is/models/strategy.rb +94 -0
  67. data/lib/walmart_ap_is/models/strategy5.rb +106 -0
  68. data/lib/walmart_ap_is/models/strategy_collection.rb +169 -0
  69. data/lib/walmart_ap_is/models/successful_operation.rb +159 -0
  70. data/lib/walmart_ap_is/models/successful_operation1.rb +73 -0
  71. data/lib/walmart_ap_is/models/successful_operation11.rb +82 -0
  72. data/lib/walmart_ap_is/models/successful_operation12.rb +82 -0
  73. data/lib/walmart_ap_is/models/successful_operation2.rb +100 -0
  74. data/lib/walmart_ap_is/models/successful_operation3.rb +92 -0
  75. data/lib/walmart_ap_is/models/successful_operation4.rb +84 -0
  76. data/lib/walmart_ap_is/models/successful_operation5.rb +91 -0
  77. data/lib/walmart_ap_is/models/successful_operation6.rb +93 -0
  78. data/lib/walmart_ap_is/models/successful_operation7.rb +75 -0
  79. data/lib/walmart_ap_is/models/successful_operation8.rb +73 -0
  80. data/lib/walmart_ap_is/models/token_api_authorization_code.rb +122 -0
  81. data/lib/walmart_ap_is/models/token_api_client_credentials.rb +122 -0
  82. data/lib/walmart_ap_is/models/token_api_refresh_token.rb +122 -0
  83. data/lib/walmart_ap_is/models/token_api_res.rb +82 -0
  84. data/lib/walmart_ap_is/models/update_pricing_for_a_single_item_request.rb +91 -0
  85. data/lib/walmart_ap_is/models/update_pricing_for_multiple_items_in_bulk_new_request.rb +92 -0
  86. data/lib/walmart_ap_is/models/update_reduced_referral_fee_incentives_enrollment_request.rb +95 -0
  87. data/lib/walmart_ap_is/models/update_repricer_strategy_request.rb +149 -0
  88. data/lib/walmart_ap_is/models/update_walmart_funded_incentives_enrollment_for_specific_items_request.rb +95 -0
  89. data/lib/walmart_ap_is/models/value.rb +91 -0
  90. data/lib/walmart_ap_is/models/value1.rb +101 -0
  91. data/lib/walmart_ap_is/models/walmart_funded_incentives_enrollment.rb +79 -0
  92. data/lib/walmart_ap_is/models/xml1.rb +73 -0
  93. data/lib/walmart_ap_is/utilities/date_time_helper.rb +11 -0
  94. data/lib/walmart_ap_is/utilities/file_wrapper.rb +28 -0
  95. data/lib/walmart_ap_is.rb +122 -0
  96. metadata +179 -0
@@ -0,0 +1,119 @@
1
+ # walmart_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module WalmartApIs
7
+ # ItemFeedHeader Model.
8
+ class ItemFeedHeader < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :process_mode
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :subset
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [String]
22
+ attr_accessor :mart
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [String]
26
+ attr_accessor :selling_channel
27
+
28
+ # TODO: Write general description for this method
29
+ # @return [String]
30
+ attr_accessor :version
31
+
32
+ # TODO: Write general description for this method
33
+ # @return [String]
34
+ attr_accessor :locale
35
+
36
+ # A mapping from model property names to API property names.
37
+ def self.names
38
+ @_hash = {} if @_hash.nil?
39
+ @_hash['process_mode'] = 'processMode'
40
+ @_hash['subset'] = 'subset'
41
+ @_hash['mart'] = 'mart'
42
+ @_hash['selling_channel'] = 'sellingChannel'
43
+ @_hash['version'] = 'version'
44
+ @_hash['locale'] = 'locale'
45
+ @_hash
46
+ end
47
+
48
+ # An array for optional fields
49
+ def self.optionals
50
+ []
51
+ end
52
+
53
+ # An array for nullable fields
54
+ def self.nullables
55
+ []
56
+ end
57
+
58
+ def initialize(process_mode:, subset:, mart:, selling_channel:, version:,
59
+ locale:, additional_properties: nil)
60
+ # Add additional model properties to the instance
61
+ additional_properties = {} if additional_properties.nil?
62
+
63
+ @process_mode = process_mode
64
+ @subset = subset
65
+ @mart = mart
66
+ @selling_channel = selling_channel
67
+ @version = version
68
+ @locale = locale
69
+ @additional_properties = additional_properties
70
+ end
71
+
72
+ # Creates an instance of the object from a hash.
73
+ def self.from_hash(hash)
74
+ return nil unless hash
75
+
76
+ # Extract variables from the hash.
77
+ process_mode = hash.key?('processMode') ? hash['processMode'] : nil
78
+ subset = hash.key?('subset') ? hash['subset'] : nil
79
+ mart = hash.key?('mart') ? hash['mart'] : nil
80
+ selling_channel =
81
+ hash.key?('sellingChannel') ? hash['sellingChannel'] : nil
82
+ version = hash.key?('version') ? hash['version'] : nil
83
+ locale = hash.key?('locale') ? hash['locale'] : nil
84
+
85
+ # Create a new hash for additional properties, removing known properties.
86
+ new_hash = hash.reject { |k, _| names.value?(k) }
87
+
88
+ additional_properties = APIHelper.get_additional_properties(
89
+ new_hash, proc { |value| value }
90
+ )
91
+
92
+ # Create object from extracted values.
93
+ ItemFeedHeader.new(process_mode: process_mode,
94
+ subset: subset,
95
+ mart: mart,
96
+ selling_channel: selling_channel,
97
+ version: version,
98
+ locale: locale,
99
+ additional_properties: additional_properties)
100
+ end
101
+
102
+ # Provides a human-readable string representation of the object.
103
+ def to_s
104
+ class_name = self.class.name.split('::').last
105
+ "<#{class_name} process_mode: #{@process_mode}, subset: #{@subset}, mart: #{@mart},"\
106
+ " selling_channel: #{@selling_channel}, version: #{@version}, locale: #{@locale},"\
107
+ " additional_properties: #{@additional_properties}>"
108
+ end
109
+
110
+ # Provides a debugging-friendly string with detailed object information.
111
+ def inspect
112
+ class_name = self.class.name.split('::').last
113
+ "<#{class_name} process_mode: #{@process_mode.inspect}, subset: #{@subset.inspect}, mart:"\
114
+ " #{@mart.inspect}, selling_channel: #{@selling_channel.inspect}, version:"\
115
+ " #{@version.inspect}, locale: #{@locale.inspect}, additional_properties:"\
116
+ " #{@additional_properties}>"
117
+ end
118
+ end
119
+ end
@@ -0,0 +1,72 @@
1
+ # walmart_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module WalmartApIs
7
+ # ItemIdentifiers Model.
8
+ class ItemIdentifiers < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :sku
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['sku'] = 'sku'
20
+ @_hash
21
+ end
22
+
23
+ # An array for optional fields
24
+ def self.optionals
25
+ []
26
+ end
27
+
28
+ # An array for nullable fields
29
+ def self.nullables
30
+ []
31
+ end
32
+
33
+ def initialize(sku:, additional_properties: nil)
34
+ # Add additional model properties to the instance
35
+ additional_properties = {} if additional_properties.nil?
36
+
37
+ @sku = sku
38
+ @additional_properties = additional_properties
39
+ end
40
+
41
+ # Creates an instance of the object from a hash.
42
+ def self.from_hash(hash)
43
+ return nil unless hash
44
+
45
+ # Extract variables from the hash.
46
+ sku = hash.key?('sku') ? hash['sku'] : nil
47
+
48
+ # Create a new hash for additional properties, removing known properties.
49
+ new_hash = hash.reject { |k, _| names.value?(k) }
50
+
51
+ additional_properties = APIHelper.get_additional_properties(
52
+ new_hash, proc { |value| value }
53
+ )
54
+
55
+ # Create object from extracted values.
56
+ ItemIdentifiers.new(sku: sku,
57
+ additional_properties: additional_properties)
58
+ end
59
+
60
+ # Provides a human-readable string representation of the object.
61
+ def to_s
62
+ class_name = self.class.name.split('::').last
63
+ "<#{class_name} sku: #{@sku}, additional_properties: #{@additional_properties}>"
64
+ end
65
+
66
+ # Provides a debugging-friendly string with detailed object information.
67
+ def inspect
68
+ class_name = self.class.name.split('::').last
69
+ "<#{class_name} sku: #{@sku.inspect}, additional_properties: #{@additional_properties}>"
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,90 @@
1
+ # walmart_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module WalmartApIs
7
+ # ItemPriceResponse Model.
8
+ class ItemPriceResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :mart
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :message
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [String]
22
+ attr_accessor :sku
23
+
24
+ # A mapping from model property names to API property names.
25
+ def self.names
26
+ @_hash = {} if @_hash.nil?
27
+ @_hash['mart'] = 'mart'
28
+ @_hash['message'] = 'message'
29
+ @_hash['sku'] = 'sku'
30
+ @_hash
31
+ end
32
+
33
+ # An array for optional fields
34
+ def self.optionals
35
+ []
36
+ end
37
+
38
+ # An array for nullable fields
39
+ def self.nullables
40
+ []
41
+ end
42
+
43
+ def initialize(mart:, message:, sku:, additional_properties: nil)
44
+ # Add additional model properties to the instance
45
+ additional_properties = {} if additional_properties.nil?
46
+
47
+ @mart = mart
48
+ @message = message
49
+ @sku = sku
50
+ @additional_properties = additional_properties
51
+ end
52
+
53
+ # Creates an instance of the object from a hash.
54
+ def self.from_hash(hash)
55
+ return nil unless hash
56
+
57
+ # Extract variables from the hash.
58
+ mart = hash.key?('mart') ? hash['mart'] : nil
59
+ message = hash.key?('message') ? hash['message'] : nil
60
+ sku = hash.key?('sku') ? hash['sku'] : nil
61
+
62
+ # Create a new hash for additional properties, removing known properties.
63
+ new_hash = hash.reject { |k, _| names.value?(k) }
64
+
65
+ additional_properties = APIHelper.get_additional_properties(
66
+ new_hash, proc { |value| value }
67
+ )
68
+
69
+ # Create object from extracted values.
70
+ ItemPriceResponse.new(mart: mart,
71
+ message: message,
72
+ sku: sku,
73
+ additional_properties: additional_properties)
74
+ end
75
+
76
+ # Provides a human-readable string representation of the object.
77
+ def to_s
78
+ class_name = self.class.name.split('::').last
79
+ "<#{class_name} mart: #{@mart}, message: #{@message}, sku: #{@sku}, additional_properties:"\
80
+ " #{@additional_properties}>"
81
+ end
82
+
83
+ # Provides a debugging-friendly string with detailed object information.
84
+ def inspect
85
+ class_name = self.class.name.split('::').last
86
+ "<#{class_name} mart: #{@mart.inspect}, message: #{@message.inspect}, sku: #{@sku.inspect},"\
87
+ " additional_properties: #{@additional_properties}>"
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,73 @@
1
+ # walmart_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module WalmartApIs
7
+ # Json1 Model.
8
+ class Json1 < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :feed_id
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['feed_id'] = 'feedId'
20
+ @_hash
21
+ end
22
+
23
+ # An array for optional fields
24
+ def self.optionals
25
+ []
26
+ end
27
+
28
+ # An array for nullable fields
29
+ def self.nullables
30
+ []
31
+ end
32
+
33
+ def initialize(feed_id:, additional_properties: nil)
34
+ # Add additional model properties to the instance
35
+ additional_properties = {} if additional_properties.nil?
36
+
37
+ @feed_id = feed_id
38
+ @additional_properties = additional_properties
39
+ end
40
+
41
+ # Creates an instance of the object from a hash.
42
+ def self.from_hash(hash)
43
+ return nil unless hash
44
+
45
+ # Extract variables from the hash.
46
+ feed_id = hash.key?('feedId') ? hash['feedId'] : nil
47
+
48
+ # Create a new hash for additional properties, removing known properties.
49
+ new_hash = hash.reject { |k, _| names.value?(k) }
50
+
51
+ additional_properties = APIHelper.get_additional_properties(
52
+ new_hash, proc { |value| value }
53
+ )
54
+
55
+ # Create object from extracted values.
56
+ Json1.new(feed_id: feed_id,
57
+ additional_properties: additional_properties)
58
+ end
59
+
60
+ # Provides a human-readable string representation of the object.
61
+ def to_s
62
+ class_name = self.class.name.split('::').last
63
+ "<#{class_name} feed_id: #{@feed_id}, additional_properties: #{@additional_properties}>"
64
+ end
65
+
66
+ # Provides a debugging-friendly string with detailed object information.
67
+ def inspect
68
+ class_name = self.class.name.split('::').last
69
+ "<#{class_name} feed_id: #{@feed_id.inspect}, additional_properties:"\
70
+ " #{@additional_properties}>"
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,74 @@
1
+ # walmart_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module WalmartApIs
7
+ # MpItem Model.
8
+ class MpItem < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [PromoDiscount]
14
+ attr_accessor :promo_discount
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['promo_discount'] = 'Promo&Discount'
20
+ @_hash
21
+ end
22
+
23
+ # An array for optional fields
24
+ def self.optionals
25
+ []
26
+ end
27
+
28
+ # An array for nullable fields
29
+ def self.nullables
30
+ []
31
+ end
32
+
33
+ def initialize(promo_discount:, additional_properties: nil)
34
+ # Add additional model properties to the instance
35
+ additional_properties = {} if additional_properties.nil?
36
+
37
+ @promo_discount = promo_discount
38
+ @additional_properties = additional_properties
39
+ end
40
+
41
+ # Creates an instance of the object from a hash.
42
+ def self.from_hash(hash)
43
+ return nil unless hash
44
+
45
+ # Extract variables from the hash.
46
+ promo_discount = PromoDiscount.from_hash(hash['Promo&Discount']) if hash['Promo&Discount']
47
+
48
+ # Create a new hash for additional properties, removing known properties.
49
+ new_hash = hash.reject { |k, _| names.value?(k) }
50
+
51
+ additional_properties = APIHelper.get_additional_properties(
52
+ new_hash, proc { |value| value }
53
+ )
54
+
55
+ # Create object from extracted values.
56
+ MpItem.new(promo_discount: promo_discount,
57
+ additional_properties: additional_properties)
58
+ end
59
+
60
+ # Provides a human-readable string representation of the object.
61
+ def to_s
62
+ class_name = self.class.name.split('::').last
63
+ "<#{class_name} promo_discount: #{@promo_discount}, additional_properties:"\
64
+ " #{@additional_properties}>"
65
+ end
66
+
67
+ # Provides a debugging-friendly string with detailed object information.
68
+ def inspect
69
+ class_name = self.class.name.split('::').last
70
+ "<#{class_name} promo_discount: #{@promo_discount.inspect}, additional_properties:"\
71
+ " #{@additional_properties}>"
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,91 @@
1
+ # walmart_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module WalmartApIs
7
+ # MpItemFeedHeader Model.
8
+ class MpItemFeedHeader < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :business_unit
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :version
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [String]
22
+ attr_accessor :locale
23
+
24
+ # A mapping from model property names to API property names.
25
+ def self.names
26
+ @_hash = {} if @_hash.nil?
27
+ @_hash['business_unit'] = 'businessUnit'
28
+ @_hash['version'] = 'version'
29
+ @_hash['locale'] = 'locale'
30
+ @_hash
31
+ end
32
+
33
+ # An array for optional fields
34
+ def self.optionals
35
+ []
36
+ end
37
+
38
+ # An array for nullable fields
39
+ def self.nullables
40
+ []
41
+ end
42
+
43
+ def initialize(business_unit:, version:, locale:,
44
+ additional_properties: nil)
45
+ # Add additional model properties to the instance
46
+ additional_properties = {} if additional_properties.nil?
47
+
48
+ @business_unit = business_unit
49
+ @version = version
50
+ @locale = locale
51
+ @additional_properties = additional_properties
52
+ end
53
+
54
+ # Creates an instance of the object from a hash.
55
+ def self.from_hash(hash)
56
+ return nil unless hash
57
+
58
+ # Extract variables from the hash.
59
+ business_unit = hash.key?('businessUnit') ? hash['businessUnit'] : nil
60
+ version = hash.key?('version') ? hash['version'] : nil
61
+ locale = hash.key?('locale') ? hash['locale'] : nil
62
+
63
+ # Create a new hash for additional properties, removing known properties.
64
+ new_hash = hash.reject { |k, _| names.value?(k) }
65
+
66
+ additional_properties = APIHelper.get_additional_properties(
67
+ new_hash, proc { |value| value }
68
+ )
69
+
70
+ # Create object from extracted values.
71
+ MpItemFeedHeader.new(business_unit: business_unit,
72
+ version: version,
73
+ locale: locale,
74
+ additional_properties: additional_properties)
75
+ end
76
+
77
+ # Provides a human-readable string representation of the object.
78
+ def to_s
79
+ class_name = self.class.name.split('::').last
80
+ "<#{class_name} business_unit: #{@business_unit}, version: #{@version}, locale: #{@locale},"\
81
+ " additional_properties: #{@additional_properties}>"
82
+ end
83
+
84
+ # Provides a debugging-friendly string with detailed object information.
85
+ def inspect
86
+ class_name = self.class.name.split('::').last
87
+ "<#{class_name} business_unit: #{@business_unit.inspect}, version: #{@version.inspect},"\
88
+ " locale: #{@locale.inspect}, additional_properties: #{@additional_properties}>"
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,102 @@
1
+ # walmart_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module WalmartApIs
7
+ # PageContext Model.
8
+ class PageContext < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [Integer]
14
+ attr_accessor :page_no
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [Integer]
18
+ attr_accessor :current_page_count
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [Integer]
22
+ attr_accessor :total_count
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [Integer]
26
+ attr_accessor :total_pages
27
+
28
+ # A mapping from model property names to API property names.
29
+ def self.names
30
+ @_hash = {} if @_hash.nil?
31
+ @_hash['page_no'] = 'pageNo'
32
+ @_hash['current_page_count'] = 'currentPageCount'
33
+ @_hash['total_count'] = 'totalCount'
34
+ @_hash['total_pages'] = 'totalPages'
35
+ @_hash
36
+ end
37
+
38
+ # An array for optional fields
39
+ def self.optionals
40
+ []
41
+ end
42
+
43
+ # An array for nullable fields
44
+ def self.nullables
45
+ []
46
+ end
47
+
48
+ def initialize(page_no:, current_page_count:, total_count:, total_pages:,
49
+ additional_properties: nil)
50
+ # Add additional model properties to the instance
51
+ additional_properties = {} if additional_properties.nil?
52
+
53
+ @page_no = page_no
54
+ @current_page_count = current_page_count
55
+ @total_count = total_count
56
+ @total_pages = total_pages
57
+ @additional_properties = additional_properties
58
+ end
59
+
60
+ # Creates an instance of the object from a hash.
61
+ def self.from_hash(hash)
62
+ return nil unless hash
63
+
64
+ # Extract variables from the hash.
65
+ page_no = hash.key?('pageNo') ? hash['pageNo'] : nil
66
+ current_page_count =
67
+ hash.key?('currentPageCount') ? hash['currentPageCount'] : nil
68
+ total_count = hash.key?('totalCount') ? hash['totalCount'] : nil
69
+ total_pages = hash.key?('totalPages') ? hash['totalPages'] : nil
70
+
71
+ # Create a new hash for additional properties, removing known properties.
72
+ new_hash = hash.reject { |k, _| names.value?(k) }
73
+
74
+ additional_properties = APIHelper.get_additional_properties(
75
+ new_hash, proc { |value| value }
76
+ )
77
+
78
+ # Create object from extracted values.
79
+ PageContext.new(page_no: page_no,
80
+ current_page_count: current_page_count,
81
+ total_count: total_count,
82
+ total_pages: total_pages,
83
+ additional_properties: additional_properties)
84
+ end
85
+
86
+ # Provides a human-readable string representation of the object.
87
+ def to_s
88
+ class_name = self.class.name.split('::').last
89
+ "<#{class_name} page_no: #{@page_no}, current_page_count: #{@current_page_count},"\
90
+ " total_count: #{@total_count}, total_pages: #{@total_pages}, additional_properties:"\
91
+ " #{@additional_properties}>"
92
+ end
93
+
94
+ # Provides a debugging-friendly string with detailed object information.
95
+ def inspect
96
+ class_name = self.class.name.split('::').last
97
+ "<#{class_name} page_no: #{@page_no.inspect}, current_page_count:"\
98
+ " #{@current_page_count.inspect}, total_count: #{@total_count.inspect}, total_pages:"\
99
+ " #{@total_pages.inspect}, additional_properties: #{@additional_properties}>"
100
+ end
101
+ end
102
+ end