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



1556
1557
1558
# File 'lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb', line 1556

def non_null_checking_off
  @non_null_checking_off
end

#type_checking_offObject

Class level accessors to turn on/off specific checking



1555
1556
1557
# File 'lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb', line 1555

def type_checking_off
  @type_checking_off
end

Instance Method Details

#build(params = {}) ⇒ Object

Raises:

  • (TypeError)


1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
# File 'lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb', line 1558

def build(params = {})
  _internal_object = ::Airbnb::Service::Hongbao::Api::HongbaoCampaignDataRequest.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_name = get_field_data(params, :campaign_name, :campaignName, _internal_object.campaignName)
  _internal_object.campaignName = campaign_name
  non_null_validator(:campaign_name, campaign_name) unless ::Airbnb::Service::Hongbao::Api::HongbaoCampaignDataRequest.non_null_checking_off
  _internal_object.validate(Sparsam::STRICT) unless ::Airbnb::Service::Hongbao::Api::HongbaoCampaignDataRequest.type_checking_off
  return _internal_object
end