Class: Gusto::Companies::PaymentConfigsClient
- Inherits:
-
Object
- Object
- Gusto::Companies::PaymentConfigsClient
- Defined in:
- lib/fern_gusto/companies/payment_configs/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#get(company_uuid:, request_options: nil) ⇒ Object
api.companies.payment_configs.get(company_uuid: “company_uuid”).
- #initialize(request_client:) ⇒ Gusto::Companies::PaymentConfigsClient constructor
-
#update(company_uuid:, fast_payment_limit:, payment_speed:, request_options: nil) ⇒ Object
).
Constructor Details
#initialize(request_client:) ⇒ Gusto::Companies::PaymentConfigsClient
18 19 20 |
# File 'lib/fern_gusto/companies/payment_configs/client.rb', line 18 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ Gusto::RequestClient (readonly)
13 14 15 |
# File 'lib/fern_gusto/companies/payment_configs/client.rb', line 13 def request_client @request_client end |
Instance Method Details
#get(company_uuid:, request_options: nil) ⇒ Object
api.companies.payment_configs.get(company_uuid: “company_uuid”)
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/fern_gusto/companies/payment_configs/client.rb', line 35 def get(company_uuid:, request_options: nil) 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_uuid}/payment_configs" end Gusto::PaymentConfigs::PaymentConfigs.from_json(json_object: response.body) end |
#update(company_uuid:, fast_payment_limit:, payment_speed:, request_options: nil) ⇒ Object
)
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/fern_gusto/companies/payment_configs/client.rb', line 81 def update(company_uuid:, fast_payment_limit:, payment_speed:, request_options: nil) 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 || {}), fast_payment_limit: fast_payment_limit, payment_speed: payment_speed }.compact req.url "#{@request_client.get_url(request_options: )}/v1/companies/#{company_uuid}/payment_configs" end Gusto::PaymentConfigs::PaymentConfigs.from_json(json_object: response.body) end |