module Airbnb::Service::Hongbao::Api::CampaignDataSmartclientModule::GenerateInstanceMethods
Constants
- JSON_NAME_OVERRIDES
Public Instance Methods
campaign_is_active()
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 1210 def campaign_is_active; @campaignIsActive; end
campaign_name()
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 1211 def campaign_name; @campaignName; end
campaign_terms_and_conditions_url()
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 1212 def campaign_terms_and_conditions_url; @campaignTermsAndConditionsUrl; end
coupon_amount()
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 1213 def coupon_amount; @couponAmount; end
coupon_code_prefix()
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 1217 def coupon_code_prefix; @couponCodePrefix; end
coupon_expires_after()
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 1218 def coupon_expires_after; @couponExpiresAfter; end
coupon_max_savings()
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 1214 def coupon_max_savings; @couponMaxSavings; end
coupon_max_start_date()
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 1219 def coupon_max_start_date; @couponMaxStartDate; end
coupon_min_cost()
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 1215 def coupon_min_cost; @couponMinCost; end
coupon_native_currency()
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 1220 def coupon_native_currency; @couponNativeCurrency; end
coupon_percent()
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 1216 def coupon_percent; @couponPercent; end
coupon_series_label()
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 1221 def coupon_series_label; @couponSeriesLabel; end
coupon_small_screen_claim_redis_key()
click to toggle source
# File lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb, line 1222 def coupon_small_screen_claim_redis_key; @couponSmallScreenClaimRedisKey; 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 1231 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 && campaign_is_active.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:campaignIsActive) ? JSON_NAME_OVERRIDES[:campaignIsActive] : :campaignIsActive res[_json_key_name] = campaign_is_active end if !(ignore_nil_field && campaign_name.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:campaignName) ? JSON_NAME_OVERRIDES[:campaignName] : :campaignName res[_json_key_name] = campaign_name end if !(ignore_nil_field && campaign_terms_and_conditions_url.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:campaignTermsAndConditionsUrl) ? JSON_NAME_OVERRIDES[:campaignTermsAndConditionsUrl] : :campaignTermsAndConditionsUrl res[_json_key_name] = campaign_terms_and_conditions_url end if !(ignore_nil_field && coupon_amount.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:couponAmount) ? JSON_NAME_OVERRIDES[:couponAmount] : :couponAmount res[_json_key_name] = coupon_amount end if !(ignore_nil_field && coupon_max_savings.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:couponMaxSavings) ? JSON_NAME_OVERRIDES[:couponMaxSavings] : :couponMaxSavings res[_json_key_name] = coupon_max_savings end if !(ignore_nil_field && coupon_min_cost.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:couponMinCost) ? JSON_NAME_OVERRIDES[:couponMinCost] : :couponMinCost res[_json_key_name] = coupon_min_cost end if !(ignore_nil_field && coupon_percent.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:couponPercent) ? JSON_NAME_OVERRIDES[:couponPercent] : :couponPercent res[_json_key_name] = coupon_percent end if !(ignore_nil_field && coupon_code_prefix.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:couponCodePrefix) ? JSON_NAME_OVERRIDES[:couponCodePrefix] : :couponCodePrefix res[_json_key_name] = coupon_code_prefix end if !(ignore_nil_field && coupon_expires_after.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:couponExpiresAfter) ? JSON_NAME_OVERRIDES[:couponExpiresAfter] : :couponExpiresAfter res[_json_key_name] = coupon_expires_after end if !(ignore_nil_field && coupon_max_start_date.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:couponMaxStartDate) ? JSON_NAME_OVERRIDES[:couponMaxStartDate] : :couponMaxStartDate res[_json_key_name] = coupon_max_start_date end if !(ignore_nil_field && coupon_native_currency.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:couponNativeCurrency) ? JSON_NAME_OVERRIDES[:couponNativeCurrency] : :couponNativeCurrency res[_json_key_name] = coupon_native_currency end if !(ignore_nil_field && coupon_series_label.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:couponSeriesLabel) ? JSON_NAME_OVERRIDES[:couponSeriesLabel] : :couponSeriesLabel res[_json_key_name] = coupon_series_label end if !(ignore_nil_field && coupon_small_screen_claim_redis_key.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:couponSmallScreenClaimRedisKey) ? JSON_NAME_OVERRIDES[:couponSmallScreenClaimRedisKey] : :couponSmallScreenClaimRedisKey res[_json_key_name] = coupon_small_screen_claim_redis_key end else # enforcing to use snake case if !(ignore_nil_field && campaign_is_active.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:campaignIsActive) ? JSON_NAME_OVERRIDES[:campaignIsActive] : :campaign_is_active res[_json_key_name] = campaign_is_active end if !(ignore_nil_field && campaign_name.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:campaignName) ? JSON_NAME_OVERRIDES[:campaignName] : :campaign_name res[_json_key_name] = campaign_name end if !(ignore_nil_field && campaign_terms_and_conditions_url.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:campaignTermsAndConditionsUrl) ? JSON_NAME_OVERRIDES[:campaignTermsAndConditionsUrl] : :campaign_terms_and_conditions_url res[_json_key_name] = campaign_terms_and_conditions_url end if !(ignore_nil_field && coupon_amount.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:couponAmount) ? JSON_NAME_OVERRIDES[:couponAmount] : :coupon_amount res[_json_key_name] = coupon_amount end if !(ignore_nil_field && coupon_max_savings.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:couponMaxSavings) ? JSON_NAME_OVERRIDES[:couponMaxSavings] : :coupon_max_savings res[_json_key_name] = coupon_max_savings end if !(ignore_nil_field && coupon_min_cost.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:couponMinCost) ? JSON_NAME_OVERRIDES[:couponMinCost] : :coupon_min_cost res[_json_key_name] = coupon_min_cost end if !(ignore_nil_field && coupon_percent.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:couponPercent) ? JSON_NAME_OVERRIDES[:couponPercent] : :coupon_percent res[_json_key_name] = coupon_percent end if !(ignore_nil_field && coupon_code_prefix.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:couponCodePrefix) ? JSON_NAME_OVERRIDES[:couponCodePrefix] : :coupon_code_prefix res[_json_key_name] = coupon_code_prefix end if !(ignore_nil_field && coupon_expires_after.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:couponExpiresAfter) ? JSON_NAME_OVERRIDES[:couponExpiresAfter] : :coupon_expires_after res[_json_key_name] = coupon_expires_after end if !(ignore_nil_field && coupon_max_start_date.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:couponMaxStartDate) ? JSON_NAME_OVERRIDES[:couponMaxStartDate] : :coupon_max_start_date res[_json_key_name] = coupon_max_start_date end if !(ignore_nil_field && coupon_native_currency.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:couponNativeCurrency) ? JSON_NAME_OVERRIDES[:couponNativeCurrency] : :coupon_native_currency res[_json_key_name] = coupon_native_currency end if !(ignore_nil_field && coupon_series_label.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:couponSeriesLabel) ? JSON_NAME_OVERRIDES[:couponSeriesLabel] : :coupon_series_label res[_json_key_name] = coupon_series_label end if !(ignore_nil_field && coupon_small_screen_claim_redis_key.nil?) _json_key_name = JSON_NAME_OVERRIDES.key?(:couponSmallScreenClaimRedisKey) ? JSON_NAME_OVERRIDES[:couponSmallScreenClaimRedisKey] : :coupon_small_screen_claim_redis_key res[_json_key_name] = coupon_small_screen_claim_redis_key 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 1224 def to_json(options = nil) JSON.generate(to_hash(options)) end