Class: FdxV660Api::K1QualifiedBusinessIncomeQbiPartnerSpecificItems

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/fdx_v660_api/models/k1_qualified_business_income_qbi_partner_specific_items.rb

Overview

Form 1065 and 1120-S Schedule K-1 Statement A items for Qualified Business Income (QBI) or Publicly Traded Partnership (PTP) or Statement C items allocable to qualified payments for Qualified Business Income (QBI) subject to partner-specific determinations

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(business_description: SKIP, publicly_traded_partnership: SKIP, aggregated: SKIP, specified_service_business: SKIP, ordinary_income: SKIP, rental_income: SKIP, royalty_income: SKIP, section1231_gain: SKIP, other_income: SKIP, section179_deduction: SKIP, other_deductions: SKIP, additional_properties: nil) ⇒ K1QualifiedBusinessIncomeQbiPartnerSpecificItems

Returns a new instance of K1QualifiedBusinessIncomeQbiPartnerSpecificItems.



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/fdx_v660_api/models/k1_qualified_business_income_qbi_partner_specific_items.rb', line 98

def initialize(business_description: SKIP,
               publicly_traded_partnership: SKIP, aggregated: SKIP,
               specified_service_business: SKIP, ordinary_income: SKIP,
               rental_income: SKIP, royalty_income: SKIP,
               section1231_gain: SKIP, other_income: SKIP,
               section179_deduction: SKIP, other_deductions: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @business_description = business_description unless business_description == SKIP
  unless publicly_traded_partnership == SKIP
    @publicly_traded_partnership =
      publicly_traded_partnership
  end
  @aggregated = aggregated unless aggregated == SKIP
  unless specified_service_business == SKIP
    @specified_service_business =
      specified_service_business
  end
  @ordinary_income = ordinary_income unless ordinary_income == SKIP
  @rental_income = rental_income unless rental_income == SKIP
  @royalty_income = royalty_income unless royalty_income == SKIP
  @section1231_gain = section1231_gain unless section1231_gain == SKIP
  @other_income = other_income unless other_income == SKIP
  @section179_deduction = section179_deduction unless section179_deduction == SKIP
  @other_deductions = other_deductions unless other_deductions == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#aggregatedTrueClass | FalseClass

Aggregated checkbox

Returns:

  • (TrueClass | FalseClass)


25
26
27
# File 'lib/fdx_v660_api/models/k1_qualified_business_income_qbi_partner_specific_items.rb', line 25

def aggregated
  @aggregated
end

#business_descriptionString

Business description

Returns:

  • (String)


17
18
19
# File 'lib/fdx_v660_api/models/k1_qualified_business_income_qbi_partner_specific_items.rb', line 17

def business_description
  @business_description
end

#ordinary_incomeFloat

Ordinary business income (loss)

Returns:

  • (Float)


33
34
35
# File 'lib/fdx_v660_api/models/k1_qualified_business_income_qbi_partner_specific_items.rb', line 33

def ordinary_income
  @ordinary_income
end

#other_deductionsFloat

Other deductions

Returns:

  • (Float)


57
58
59
# File 'lib/fdx_v660_api/models/k1_qualified_business_income_qbi_partner_specific_items.rb', line 57

def other_deductions
  @other_deductions
end

#other_incomeFloat

Other income (loss)

Returns:

  • (Float)


49
50
51
# File 'lib/fdx_v660_api/models/k1_qualified_business_income_qbi_partner_specific_items.rb', line 49

def other_income
  @other_income
end

#publicly_traded_partnershipTrueClass | FalseClass

Publicly Traded Partnership (PTP) checkbox

Returns:

  • (TrueClass | FalseClass)


21
22
23
# File 'lib/fdx_v660_api/models/k1_qualified_business_income_qbi_partner_specific_items.rb', line 21

def publicly_traded_partnership
  @publicly_traded_partnership
end

#rental_incomeFloat

Rental income (loss)

Returns:

  • (Float)


37
38
39
# File 'lib/fdx_v660_api/models/k1_qualified_business_income_qbi_partner_specific_items.rb', line 37

def rental_income
  @rental_income
end

#royalty_incomeFloat

Royalty income (loss)

Returns:

  • (Float)


41
42
43
# File 'lib/fdx_v660_api/models/k1_qualified_business_income_qbi_partner_specific_items.rb', line 41

def royalty_income
  @royalty_income
end

#section1231_gainFloat

Section 1231 gain (loss)

Returns:

  • (Float)


45
46
47
# File 'lib/fdx_v660_api/models/k1_qualified_business_income_qbi_partner_specific_items.rb', line 45

def section1231_gain
  @section1231_gain
end

#section179_deductionFloat

Section 179 deduction

Returns:

  • (Float)


53
54
55
# File 'lib/fdx_v660_api/models/k1_qualified_business_income_qbi_partner_specific_items.rb', line 53

def section179_deduction
  @section179_deduction
end

#specified_service_businessTrueClass | FalseClass

Specified Service Trade or Business (SSTB) checkbox

Returns:

  • (TrueClass | FalseClass)


29
30
31
# File 'lib/fdx_v660_api/models/k1_qualified_business_income_qbi_partner_specific_items.rb', line 29

def specified_service_business
  @specified_service_business
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/fdx_v660_api/models/k1_qualified_business_income_qbi_partner_specific_items.rb', line 129

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  business_description =
    hash.key?('businessDescription') ? hash['businessDescription'] : SKIP
  publicly_traded_partnership =
    hash.key?('publiclyTradedPartnership') ? hash['publiclyTradedPartnership'] : SKIP
  aggregated = hash.key?('aggregated') ? hash['aggregated'] : SKIP
  specified_service_business =
    hash.key?('specifiedServiceBusiness') ? hash['specifiedServiceBusiness'] : SKIP
  ordinary_income =
    hash.key?('ordinaryIncome') ? hash['ordinaryIncome'] : SKIP
  rental_income = hash.key?('rentalIncome') ? hash['rentalIncome'] : SKIP
  royalty_income = hash.key?('royaltyIncome') ? hash['royaltyIncome'] : SKIP
  section1231_gain =
    hash.key?('section1231Gain') ? hash['section1231Gain'] : SKIP
  other_income = hash.key?('otherIncome') ? hash['otherIncome'] : SKIP
  section179_deduction =
    hash.key?('section179Deduction') ? hash['section179Deduction'] : SKIP
  other_deductions =
    hash.key?('otherDeductions') ? hash['otherDeductions'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  K1QualifiedBusinessIncomeQbiPartnerSpecificItems.new(business_description: business_description,
                                                       publicly_traded_partnership: publicly_traded_partnership,
                                                       aggregated: aggregated,
                                                       specified_service_business: specified_service_business,
                                                       ordinary_income: ordinary_income,
                                                       rental_income: rental_income,
                                                       royalty_income: royalty_income,
                                                       section1231_gain: section1231_gain,
                                                       other_income: other_income,
                                                       section179_deduction: section179_deduction,
                                                       other_deductions: other_deductions,
                                                       additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/fdx_v660_api/models/k1_qualified_business_income_qbi_partner_specific_items.rb', line 60

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['business_description'] = 'businessDescription'
  @_hash['publicly_traded_partnership'] = 'publiclyTradedPartnership'
  @_hash['aggregated'] = 'aggregated'
  @_hash['specified_service_business'] = 'specifiedServiceBusiness'
  @_hash['ordinary_income'] = 'ordinaryIncome'
  @_hash['rental_income'] = 'rentalIncome'
  @_hash['royalty_income'] = 'royaltyIncome'
  @_hash['section1231_gain'] = 'section1231Gain'
  @_hash['other_income'] = 'otherIncome'
  @_hash['section179_deduction'] = 'section179Deduction'
  @_hash['other_deductions'] = 'otherDeductions'
  @_hash
end

.nullablesObject

An array for nullable fields



94
95
96
# File 'lib/fdx_v660_api/models/k1_qualified_business_income_qbi_partner_specific_items.rb', line 94

def self.nullables
  []
end

.optionalsObject

An array for optional fields



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/fdx_v660_api/models/k1_qualified_business_income_qbi_partner_specific_items.rb', line 77

def self.optionals
  %w[
    business_description
    publicly_traded_partnership
    aggregated
    specified_service_business
    ordinary_income
    rental_income
    royalty_income
    section1231_gain
    other_income
    section179_deduction
    other_deductions
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



187
188
189
190
191
192
193
194
195
196
197
# File 'lib/fdx_v660_api/models/k1_qualified_business_income_qbi_partner_specific_items.rb', line 187

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} business_description: #{@business_description.inspect},"\
  " publicly_traded_partnership: #{@publicly_traded_partnership.inspect}, aggregated:"\
  " #{@aggregated.inspect}, specified_service_business:"\
  " #{@specified_service_business.inspect}, ordinary_income: #{@ordinary_income.inspect},"\
  " rental_income: #{@rental_income.inspect}, royalty_income: #{@royalty_income.inspect},"\
  " section1231_gain: #{@section1231_gain.inspect}, other_income: #{@other_income.inspect},"\
  " section179_deduction: #{@section179_deduction.inspect}, other_deductions:"\
  " #{@other_deductions.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



175
176
177
178
179
180
181
182
183
184
# File 'lib/fdx_v660_api/models/k1_qualified_business_income_qbi_partner_specific_items.rb', line 175

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} business_description: #{@business_description},"\
  " publicly_traded_partnership: #{@publicly_traded_partnership}, aggregated: #{@aggregated},"\
  " specified_service_business: #{@specified_service_business}, ordinary_income:"\
  " #{@ordinary_income}, rental_income: #{@rental_income}, royalty_income: #{@royalty_income},"\
  " section1231_gain: #{@section1231_gain}, other_income: #{@other_income},"\
  " section179_deduction: #{@section179_deduction}, other_deductions: #{@other_deductions},"\
  " additional_properties: #{@additional_properties}>"
end