Class: Gusto::Companies::AsyncPaymentConfigsClient
- Inherits:
-
Object
- Object
- Gusto::Companies::AsyncPaymentConfigsClient
- 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::AsyncPaymentConfigsClient constructor
-
#update(company_uuid:, fast_payment_limit:, payment_speed:, request_options: nil) ⇒ Object
).
Constructor Details
#initialize(request_client:) ⇒ Gusto::Companies::AsyncPaymentConfigsClient
109 110 111 |
# File 'lib/fern_gusto/companies/payment_configs/client.rb', line 109 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ Gusto::AsyncRequestClient (readonly)
104 105 106 |
# File 'lib/fern_gusto/companies/payment_configs/client.rb', line 104 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”)
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/fern_gusto/companies/payment_configs/client.rb', line 126 def get(company_uuid:, 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_uuid}/payment_configs" end Gusto::PaymentConfigs::PaymentConfigs.from_json(json_object: response.body) end end |
#update(company_uuid:, fast_payment_limit:, payment_speed:, request_options: nil) ⇒ Object
)
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/fern_gusto/companies/payment_configs/client.rb', line 174 def update(company_uuid:, fast_payment_limit:, payment_speed:, 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 || {}), 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 end |