mx-platform-ruby 0.37.0 → 0.38.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -909,6 +909,69 @@ module MxPlatformRuby
909
909
  return data, status_code, headers
910
910
  end
911
911
 
912
+ # Read a Credit Card Product
913
+ # This endpoint returns the specified `credit_card_product` according to the unique GUID.
914
+ # @param credit_card_product_guid [String] The required `credit_card_product_guid` can be found on the `account` object.
915
+ # @param [Hash] opts the optional parameters
916
+ # @return [CreditCardProductResponse]
917
+ def credit_card(credit_card_product_guid, opts = {})
918
+ data, _status_code, _headers = credit_card_with_http_info(credit_card_product_guid, opts)
919
+ data
920
+ end
921
+
922
+ # Read a Credit Card Product
923
+ # This endpoint returns the specified `credit_card_product` according to the unique GUID.
924
+ # @param credit_card_product_guid [String] The required `credit_card_product_guid` can be found on the `account` object.
925
+ # @param [Hash] opts the optional parameters
926
+ # @return [Array<(CreditCardProductResponse, Integer, Hash)>] CreditCardProductResponse data, response status code and response headers
927
+ def credit_card_with_http_info(credit_card_product_guid, opts = {})
928
+ if @api_client.config.debugging
929
+ @api_client.config.logger.debug 'Calling API: MxPlatformApi.credit_card ...'
930
+ end
931
+ # verify the required parameter 'credit_card_product_guid' is set
932
+ if @api_client.config.client_side_validation && credit_card_product_guid.nil?
933
+ fail ArgumentError, "Missing the required parameter 'credit_card_product_guid' when calling MxPlatformApi.credit_card"
934
+ end
935
+ # resource path
936
+ local_var_path = '/credit_card_products/{credit_card_product_guid}'.sub('{' + 'credit_card_product_guid' + '}', CGI.escape(credit_card_product_guid.to_s))
937
+
938
+ # query parameters
939
+ query_params = opts[:query_params] || {}
940
+
941
+ # header parameters
942
+ header_params = opts[:header_params] || {}
943
+ # HTTP header 'Accept' (if needed)
944
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
945
+
946
+ # form parameters
947
+ form_params = opts[:form_params] || {}
948
+
949
+ # http body (model)
950
+ post_body = opts[:debug_body]
951
+
952
+ # return_type
953
+ return_type = opts[:debug_return_type] || 'CreditCardProductResponse'
954
+
955
+ # auth_names
956
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
957
+
958
+ new_options = opts.merge(
959
+ :operation => :"MxPlatformApi.credit_card",
960
+ :header_params => header_params,
961
+ :query_params => query_params,
962
+ :form_params => form_params,
963
+ :body => post_body,
964
+ :auth_names => auth_names,
965
+ :return_type => return_type
966
+ )
967
+
968
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
969
+ if @api_client.config.debugging
970
+ @api_client.config.logger.debug "API called: MxPlatformApi#credit_card\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
971
+ end
972
+ return data, status_code, headers
973
+ end
974
+
912
975
  # Delete category
913
976
  # Use this endpoint to delete a specific custom category according to its unique GUID. The API will respond with an empty object and a status of `204 No Content`.
914
977
  # @param category_guid [String] The unique id for a &#x60;category&#x60;.
@@ -1946,6 +2009,75 @@ module MxPlatformRuby
1946
2009
  return data, status_code, headers
1947
2010
  end
1948
2011
 
2012
+ # Fetch Rewards
2013
+ # Calling this endpoint initiates an aggregation-type event which will gather the member's rewards information, as well as account and transaction information. Rewards data is also gathered with daily background aggregations.
2014
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
2015
+ # @param member_guid [String] The unique identifier for the member. Defined by MX.
2016
+ # @param [Hash] opts the optional parameters
2017
+ # @return [MemberResponseBody]
2018
+ def fetch_rewards(user_guid, member_guid, opts = {})
2019
+ data, _status_code, _headers = fetch_rewards_with_http_info(user_guid, member_guid, opts)
2020
+ data
2021
+ end
2022
+
2023
+ # Fetch Rewards
2024
+ # Calling this endpoint initiates an aggregation-type event which will gather the member&#39;s rewards information, as well as account and transaction information. Rewards data is also gathered with daily background aggregations.
2025
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
2026
+ # @param member_guid [String] The unique identifier for the member. Defined by MX.
2027
+ # @param [Hash] opts the optional parameters
2028
+ # @return [Array<(MemberResponseBody, Integer, Hash)>] MemberResponseBody data, response status code and response headers
2029
+ def fetch_rewards_with_http_info(user_guid, member_guid, opts = {})
2030
+ if @api_client.config.debugging
2031
+ @api_client.config.logger.debug 'Calling API: MxPlatformApi.fetch_rewards ...'
2032
+ end
2033
+ # verify the required parameter 'user_guid' is set
2034
+ if @api_client.config.client_side_validation && user_guid.nil?
2035
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling MxPlatformApi.fetch_rewards"
2036
+ end
2037
+ # verify the required parameter 'member_guid' is set
2038
+ if @api_client.config.client_side_validation && member_guid.nil?
2039
+ fail ArgumentError, "Missing the required parameter 'member_guid' when calling MxPlatformApi.fetch_rewards"
2040
+ end
2041
+ # resource path
2042
+ local_var_path = '/users/{user_guid}/members/{member_guid}/fetch_rewards'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'member_guid' + '}', CGI.escape(member_guid.to_s))
2043
+
2044
+ # query parameters
2045
+ query_params = opts[:query_params] || {}
2046
+
2047
+ # header parameters
2048
+ header_params = opts[:header_params] || {}
2049
+ # HTTP header 'Accept' (if needed)
2050
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
2051
+
2052
+ # form parameters
2053
+ form_params = opts[:form_params] || {}
2054
+
2055
+ # http body (model)
2056
+ post_body = opts[:debug_body]
2057
+
2058
+ # return_type
2059
+ return_type = opts[:debug_return_type] || 'MemberResponseBody'
2060
+
2061
+ # auth_names
2062
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
2063
+
2064
+ new_options = opts.merge(
2065
+ :operation => :"MxPlatformApi.fetch_rewards",
2066
+ :header_params => header_params,
2067
+ :query_params => query_params,
2068
+ :form_params => form_params,
2069
+ :body => post_body,
2070
+ :auth_names => auth_names,
2071
+ :return_type => return_type
2072
+ )
2073
+
2074
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2075
+ if @api_client.config.debugging
2076
+ @api_client.config.logger.debug "API called: MxPlatformApi#fetch_rewards\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2077
+ end
2078
+ return data, status_code, headers
2079
+ end
2080
+
1949
2081
  # Fetch statements
1950
2082
  # Use this endpoint to fetch the statements associated with a particular member.
1951
2083
  # @param member_guid [String] The unique id for a &#x60;member&#x60;.
@@ -3674,6 +3806,75 @@ module MxPlatformRuby
3674
3806
  return data, status_code, headers
3675
3807
  end
3676
3808
 
3809
+ # List Rewards
3810
+ # Use this endpoint to list all the `rewards` associated with a specified `member`.
3811
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
3812
+ # @param member_guid [String] The unique identifier for the member. Defined by MX.
3813
+ # @param [Hash] opts the optional parameters
3814
+ # @return [RewardsResponseBody]
3815
+ def list_rewards(user_guid, member_guid, opts = {})
3816
+ data, _status_code, _headers = list_rewards_with_http_info(user_guid, member_guid, opts)
3817
+ data
3818
+ end
3819
+
3820
+ # List Rewards
3821
+ # Use this endpoint to list all the &#x60;rewards&#x60; associated with a specified &#x60;member&#x60;.
3822
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
3823
+ # @param member_guid [String] The unique identifier for the member. Defined by MX.
3824
+ # @param [Hash] opts the optional parameters
3825
+ # @return [Array<(RewardsResponseBody, Integer, Hash)>] RewardsResponseBody data, response status code and response headers
3826
+ def list_rewards_with_http_info(user_guid, member_guid, opts = {})
3827
+ if @api_client.config.debugging
3828
+ @api_client.config.logger.debug 'Calling API: MxPlatformApi.list_rewards ...'
3829
+ end
3830
+ # verify the required parameter 'user_guid' is set
3831
+ if @api_client.config.client_side_validation && user_guid.nil?
3832
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling MxPlatformApi.list_rewards"
3833
+ end
3834
+ # verify the required parameter 'member_guid' is set
3835
+ if @api_client.config.client_side_validation && member_guid.nil?
3836
+ fail ArgumentError, "Missing the required parameter 'member_guid' when calling MxPlatformApi.list_rewards"
3837
+ end
3838
+ # resource path
3839
+ local_var_path = '/users/{user_guid}/members/{member_guid}/rewards'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'member_guid' + '}', CGI.escape(member_guid.to_s))
3840
+
3841
+ # query parameters
3842
+ query_params = opts[:query_params] || {}
3843
+
3844
+ # header parameters
3845
+ header_params = opts[:header_params] || {}
3846
+ # HTTP header 'Accept' (if needed)
3847
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
3848
+
3849
+ # form parameters
3850
+ form_params = opts[:form_params] || {}
3851
+
3852
+ # http body (model)
3853
+ post_body = opts[:debug_body]
3854
+
3855
+ # return_type
3856
+ return_type = opts[:debug_return_type] || 'RewardsResponseBody'
3857
+
3858
+ # auth_names
3859
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
3860
+
3861
+ new_options = opts.merge(
3862
+ :operation => :"MxPlatformApi.list_rewards",
3863
+ :header_params => header_params,
3864
+ :query_params => query_params,
3865
+ :form_params => form_params,
3866
+ :body => post_body,
3867
+ :auth_names => auth_names,
3868
+ :return_type => return_type
3869
+ )
3870
+
3871
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
3872
+ if @api_client.config.debugging
3873
+ @api_client.config.logger.debug "API called: MxPlatformApi#list_rewards\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3874
+ end
3875
+ return data, status_code, headers
3876
+ end
3877
+
3677
3878
  # List statements by member
3678
3879
  # Use this endpoint to get an array of available statements.
3679
3880
  # @param member_guid [String] The unique id for a &#x60;member&#x60;.
@@ -5393,6 +5594,81 @@ module MxPlatformRuby
5393
5594
  return data, status_code, headers
5394
5595
  end
5395
5596
 
5597
+ # Read Reward
5598
+ # Use this endpoint to read a specific `reward` based on its unique GUID..
5599
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
5600
+ # @param member_guid [String] The unique identifier for the member. Defined by MX.
5601
+ # @param reward_guid [String] The unique identifier for the rewards. Defined by MX.
5602
+ # @param [Hash] opts the optional parameters
5603
+ # @return [RewardResponseBody]
5604
+ def read_rewards(user_guid, member_guid, reward_guid, opts = {})
5605
+ data, _status_code, _headers = read_rewards_with_http_info(user_guid, member_guid, reward_guid, opts)
5606
+ data
5607
+ end
5608
+
5609
+ # Read Reward
5610
+ # Use this endpoint to read a specific &#x60;reward&#x60; based on its unique GUID..
5611
+ # @param user_guid [String] The unique id for a &#x60;user&#x60;.
5612
+ # @param member_guid [String] The unique identifier for the member. Defined by MX.
5613
+ # @param reward_guid [String] The unique identifier for the rewards. Defined by MX.
5614
+ # @param [Hash] opts the optional parameters
5615
+ # @return [Array<(RewardResponseBody, Integer, Hash)>] RewardResponseBody data, response status code and response headers
5616
+ def read_rewards_with_http_info(user_guid, member_guid, reward_guid, opts = {})
5617
+ if @api_client.config.debugging
5618
+ @api_client.config.logger.debug 'Calling API: MxPlatformApi.read_rewards ...'
5619
+ end
5620
+ # verify the required parameter 'user_guid' is set
5621
+ if @api_client.config.client_side_validation && user_guid.nil?
5622
+ fail ArgumentError, "Missing the required parameter 'user_guid' when calling MxPlatformApi.read_rewards"
5623
+ end
5624
+ # verify the required parameter 'member_guid' is set
5625
+ if @api_client.config.client_side_validation && member_guid.nil?
5626
+ fail ArgumentError, "Missing the required parameter 'member_guid' when calling MxPlatformApi.read_rewards"
5627
+ end
5628
+ # verify the required parameter 'reward_guid' is set
5629
+ if @api_client.config.client_side_validation && reward_guid.nil?
5630
+ fail ArgumentError, "Missing the required parameter 'reward_guid' when calling MxPlatformApi.read_rewards"
5631
+ end
5632
+ # resource path
5633
+ local_var_path = '/users/{user_guid}/members/{member_guid}/rewards/{reward_guid}'.sub('{' + 'user_guid' + '}', CGI.escape(user_guid.to_s)).sub('{' + 'member_guid' + '}', CGI.escape(member_guid.to_s)).sub('{' + 'reward_guid' + '}', CGI.escape(reward_guid.to_s))
5634
+
5635
+ # query parameters
5636
+ query_params = opts[:query_params] || {}
5637
+
5638
+ # header parameters
5639
+ header_params = opts[:header_params] || {}
5640
+ # HTTP header 'Accept' (if needed)
5641
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
5642
+
5643
+ # form parameters
5644
+ form_params = opts[:form_params] || {}
5645
+
5646
+ # http body (model)
5647
+ post_body = opts[:debug_body]
5648
+
5649
+ # return_type
5650
+ return_type = opts[:debug_return_type] || 'RewardResponseBody'
5651
+
5652
+ # auth_names
5653
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
5654
+
5655
+ new_options = opts.merge(
5656
+ :operation => :"MxPlatformApi.read_rewards",
5657
+ :header_params => header_params,
5658
+ :query_params => query_params,
5659
+ :form_params => form_params,
5660
+ :body => post_body,
5661
+ :auth_names => auth_names,
5662
+ :return_type => return_type
5663
+ )
5664
+
5665
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
5666
+ if @api_client.config.debugging
5667
+ @api_client.config.logger.debug "API called: MxPlatformApi#read_rewards\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
5668
+ end
5669
+ return data, status_code, headers
5670
+ end
5671
+
5396
5672
  # Read statement by member
5397
5673
  # Use this endpoint to read a JSON representation of the statement.
5398
5674
  # @param member_guid [String] The unique id for a &#x60;member&#x60;.
@@ -0,0 +1,335 @@
1
+ =begin
2
+ #MX Platform API
3
+
4
+ #The MX Platform API is a powerful, fully-featured API designed to make aggregating and enhancing financial data easy and reliable. It can seamlessly connect your app or website to tens of thousands of financial institutions.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.0.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MxPlatformRuby
17
+ class CreditCardProduct
18
+ attr_accessor :annual_fee
19
+
20
+ attr_accessor :duration_of_introductory_rate_on_balance_transfer
21
+
22
+ attr_accessor :duration_of_introductory_rate_on_purchases
23
+
24
+ attr_accessor :guid
25
+
26
+ attr_accessor :has_cashback_rewards
27
+
28
+ attr_accessor :has_other_rewards
29
+
30
+ attr_accessor :has_travel_rewards
31
+
32
+ attr_accessor :has_zero_introductory_annual_fee
33
+
34
+ attr_accessor :has_zero_percent_introductory_rate
35
+
36
+ attr_accessor :has_zero_percent_introductory_rate_on_balance_transfer
37
+
38
+ attr_accessor :financial_institution
39
+
40
+ attr_accessor :is_accepting_applications
41
+
42
+ attr_accessor :is_small_business_card
43
+
44
+ attr_accessor :name
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'annual_fee' => :'annual_fee',
50
+ :'duration_of_introductory_rate_on_balance_transfer' => :'duration_of_introductory_rate_on_balance_transfer',
51
+ :'duration_of_introductory_rate_on_purchases' => :'duration_of_introductory_rate_on_purchases',
52
+ :'guid' => :'guid',
53
+ :'has_cashback_rewards' => :'has_cashback_rewards',
54
+ :'has_other_rewards' => :'has_other_rewards',
55
+ :'has_travel_rewards' => :'has_travel_rewards',
56
+ :'has_zero_introductory_annual_fee' => :'has_zero_introductory_annual_fee',
57
+ :'has_zero_percent_introductory_rate' => :'has_zero_percent_introductory_rate',
58
+ :'has_zero_percent_introductory_rate_on_balance_transfer' => :'has_zero_percent_introductory_rate_on_balance_transfer',
59
+ :'financial_institution' => :'financial_institution',
60
+ :'is_accepting_applications' => :'is_accepting_applications',
61
+ :'is_small_business_card' => :'is_small_business_card',
62
+ :'name' => :'name'
63
+ }
64
+ end
65
+
66
+ # Returns all the JSON keys this model knows about
67
+ def self.acceptable_attributes
68
+ attribute_map.values
69
+ end
70
+
71
+ # Attribute type mapping.
72
+ def self.openapi_types
73
+ {
74
+ :'annual_fee' => :'Object',
75
+ :'duration_of_introductory_rate_on_balance_transfer' => :'Object',
76
+ :'duration_of_introductory_rate_on_purchases' => :'Object',
77
+ :'guid' => :'Object',
78
+ :'has_cashback_rewards' => :'Boolean',
79
+ :'has_other_rewards' => :'Boolean',
80
+ :'has_travel_rewards' => :'Boolean',
81
+ :'has_zero_introductory_annual_fee' => :'Boolean',
82
+ :'has_zero_percent_introductory_rate' => :'Boolean',
83
+ :'has_zero_percent_introductory_rate_on_balance_transfer' => :'Boolean',
84
+ :'financial_institution' => :'Boolean',
85
+ :'is_accepting_applications' => :'Boolean',
86
+ :'is_small_business_card' => :'Boolean',
87
+ :'name' => :'String'
88
+ }
89
+ end
90
+
91
+ # List of attributes with nullable: true
92
+ def self.openapi_nullable
93
+ Set.new([
94
+ :'annual_fee',
95
+ :'duration_of_introductory_rate_on_balance_transfer',
96
+ :'duration_of_introductory_rate_on_purchases',
97
+ :'guid',
98
+ ])
99
+ end
100
+
101
+ # Initializes the object
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ def initialize(attributes = {})
104
+ if (!attributes.is_a?(Hash))
105
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MxPlatformRuby::CreditCardProduct` initialize method"
106
+ end
107
+
108
+ # check to see if the attribute exists and convert string to symbol for hash key
109
+ attributes = attributes.each_with_object({}) { |(k, v), h|
110
+ if (!self.class.attribute_map.key?(k.to_sym))
111
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MxPlatformRuby::CreditCardProduct`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
112
+ end
113
+ h[k.to_sym] = v
114
+ }
115
+
116
+ if attributes.key?(:'annual_fee')
117
+ self.annual_fee = attributes[:'annual_fee']
118
+ end
119
+
120
+ if attributes.key?(:'duration_of_introductory_rate_on_balance_transfer')
121
+ self.duration_of_introductory_rate_on_balance_transfer = attributes[:'duration_of_introductory_rate_on_balance_transfer']
122
+ end
123
+
124
+ if attributes.key?(:'duration_of_introductory_rate_on_purchases')
125
+ self.duration_of_introductory_rate_on_purchases = attributes[:'duration_of_introductory_rate_on_purchases']
126
+ end
127
+
128
+ if attributes.key?(:'guid')
129
+ self.guid = attributes[:'guid']
130
+ end
131
+
132
+ if attributes.key?(:'has_cashback_rewards')
133
+ self.has_cashback_rewards = attributes[:'has_cashback_rewards']
134
+ end
135
+
136
+ if attributes.key?(:'has_other_rewards')
137
+ self.has_other_rewards = attributes[:'has_other_rewards']
138
+ end
139
+
140
+ if attributes.key?(:'has_travel_rewards')
141
+ self.has_travel_rewards = attributes[:'has_travel_rewards']
142
+ end
143
+
144
+ if attributes.key?(:'has_zero_introductory_annual_fee')
145
+ self.has_zero_introductory_annual_fee = attributes[:'has_zero_introductory_annual_fee']
146
+ end
147
+
148
+ if attributes.key?(:'has_zero_percent_introductory_rate')
149
+ self.has_zero_percent_introductory_rate = attributes[:'has_zero_percent_introductory_rate']
150
+ end
151
+
152
+ if attributes.key?(:'has_zero_percent_introductory_rate_on_balance_transfer')
153
+ self.has_zero_percent_introductory_rate_on_balance_transfer = attributes[:'has_zero_percent_introductory_rate_on_balance_transfer']
154
+ end
155
+
156
+ if attributes.key?(:'financial_institution')
157
+ self.financial_institution = attributes[:'financial_institution']
158
+ end
159
+
160
+ if attributes.key?(:'is_accepting_applications')
161
+ self.is_accepting_applications = attributes[:'is_accepting_applications']
162
+ end
163
+
164
+ if attributes.key?(:'is_small_business_card')
165
+ self.is_small_business_card = attributes[:'is_small_business_card']
166
+ end
167
+
168
+ if attributes.key?(:'name')
169
+ self.name = attributes[:'name']
170
+ end
171
+ end
172
+
173
+ # Show invalid properties with the reasons. Usually used together with valid?
174
+ # @return Array for valid properties with the reasons
175
+ def list_invalid_properties
176
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
177
+ invalid_properties = Array.new
178
+ invalid_properties
179
+ end
180
+
181
+ # Check to see if the all the properties in the model are valid
182
+ # @return true if the model is valid
183
+ def valid?
184
+ warn '[DEPRECATED] the `valid?` method is obsolete'
185
+ true
186
+ end
187
+
188
+ # Checks equality by comparing each attribute.
189
+ # @param [Object] Object to be compared
190
+ def ==(o)
191
+ return true if self.equal?(o)
192
+ self.class == o.class &&
193
+ annual_fee == o.annual_fee &&
194
+ duration_of_introductory_rate_on_balance_transfer == o.duration_of_introductory_rate_on_balance_transfer &&
195
+ duration_of_introductory_rate_on_purchases == o.duration_of_introductory_rate_on_purchases &&
196
+ guid == o.guid &&
197
+ has_cashback_rewards == o.has_cashback_rewards &&
198
+ has_other_rewards == o.has_other_rewards &&
199
+ has_travel_rewards == o.has_travel_rewards &&
200
+ has_zero_introductory_annual_fee == o.has_zero_introductory_annual_fee &&
201
+ has_zero_percent_introductory_rate == o.has_zero_percent_introductory_rate &&
202
+ has_zero_percent_introductory_rate_on_balance_transfer == o.has_zero_percent_introductory_rate_on_balance_transfer &&
203
+ financial_institution == o.financial_institution &&
204
+ is_accepting_applications == o.is_accepting_applications &&
205
+ is_small_business_card == o.is_small_business_card &&
206
+ name == o.name
207
+ end
208
+
209
+ # @see the `==` method
210
+ # @param [Object] Object to be compared
211
+ def eql?(o)
212
+ self == o
213
+ end
214
+
215
+ # Calculates hash code according to all attributes.
216
+ # @return [Integer] Hash code
217
+ def hash
218
+ [annual_fee, duration_of_introductory_rate_on_balance_transfer, duration_of_introductory_rate_on_purchases, guid, has_cashback_rewards, has_other_rewards, has_travel_rewards, has_zero_introductory_annual_fee, has_zero_percent_introductory_rate, has_zero_percent_introductory_rate_on_balance_transfer, financial_institution, is_accepting_applications, is_small_business_card, name].hash
219
+ end
220
+
221
+ # Builds the object from hash
222
+ # @param [Hash] attributes Model attributes in the form of hash
223
+ # @return [Object] Returns the model itself
224
+ def self.build_from_hash(attributes)
225
+ return nil unless attributes.is_a?(Hash)
226
+ attributes = attributes.transform_keys(&:to_sym)
227
+ transformed_hash = {}
228
+ openapi_types.each_pair do |key, type|
229
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
230
+ transformed_hash["#{key}"] = nil
231
+ elsif type =~ /\AArray<(.*)>/i
232
+ # check to ensure the input is an array given that the attribute
233
+ # is documented as an array but the input is not
234
+ if attributes[attribute_map[key]].is_a?(Array)
235
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
236
+ end
237
+ elsif !attributes[attribute_map[key]].nil?
238
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
239
+ end
240
+ end
241
+ new(transformed_hash)
242
+ end
243
+
244
+ # Deserializes the data based on type
245
+ # @param string type Data type
246
+ # @param string value Value to be deserialized
247
+ # @return [Object] Deserialized data
248
+ def self._deserialize(type, value)
249
+ case type.to_sym
250
+ when :Time
251
+ Time.parse(value)
252
+ when :Date
253
+ Date.parse(value)
254
+ when :String
255
+ value.to_s
256
+ when :Integer
257
+ value.to_i
258
+ when :Float
259
+ value.to_f
260
+ when :Boolean
261
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
262
+ true
263
+ else
264
+ false
265
+ end
266
+ when :Object
267
+ # generic object (usually a Hash), return directly
268
+ value
269
+ when /\AArray<(?<inner_type>.+)>\z/
270
+ inner_type = Regexp.last_match[:inner_type]
271
+ value.map { |v| _deserialize(inner_type, v) }
272
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
273
+ k_type = Regexp.last_match[:k_type]
274
+ v_type = Regexp.last_match[:v_type]
275
+ {}.tap do |hash|
276
+ value.each do |k, v|
277
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
278
+ end
279
+ end
280
+ else # model
281
+ # models (e.g. Pet) or oneOf
282
+ klass = MxPlatformRuby.const_get(type)
283
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
284
+ end
285
+ end
286
+
287
+ # Returns the string representation of the object
288
+ # @return [String] String presentation of the object
289
+ def to_s
290
+ to_hash.to_s
291
+ end
292
+
293
+ # to_body is an alias to to_hash (backward compatibility)
294
+ # @return [Hash] Returns the object in the form of hash
295
+ def to_body
296
+ to_hash
297
+ end
298
+
299
+ # Returns the object in the form of hash
300
+ # @return [Hash] Returns the object in the form of hash
301
+ def to_hash
302
+ hash = {}
303
+ self.class.attribute_map.each_pair do |attr, param|
304
+ value = self.send(attr)
305
+ if value.nil?
306
+ is_nullable = self.class.openapi_nullable.include?(attr)
307
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
308
+ end
309
+
310
+ hash[param] = _to_hash(value)
311
+ end
312
+ hash
313
+ end
314
+
315
+ # Outputs non-array value in the form of hash
316
+ # For object, use to_hash. Otherwise, just return the value
317
+ # @param [Object] value Any valid value
318
+ # @return [Hash] Returns the value in the form of hash
319
+ def _to_hash(value)
320
+ if value.is_a?(Array)
321
+ value.compact.map { |v| _to_hash(v) }
322
+ elsif value.is_a?(Hash)
323
+ {}.tap do |hash|
324
+ value.each { |k, v| hash[k] = _to_hash(v) }
325
+ end
326
+ elsif value.respond_to? :to_hash
327
+ value.to_hash
328
+ else
329
+ value
330
+ end
331
+ end
332
+
333
+ end
334
+
335
+ end