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,122 @@
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
+ # TokenApiRefreshToken Model.
8
+ class TokenApiRefreshToken < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [ClientCredentialsRes]
14
+ attr_accessor :client_credentials_res
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [TokenApiRes]
18
+ attr_accessor :token_api_res
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [RefreshTokenRes]
22
+ attr_accessor :refresh_token_res
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [String]
26
+ attr_accessor :access_token
27
+
28
+ # TODO: Write general description for this method
29
+ # @return [String]
30
+ attr_accessor :token_type
31
+
32
+ # TODO: Write general description for this method
33
+ # @return [Integer]
34
+ attr_accessor :expires_in
35
+
36
+ # A mapping from model property names to API property names.
37
+ def self.names
38
+ @_hash = {} if @_hash.nil?
39
+ @_hash['client_credentials_res'] = 'clientCredentialsRes'
40
+ @_hash['token_api_res'] = 'tokenAPIRes'
41
+ @_hash['refresh_token_res'] = 'refreshTokenRes'
42
+ @_hash['access_token'] = 'access_token'
43
+ @_hash['token_type'] = 'token_type'
44
+ @_hash['expires_in'] = 'expires_in'
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(client_credentials_res:, token_api_res:, refresh_token_res:,
59
+ access_token:, token_type:, expires_in:,
60
+ additional_properties: nil)
61
+ # Add additional model properties to the instance
62
+ additional_properties = {} if additional_properties.nil?
63
+
64
+ @client_credentials_res = client_credentials_res
65
+ @token_api_res = token_api_res
66
+ @refresh_token_res = refresh_token_res
67
+ @access_token = access_token
68
+ @token_type = token_type
69
+ @expires_in = expires_in
70
+ @additional_properties = additional_properties
71
+ end
72
+
73
+ # Creates an instance of the object from a hash.
74
+ def self.from_hash(hash)
75
+ return nil unless hash
76
+
77
+ # Extract variables from the hash.
78
+ client_credentials_res = ClientCredentialsRes.from_hash(hash['clientCredentialsRes']) if
79
+ hash['clientCredentialsRes']
80
+ token_api_res = TokenApiRes.from_hash(hash['tokenAPIRes']) if hash['tokenAPIRes']
81
+ refresh_token_res = RefreshTokenRes.from_hash(hash['refreshTokenRes']) if
82
+ hash['refreshTokenRes']
83
+ access_token = hash.key?('access_token') ? hash['access_token'] : nil
84
+ token_type = hash.key?('token_type') ? hash['token_type'] : nil
85
+ expires_in = hash.key?('expires_in') ? hash['expires_in'] : nil
86
+
87
+ # Create a new hash for additional properties, removing known properties.
88
+ new_hash = hash.reject { |k, _| names.value?(k) }
89
+
90
+ additional_properties = APIHelper.get_additional_properties(
91
+ new_hash, proc { |value| value }
92
+ )
93
+
94
+ # Create object from extracted values.
95
+ TokenApiRefreshToken.new(client_credentials_res: client_credentials_res,
96
+ token_api_res: token_api_res,
97
+ refresh_token_res: refresh_token_res,
98
+ access_token: access_token,
99
+ token_type: token_type,
100
+ expires_in: expires_in,
101
+ additional_properties: additional_properties)
102
+ end
103
+
104
+ # Provides a human-readable string representation of the object.
105
+ def to_s
106
+ class_name = self.class.name.split('::').last
107
+ "<#{class_name} client_credentials_res: #{@client_credentials_res}, token_api_res:"\
108
+ " #{@token_api_res}, refresh_token_res: #{@refresh_token_res}, access_token:"\
109
+ " #{@access_token}, token_type: #{@token_type}, expires_in: #{@expires_in},"\
110
+ " additional_properties: #{@additional_properties}>"
111
+ end
112
+
113
+ # Provides a debugging-friendly string with detailed object information.
114
+ def inspect
115
+ class_name = self.class.name.split('::').last
116
+ "<#{class_name} client_credentials_res: #{@client_credentials_res.inspect}, token_api_res:"\
117
+ " #{@token_api_res.inspect}, refresh_token_res: #{@refresh_token_res.inspect}, access_token:"\
118
+ " #{@access_token.inspect}, token_type: #{@token_type.inspect}, expires_in:"\
119
+ " #{@expires_in.inspect}, additional_properties: #{@additional_properties}>"
120
+ end
121
+ end
122
+ end
@@ -0,0 +1,82 @@
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
+ # TokenApiRes Model.
8
+ class TokenApiRes < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :summary
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [Value1]
18
+ attr_accessor :value
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['summary'] = 'summary'
24
+ @_hash['value'] = 'value'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ []
31
+ end
32
+
33
+ # An array for nullable fields
34
+ def self.nullables
35
+ []
36
+ end
37
+
38
+ def initialize(summary:, value:, additional_properties: nil)
39
+ # Add additional model properties to the instance
40
+ additional_properties = {} if additional_properties.nil?
41
+
42
+ @summary = summary
43
+ @value = value
44
+ @additional_properties = additional_properties
45
+ end
46
+
47
+ # Creates an instance of the object from a hash.
48
+ def self.from_hash(hash)
49
+ return nil unless hash
50
+
51
+ # Extract variables from the hash.
52
+ summary = hash.key?('summary') ? hash['summary'] : nil
53
+ value = Value1.from_hash(hash['value']) if hash['value']
54
+
55
+ # Create a new hash for additional properties, removing known properties.
56
+ new_hash = hash.reject { |k, _| names.value?(k) }
57
+
58
+ additional_properties = APIHelper.get_additional_properties(
59
+ new_hash, proc { |value| value }
60
+ )
61
+
62
+ # Create object from extracted values.
63
+ TokenApiRes.new(summary: summary,
64
+ value: value,
65
+ additional_properties: additional_properties)
66
+ end
67
+
68
+ # Provides a human-readable string representation of the object.
69
+ def to_s
70
+ class_name = self.class.name.split('::').last
71
+ "<#{class_name} summary: #{@summary}, value: #{@value}, additional_properties:"\
72
+ " #{@additional_properties}>"
73
+ end
74
+
75
+ # Provides a debugging-friendly string with detailed object information.
76
+ def inspect
77
+ class_name = self.class.name.split('::').last
78
+ "<#{class_name} summary: #{@summary.inspect}, value: #{@value.inspect},"\
79
+ " additional_properties: #{@additional_properties}>"
80
+ end
81
+ end
82
+ 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
+ # UpdatePricingForASingleItemRequest Model.
8
+ class UpdatePricingForASingleItemRequest < 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
+ # TODO: Write general description for this method
17
+ # @return [Array[Pricing]]
18
+ attr_accessor :pricing
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['sku'] = 'sku'
24
+ @_hash['pricing'] = 'pricing'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ []
31
+ end
32
+
33
+ # An array for nullable fields
34
+ def self.nullables
35
+ []
36
+ end
37
+
38
+ def initialize(sku:, pricing:, additional_properties: nil)
39
+ # Add additional model properties to the instance
40
+ additional_properties = {} if additional_properties.nil?
41
+
42
+ @sku = sku
43
+ @pricing = pricing
44
+ @additional_properties = additional_properties
45
+ end
46
+
47
+ # Creates an instance of the object from a hash.
48
+ def self.from_hash(hash)
49
+ return nil unless hash
50
+
51
+ # Extract variables from the hash.
52
+ sku = hash.key?('sku') ? hash['sku'] : nil
53
+ # Parameter is an array, so we need to iterate through it
54
+ pricing = nil
55
+ unless hash['pricing'].nil?
56
+ pricing = []
57
+ hash['pricing'].each do |structure|
58
+ pricing << (Pricing.from_hash(structure) if structure)
59
+ end
60
+ end
61
+
62
+ pricing = nil unless hash.key?('pricing')
63
+
64
+ # Create a new hash for additional properties, removing known properties.
65
+ new_hash = hash.reject { |k, _| names.value?(k) }
66
+
67
+ additional_properties = APIHelper.get_additional_properties(
68
+ new_hash, proc { |value| value }
69
+ )
70
+
71
+ # Create object from extracted values.
72
+ UpdatePricingForASingleItemRequest.new(sku: sku,
73
+ pricing: pricing,
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} sku: #{@sku}, pricing: #{@pricing}, additional_properties:"\
81
+ " #{@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} sku: #{@sku.inspect}, pricing: #{@pricing.inspect}, additional_properties:"\
88
+ " #{@additional_properties}>"
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,92 @@
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
+ # UpdatePricingForMultipleItemsInBulkNewRequest Model.
8
+ class UpdatePricingForMultipleItemsInBulkNewRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [MpItemFeedHeader]
14
+ attr_accessor :mp_item_feed_header
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [Array[MpItem]]
18
+ attr_accessor :mp_item
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['mp_item_feed_header'] = 'MPItemFeedHeader'
24
+ @_hash['mp_item'] = 'MPItem'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ []
31
+ end
32
+
33
+ # An array for nullable fields
34
+ def self.nullables
35
+ []
36
+ end
37
+
38
+ def initialize(mp_item_feed_header:, mp_item:, additional_properties: nil)
39
+ # Add additional model properties to the instance
40
+ additional_properties = {} if additional_properties.nil?
41
+
42
+ @mp_item_feed_header = mp_item_feed_header
43
+ @mp_item = mp_item
44
+ @additional_properties = additional_properties
45
+ end
46
+
47
+ # Creates an instance of the object from a hash.
48
+ def self.from_hash(hash)
49
+ return nil unless hash
50
+
51
+ # Extract variables from the hash.
52
+ mp_item_feed_header = MpItemFeedHeader.from_hash(hash['MPItemFeedHeader']) if
53
+ hash['MPItemFeedHeader']
54
+ # Parameter is an array, so we need to iterate through it
55
+ mp_item = nil
56
+ unless hash['MPItem'].nil?
57
+ mp_item = []
58
+ hash['MPItem'].each do |structure|
59
+ mp_item << (MpItem.from_hash(structure) if structure)
60
+ end
61
+ end
62
+
63
+ mp_item = nil unless hash.key?('MPItem')
64
+
65
+ # Create a new hash for additional properties, removing known properties.
66
+ new_hash = hash.reject { |k, _| names.value?(k) }
67
+
68
+ additional_properties = APIHelper.get_additional_properties(
69
+ new_hash, proc { |value| value }
70
+ )
71
+
72
+ # Create object from extracted values.
73
+ UpdatePricingForMultipleItemsInBulkNewRequest.new(mp_item_feed_header: mp_item_feed_header,
74
+ mp_item: mp_item,
75
+ additional_properties: additional_properties)
76
+ end
77
+
78
+ # Provides a human-readable string representation of the object.
79
+ def to_s
80
+ class_name = self.class.name.split('::').last
81
+ "<#{class_name} mp_item_feed_header: #{@mp_item_feed_header}, mp_item: #{@mp_item},"\
82
+ " additional_properties: #{@additional_properties}>"
83
+ end
84
+
85
+ # Provides a debugging-friendly string with detailed object information.
86
+ def inspect
87
+ class_name = self.class.name.split('::').last
88
+ "<#{class_name} mp_item_feed_header: #{@mp_item_feed_header.inspect}, mp_item:"\
89
+ " #{@mp_item.inspect}, additional_properties: #{@additional_properties}>"
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,95 @@
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
+ # UpdateReducedReferralFeeIncentivesEnrollmentRequest Model.
8
+ class UpdateReducedReferralFeeIncentivesEnrollmentRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [ProgramActionFeedHeader]
14
+ attr_accessor :program_action_feed_header
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [Array[ProgramAction1]]
18
+ attr_accessor :program_action
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['program_action_feed_header'] = 'ProgramActionFeedHeader'
24
+ @_hash['program_action'] = 'ProgramAction'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ []
31
+ end
32
+
33
+ # An array for nullable fields
34
+ def self.nullables
35
+ []
36
+ end
37
+
38
+ def initialize(program_action_feed_header:, program_action:,
39
+ additional_properties: nil)
40
+ # Add additional model properties to the instance
41
+ additional_properties = {} if additional_properties.nil?
42
+
43
+ @program_action_feed_header = program_action_feed_header
44
+ @program_action = program_action
45
+ @additional_properties = additional_properties
46
+ end
47
+
48
+ # Creates an instance of the object from a hash.
49
+ def self.from_hash(hash)
50
+ return nil unless hash
51
+
52
+ # Extract variables from the hash.
53
+ if hash['ProgramActionFeedHeader']
54
+ program_action_feed_header = ProgramActionFeedHeader.from_hash(hash['ProgramActionFeedHeader'])
55
+ end
56
+ # Parameter is an array, so we need to iterate through it
57
+ program_action = nil
58
+ unless hash['ProgramAction'].nil?
59
+ program_action = []
60
+ hash['ProgramAction'].each do |structure|
61
+ program_action << (ProgramAction1.from_hash(structure) if structure)
62
+ end
63
+ end
64
+
65
+ program_action = nil unless hash.key?('ProgramAction')
66
+
67
+ # Create a new hash for additional properties, removing known properties.
68
+ new_hash = hash.reject { |k, _| names.value?(k) }
69
+
70
+ additional_properties = APIHelper.get_additional_properties(
71
+ new_hash, proc { |value| value }
72
+ )
73
+
74
+ # Create object from extracted values.
75
+ UpdateReducedReferralFeeIncentivesEnrollmentRequest.new(program_action_feed_header: program_action_feed_header,
76
+ program_action: program_action,
77
+ additional_properties: additional_properties)
78
+ end
79
+
80
+ # Provides a human-readable string representation of the object.
81
+ def to_s
82
+ class_name = self.class.name.split('::').last
83
+ "<#{class_name} program_action_feed_header: #{@program_action_feed_header}, program_action:"\
84
+ " #{@program_action}, additional_properties: #{@additional_properties}>"
85
+ end
86
+
87
+ # Provides a debugging-friendly string with detailed object information.
88
+ def inspect
89
+ class_name = self.class.name.split('::').last
90
+ "<#{class_name} program_action_feed_header: #{@program_action_feed_header.inspect},"\
91
+ " program_action: #{@program_action.inspect}, additional_properties:"\
92
+ " #{@additional_properties}>"
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,149 @@
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
+ # UpdateRepricerStrategyRequest Model.
8
+ class UpdateRepricerStrategyRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :repricer_strategy
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [TrueClass | FalseClass]
18
+ attr_accessor :enabled
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [TrueClass | FalseClass]
22
+ attr_accessor :enable_repricer_for_promotion
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [TrueClass | FalseClass]
26
+ attr_accessor :restore_seller_price_without_target
27
+
28
+ # TODO: Write general description for this method
29
+ # @return [TrueClass | FalseClass]
30
+ attr_accessor :enable_buybox_meet_external
31
+
32
+ # TODO: Write general description for this method
33
+ # @return [TrueClass | FalseClass]
34
+ attr_accessor :compare_with3p_offer_only
35
+
36
+ # TODO: Write general description for this method
37
+ # @return [Array[Strategy]]
38
+ attr_accessor :strategies
39
+
40
+ # A mapping from model property names to API property names.
41
+ def self.names
42
+ @_hash = {} if @_hash.nil?
43
+ @_hash['repricer_strategy'] = 'repricerStrategy'
44
+ @_hash['enabled'] = 'enabled'
45
+ @_hash['enable_repricer_for_promotion'] = 'enableRepricerForPromotion'
46
+ @_hash['restore_seller_price_without_target'] =
47
+ 'restoreSellerPriceWithoutTarget'
48
+ @_hash['enable_buybox_meet_external'] = 'enableBuyboxMeetExternal'
49
+ @_hash['compare_with3p_offer_only'] = 'compareWith3pOfferOnly'
50
+ @_hash['strategies'] = 'strategies'
51
+ @_hash
52
+ end
53
+
54
+ # An array for optional fields
55
+ def self.optionals
56
+ []
57
+ end
58
+
59
+ # An array for nullable fields
60
+ def self.nullables
61
+ []
62
+ end
63
+
64
+ def initialize(repricer_strategy:, enabled:, enable_repricer_for_promotion:,
65
+ restore_seller_price_without_target:,
66
+ enable_buybox_meet_external:, compare_with3p_offer_only:,
67
+ strategies:, additional_properties: nil)
68
+ # Add additional model properties to the instance
69
+ additional_properties = {} if additional_properties.nil?
70
+
71
+ @repricer_strategy = repricer_strategy
72
+ @enabled = enabled
73
+ @enable_repricer_for_promotion = enable_repricer_for_promotion
74
+ @restore_seller_price_without_target = restore_seller_price_without_target
75
+ @enable_buybox_meet_external = enable_buybox_meet_external
76
+ @compare_with3p_offer_only = compare_with3p_offer_only
77
+ @strategies = strategies
78
+ @additional_properties = additional_properties
79
+ end
80
+
81
+ # Creates an instance of the object from a hash.
82
+ def self.from_hash(hash)
83
+ return nil unless hash
84
+
85
+ # Extract variables from the hash.
86
+ repricer_strategy =
87
+ hash.key?('repricerStrategy') ? hash['repricerStrategy'] : nil
88
+ enabled = hash.key?('enabled') ? hash['enabled'] : nil
89
+ enable_repricer_for_promotion =
90
+ hash.key?('enableRepricerForPromotion') ? hash['enableRepricerForPromotion'] : nil
91
+ restore_seller_price_without_target =
92
+ hash.key?('restoreSellerPriceWithoutTarget') ? hash['restoreSellerPriceWithoutTarget'] : nil
93
+ enable_buybox_meet_external =
94
+ hash.key?('enableBuyboxMeetExternal') ? hash['enableBuyboxMeetExternal'] : nil
95
+ compare_with3p_offer_only =
96
+ hash.key?('compareWith3pOfferOnly') ? hash['compareWith3pOfferOnly'] : nil
97
+ # Parameter is an array, so we need to iterate through it
98
+ strategies = nil
99
+ unless hash['strategies'].nil?
100
+ strategies = []
101
+ hash['strategies'].each do |structure|
102
+ strategies << (Strategy.from_hash(structure) if structure)
103
+ end
104
+ end
105
+
106
+ strategies = nil unless hash.key?('strategies')
107
+
108
+ # Create a new hash for additional properties, removing known properties.
109
+ new_hash = hash.reject { |k, _| names.value?(k) }
110
+
111
+ additional_properties = APIHelper.get_additional_properties(
112
+ new_hash, proc { |value| value }
113
+ )
114
+
115
+ # Create object from extracted values.
116
+ UpdateRepricerStrategyRequest.new(repricer_strategy: repricer_strategy,
117
+ enabled: enabled,
118
+ enable_repricer_for_promotion: enable_repricer_for_promotion,
119
+ restore_seller_price_without_target: restore_seller_price_without_target,
120
+ enable_buybox_meet_external: enable_buybox_meet_external,
121
+ compare_with3p_offer_only: compare_with3p_offer_only,
122
+ strategies: strategies,
123
+ additional_properties: additional_properties)
124
+ end
125
+
126
+ # Provides a human-readable string representation of the object.
127
+ def to_s
128
+ class_name = self.class.name.split('::').last
129
+ "<#{class_name} repricer_strategy: #{@repricer_strategy}, enabled: #{@enabled},"\
130
+ " enable_repricer_for_promotion: #{@enable_repricer_for_promotion},"\
131
+ " restore_seller_price_without_target: #{@restore_seller_price_without_target},"\
132
+ " enable_buybox_meet_external: #{@enable_buybox_meet_external}, compare_with3p_offer_only:"\
133
+ " #{@compare_with3p_offer_only}, strategies: #{@strategies}, additional_properties:"\
134
+ " #{@additional_properties}>"
135
+ end
136
+
137
+ # Provides a debugging-friendly string with detailed object information.
138
+ def inspect
139
+ class_name = self.class.name.split('::').last
140
+ "<#{class_name} repricer_strategy: #{@repricer_strategy.inspect}, enabled:"\
141
+ " #{@enabled.inspect}, enable_repricer_for_promotion:"\
142
+ " #{@enable_repricer_for_promotion.inspect}, restore_seller_price_without_target:"\
143
+ " #{@restore_seller_price_without_target.inspect}, enable_buybox_meet_external:"\
144
+ " #{@enable_buybox_meet_external.inspect}, compare_with3p_offer_only:"\
145
+ " #{@compare_with3p_offer_only.inspect}, strategies: #{@strategies.inspect},"\
146
+ " additional_properties: #{@additional_properties}>"
147
+ end
148
+ end
149
+ end