Class: Merge::Crm::ScopesClient
- Inherits:
-
Object
- Object
- Merge::Crm::ScopesClient
- Defined in:
- lib/merge_ruby_client/crm/scopes/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#default_scopes_retrieve(request_options: nil) ⇒ Merge::Crm::CommonModelScopeApi
Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category.
- #initialize(request_client:) ⇒ Merge::Crm::ScopesClient constructor
-
#linked_account_scopes_create(common_models:, request_options: nil) ⇒ Merge::Crm::CommonModelScopeApi
Update permissions for any Common Model or field for a single Linked Account.
-
#linked_account_scopes_retrieve(request_options: nil) ⇒ Merge::Crm::CommonModelScopeApi
Get all available permissions for Merge Common Models and fields for a single Linked Account.
Constructor Details
#initialize(request_client:) ⇒ Merge::Crm::ScopesClient
16 17 18 |
# File 'lib/merge_ruby_client/crm/scopes/client.rb', line 16 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ Merge::RequestClient (readonly)
12 13 14 |
# File 'lib/merge_ruby_client/crm/scopes/client.rb', line 12 def request_client @request_client end |
Instance Method Details
#default_scopes_retrieve(request_options: nil) ⇒ Merge::Crm::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).
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/merge_ruby_client/crm/scopes/client.rb', line 33 def default_scopes_retrieve(request_options: nil) 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: )}/crm/v1/default-scopes" end Merge::Crm::CommonModelScopeApi.from_json(json_object: response.body) end |
#linked_account_scopes_create(common_models:, request_options: nil) ⇒ Merge::Crm::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)
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/merge_ruby_client/crm/scopes/client.rb', line 107 def linked_account_scopes_create(common_models:, request_options: nil) 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: )}/crm/v1/linked-account-scopes" end Merge::Crm::CommonModelScopeApi.from_json(json_object: response.body) end |
#linked_account_scopes_retrieve(request_options: nil) ⇒ Merge::Crm::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).
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/merge_ruby_client/crm/scopes/client.rb', line 67 def linked_account_scopes_retrieve(request_options: nil) 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: )}/crm/v1/linked-account-scopes" end Merge::Crm::CommonModelScopeApi.from_json(json_object: response.body) end |