Class: Merge::Accounting::AsyncScopesClient
- Inherits:
-
Object
- Object
- Merge::Accounting::AsyncScopesClient
- Defined in:
- lib/merge_ruby_client/accounting/scopes/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#default_scopes_retrieve(request_options: nil) ⇒ Merge::Accounting::CommonModelScopeApi
Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category.
- #initialize(request_client:) ⇒ Merge::Accounting::AsyncScopesClient constructor
-
#linked_account_scopes_create(common_models:, request_options: nil) ⇒ Merge::Accounting::CommonModelScopeApi
Update permissions for any Common Model or field for a single Linked Account.
-
#linked_account_scopes_retrieve(request_options: nil) ⇒ Merge::Accounting::CommonModelScopeApi
Get all available permissions for Merge Common Models and fields for a single Linked Account.
Constructor Details
#initialize(request_client:) ⇒ Merge::Accounting::AsyncScopesClient
133 134 135 |
# File 'lib/merge_ruby_client/accounting/scopes/client.rb', line 133 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ Merge::AsyncRequestClient (readonly)
129 130 131 |
# File 'lib/merge_ruby_client/accounting/scopes/client.rb', line 129 def request_client @request_client end |
Instance Method Details
#default_scopes_retrieve(request_options: nil) ⇒ Merge::Accounting::CommonModelScopeApi
Get the default permissions for Merge Common Models and fields across all Linked
Accounts of a given category. [Learn
more](https://help.merge.dev/en/articles/8828211-common-model-and-field-scopes).
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/merge_ruby_client/accounting/scopes/client.rb', line 150 def default_scopes_retrieve(request_options: nil) Async do response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? 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: )}/accounting/v1/default-scopes" end Merge::Accounting::CommonModelScopeApi.from_json(json_object: response.body) end end |
#linked_account_scopes_create(common_models:, request_options: nil) ⇒ Merge::Accounting::CommonModelScopeApi
Update permissions for any Common Model or field for a single Linked Account.
Any Scopes not set in this POST request will inherit the default Scopes. [Learn
more](https://help.merge.dev/en/articles/8828211-common-model-and-field-scopes)
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 |
# File 'lib/merge_ruby_client/accounting/scopes/client.rb', line 228 def linked_account_scopes_create(common_models:, request_options: nil) Async do response = @request_client.conn.post do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? 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 || {}), common_models: common_models }.compact req.url "#{@request_client.get_url(request_options: )}/accounting/v1/linked-account-scopes" end Merge::Accounting::CommonModelScopeApi.from_json(json_object: response.body) end end |
#linked_account_scopes_retrieve(request_options: nil) ⇒ Merge::Accounting::CommonModelScopeApi
Get all available permissions for Merge Common Models and fields for a single
Linked Account. [Learn
more](https://help.merge.dev/en/articles/8828211-common-model-and-field-scopes).
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
# File 'lib/merge_ruby_client/accounting/scopes/client.rb', line 186 def linked_account_scopes_retrieve(request_options: nil) Async do response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? 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: )}/accounting/v1/linked-account-scopes" end Merge::Accounting::CommonModelScopeApi.from_json(json_object: response.body) end end |