module Airbnb::Service::Hongbao::Api::HongbaoCouponDataResponseSmartclientModule::GenerateInstanceMethods
Constants
- JSON_NAME_OVERRIDES
Public Instance Methods
code()
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 985 def code; @code; end
currency()
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 986 def currency; @currency; end
expires_after()
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 987 def expires_after; @expiresAfter; end
formatted_localized_amount()
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 988 def formatted_localized_amount; @formattedLocalizedAmount; end
formatted_localized_min_trip_cost()
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 989 def formatted_localized_min_trip_cost; @formattedLocalizedMinTripCost; end
id()
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 995 def id; @id; end
is_active()
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 994 def is_active; @isActive; end
max_savings_usd()
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 990 def max_savings_usd; @maxSavingsUsd; end
min_trip_cost()
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 991 def min_trip_cost; @minTripCost; end
savings_amount()
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 992 def savings_amount; @savingsAmount; end
savings_percent()
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 993 def savings_percent; @savingsPercent; end
to_hash(options = nil)
click to toggle source
options:
case_from_idl: use the exact case from IDL file to when generating the hash key. Default is false. ignore_nil_field: do not generate key in the hash, if the value is nil. Useful for inspect or data transport. Default is false.
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 1004 def to_hash(options = nil) res = {} options ||= {} case_from_idl = options.nil? ? false : options[:case_from_idl] ignore_nil_field = options.nil? ? false : options[:ignore_nil_field] if case_from_idl if !(ignore_nil_field && code.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:code) ? JSON_NAME_OVERRIDES[:code] : :code res[_json_key_name] = code end if !(ignore_nil_field && currency.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:currency) ? JSON_NAME_OVERRIDES[:currency] : :currency res[_json_key_name] = currency end if !(ignore_nil_field && expires_after.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:expiresAfter) ? JSON_NAME_OVERRIDES[:expiresAfter] : :expiresAfter res[_json_key_name] = expires_after end if !(ignore_nil_field && formatted_localized_amount.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:formattedLocalizedAmount) ? JSON_NAME_OVERRIDES[:formattedLocalizedAmount] : :formattedLocalizedAmount res[_json_key_name] = formatted_localized_amount end if !(ignore_nil_field && formatted_localized_min_trip_cost.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:formattedLocalizedMinTripCost) ? JSON_NAME_OVERRIDES[:formattedLocalizedMinTripCost] : :formattedLocalizedMinTripCost res[_json_key_name] = formatted_localized_min_trip_cost end if !(ignore_nil_field && max_savings_usd.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:maxSavingsUsd) ? JSON_NAME_OVERRIDES[:maxSavingsUsd] : :maxSavingsUsd res[_json_key_name] = max_savings_usd end if !(ignore_nil_field && min_trip_cost.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:minTripCost) ? JSON_NAME_OVERRIDES[:minTripCost] : :minTripCost res[_json_key_name] = min_trip_cost end if !(ignore_nil_field && savings_amount.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:savingsAmount) ? JSON_NAME_OVERRIDES[:savingsAmount] : :savingsAmount res[_json_key_name] = savings_amount end if !(ignore_nil_field && savings_percent.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:savingsPercent) ? JSON_NAME_OVERRIDES[:savingsPercent] : :savingsPercent res[_json_key_name] = savings_percent end if !(ignore_nil_field && is_active.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:isActive) ? JSON_NAME_OVERRIDES[:isActive] : :isActive res[_json_key_name] = is_active end if !(ignore_nil_field && id.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:id) ? JSON_NAME_OVERRIDES[:id] : :id res[_json_key_name] = id end else # enforcing to use snake case if !(ignore_nil_field && code.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:code) ? JSON_NAME_OVERRIDES[:code] : :code res[_json_key_name] = code end if !(ignore_nil_field && currency.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:currency) ? JSON_NAME_OVERRIDES[:currency] : :currency res[_json_key_name] = currency end if !(ignore_nil_field && expires_after.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:expiresAfter) ? JSON_NAME_OVERRIDES[:expiresAfter] : :expires_after res[_json_key_name] = expires_after end if !(ignore_nil_field && formatted_localized_amount.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:formattedLocalizedAmount) ? JSON_NAME_OVERRIDES[:formattedLocalizedAmount] : :formatted_localized_amount res[_json_key_name] = formatted_localized_amount end if !(ignore_nil_field && formatted_localized_min_trip_cost.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:formattedLocalizedMinTripCost) ? JSON_NAME_OVERRIDES[:formattedLocalizedMinTripCost] : :formatted_localized_min_trip_cost res[_json_key_name] = formatted_localized_min_trip_cost end if !(ignore_nil_field && max_savings_usd.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:maxSavingsUsd) ? JSON_NAME_OVERRIDES[:maxSavingsUsd] : :max_savings_usd res[_json_key_name] = max_savings_usd end if !(ignore_nil_field && min_trip_cost.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:minTripCost) ? JSON_NAME_OVERRIDES[:minTripCost] : :min_trip_cost res[_json_key_name] = min_trip_cost end if !(ignore_nil_field && savings_amount.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:savingsAmount) ? JSON_NAME_OVERRIDES[:savingsAmount] : :savings_amount res[_json_key_name] = savings_amount end if !(ignore_nil_field && savings_percent.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:savingsPercent) ? JSON_NAME_OVERRIDES[:savingsPercent] : :savings_percent res[_json_key_name] = savings_percent end if !(ignore_nil_field && is_active.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:isActive) ? JSON_NAME_OVERRIDES[:isActive] : :is_active res[_json_key_name] = is_active end if !(ignore_nil_field && id.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:id) ? JSON_NAME_OVERRIDES[:id] : :id res[_json_key_name] = id end end res end
Also aliased as: to_h
to_json(options = nil)
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 997 def to_json(options = nil) JSON.generate(to_hash(options)) end