Class: Gusto::Companies::AsyncFederalTaxDetailsClient
- Inherits:
-
Object
- Object
- Gusto::Companies::AsyncFederalTaxDetailsClient
- Defined in:
- lib/fern_gusto/companies/federal_tax_details/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#get(company_id:, request_options: nil) ⇒ Object
api.companies.federal_tax_details.get(company_id: “company_id”).
- #initialize(request_client:) ⇒ Gusto::Companies::AsyncFederalTaxDetailsClient constructor
-
#update(company_id:, legal_name: nil, ein: nil, tax_payer_type: nil, filing_form: nil, taxable_as_scorp: nil, version:, request_options: nil) ⇒ Object
).
Constructor Details
#initialize(request_client:) ⇒ Gusto::Companies::AsyncFederalTaxDetailsClient
116 117 118 |
# File 'lib/fern_gusto/companies/federal_tax_details/client.rb', line 116 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ Gusto::AsyncRequestClient (readonly)
111 112 113 |
# File 'lib/fern_gusto/companies/federal_tax_details/client.rb', line 111 def request_client @request_client end |
Instance Method Details
#get(company_id:, request_options: nil) ⇒ Object
api.companies.federal_tax_details.get(company_id: “company_id”)
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/fern_gusto/companies/federal_tax_details/client.rb', line 132 def get(company_id:, request_options: nil) Async do response = @request_client.conn.get do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.token.nil? req.headers["Authorization"] = .token end unless &.gusto_api_version.nil? req.headers["X-Gusto-API-Version"] = .gusto_api_version end req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/v1/companies/#{company_id}/federal_tax_details" end Gusto::FederalTaxDetails::FederalTaxDetails.from_json(json_object: response.body) end end |
#update(company_id:, legal_name: nil, ein: nil, tax_payer_type: nil, filing_form: nil, taxable_as_scorp: nil, version:, request_options: nil) ⇒ Object
)
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
# File 'lib/fern_gusto/companies/federal_tax_details/client.rb', line 188 def update(company_id:, legal_name: nil, ein: nil, tax_payer_type: nil, filing_form: nil, taxable_as_scorp: nil, version:, request_options: nil) Async do response = @request_client.conn.put do | req | unless &.timeout_in_seconds.nil? req..timeout = .timeout_in_seconds end unless &.token.nil? req.headers["Authorization"] = .token end unless &.gusto_api_version.nil? req.headers["X-Gusto-API-Version"] = .gusto_api_version end req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end req.body = { **(&.additional_body_parameters || {}), legal_name: legal_name, ein: ein, tax_payer_type: tax_payer_type, filing_form: filing_form, taxable_as_scorp: taxable_as_scorp, version: version }.compact req.url "#{@request_client.get_url(request_options: )}/v1/companies/#{company_id}/federal_tax_details" end Gusto::FederalTaxDetails::FederalTaxDetails.from_json(json_object: response.body) end end |