Module: Airbnb::Service::Hongbao::Api::HongbaoReferralStatusResponseSmartclientModule::GenerateClassMethods

Defined in:
lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#non_null_checking_offObject

Returns the value of attribute non_null_checking_off.



2610
2611
2612
# File 'lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb', line 2610

def non_null_checking_off
  @non_null_checking_off
end

#type_checking_offObject

Class level accessors to turn on/off specific checking



2609
2610
2611
# File 'lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb', line 2609

def type_checking_off
  @type_checking_off
end

Instance Method Details

#build(params = {}) ⇒ Object

Raises:

  • (TypeError)


2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
# File 'lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb', line 2612

def build(params = {})
  _internal_object = ::Airbnb::Service::Hongbao::Api::HongbaoReferralStatusResponse.send(:new)
  return _internal_object if params.nil?
  raise TypeError.new("Expect a Hash for params in initialize, while it is #{params.class}") unless params.is_a?(Hash)
  return _internal_object if params.empty?

  link = get_field_data(params, :link, :link, _internal_object.link)
  _internal_object.link = link
  wechat_link = get_field_data(params, :wechat_link, :wechatLink, _internal_object.wechatLink)
  _internal_object.wechatLink = wechat_link
  offer_min_trip = get_field_data(params, :offer_min_trip, :offerMinTrip, _internal_object.offerMinTrip)
  _internal_object.offerMinTrip = offer_min_trip
  offer_receiver_credit = get_field_data(params, :offer_receiver_credit, :offerReceiverCredit, _internal_object.offerReceiverCredit)
  _internal_object.offerReceiverCredit = offer_receiver_credit
  offer_sender_credit = get_field_data(params, :offer_sender_credit, :offerSenderCredit, _internal_object.offerSenderCredit)
  _internal_object.offerSenderCredit = offer_sender_credit
  _internal_object.validate(Sparsam::STRICT) unless ::Airbnb::Service::Hongbao::Api::HongbaoReferralStatusResponse.type_checking_off
  return _internal_object
end