Module: Airbnb::Service::Hongbao::Api::HongbaoCampaignDataResponseSmartclientModule::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.



1639
1640
1641
# File 'lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb', line 1639

def non_null_checking_off
  @non_null_checking_off
end

#type_checking_offObject

Class level accessors to turn on/off specific checking



1638
1639
1640
# File 'lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb', line 1638

def type_checking_off
  @type_checking_off
end

Instance Method Details

#build(params = {}) ⇒ Object

Raises:

  • (TypeError)


1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
# File 'lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb', line 1641

def build(params = {})
  _internal_object = ::Airbnb::Service::Hongbao::Api::HongbaoCampaignDataResponse.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?

  campaign_data = get_field_data(params, :campaign_data, :campaignData, _internal_object.campaignData)
  _internal_object.campaignData = (campaign_data.respond_to?(:struct_fields) || campaign_data.nil?) ? campaign_data : ::Airbnb::Service::Hongbao::Api::CampaignData.build(campaign_data)
  _internal_object.validate(Sparsam::STRICT) unless ::Airbnb::Service::Hongbao::Api::HongbaoCampaignDataResponse.type_checking_off
  return _internal_object
end