Class: Merge::Crm::OpportunitiesClient
- Inherits:
-
Object
- Object
- Merge::Crm::OpportunitiesClient
- Defined in:
- lib/merge_ruby_client/crm/opportunities/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Crm::OpportunityResponse
Creates an ‘Opportunity` object with the given values.
- #initialize(request_client:) ⇒ Merge::Crm::OpportunitiesClient constructor
-
#list(account_id: nil, created_after: nil, created_before: nil, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, modified_after: nil, modified_before: nil, owner_id: nil, page_size: nil, remote_created_after: nil, remote_fields: nil, remote_id: nil, show_enum_origins: nil, stage_id: nil, status: nil, request_options: nil) ⇒ Merge::Crm::PaginatedOpportunityList
Returns a list of ‘Opportunity` objects.
-
#meta_patch_retrieve(id:, request_options: nil) ⇒ Merge::Crm::MetaResponse
Returns metadata for ‘Opportunity` PATCHs.
-
#meta_post_retrieve(request_options: nil) ⇒ Merge::Crm::MetaResponse
Returns metadata for ‘Opportunity` POSTs.
-
#partial_update(id:, model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Crm::OpportunityResponse
Updates an ‘Opportunity` object with the given `id`.
-
#remote_field_classes_list(cursor: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, is_common_model_field: nil, page_size: nil, request_options: nil) ⇒ Merge::Crm::PaginatedRemoteFieldClassList
Returns a list of ‘RemoteFieldClass` objects.
-
#retrieve(id:, expand: nil, include_remote_data: nil, include_remote_fields: nil, remote_fields: nil, show_enum_origins: nil, request_options: nil) ⇒ Merge::Crm::Opportunity
Returns an ‘Opportunity` object with the given `id`.
Constructor Details
#initialize(request_client:) ⇒ Merge::Crm::OpportunitiesClient
25 26 27 |
# File 'lib/merge_ruby_client/crm/opportunities/client.rb', line 25 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ Merge::RequestClient (readonly)
21 22 23 |
# File 'lib/merge_ruby_client/crm/opportunities/client.rb', line 21 def request_client @request_client end |
Instance Method Details
#create(model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Crm::OpportunityResponse
Creates an ‘Opportunity` object with the given values.
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/merge_ruby_client/crm/opportunities/client.rb', line 135 def create(model:, is_debug_mode: nil, run_async: nil, 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 req.params = { **(&.additional_query_parameters || {}), "is_debug_mode": is_debug_mode, "run_async": run_async }.compact req.body = { **(&.additional_body_parameters || {}), model: model }.compact req.url "#{@request_client.get_url(request_options: )}/crm/v1/opportunities" end Merge::Crm::OpportunityResponse.from_json(json_object: response.body) end |
#list(account_id: nil, created_after: nil, created_before: nil, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, modified_after: nil, modified_before: nil, owner_id: nil, page_size: nil, remote_created_after: nil, remote_fields: nil, remote_id: nil, show_enum_origins: nil, stage_id: nil, status: nil, request_options: nil) ⇒ Merge::Crm::PaginatedOpportunityList
Returns a list of ‘Opportunity` objects.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/merge_ruby_client/crm/opportunities/client.rb', line 69 def list(account_id: nil, created_after: nil, created_before: nil, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, modified_after: nil, modified_before: nil, owner_id: nil, page_size: nil, remote_created_after: nil, remote_fields: nil, remote_id: nil, show_enum_origins: nil, stage_id: nil, status: nil, 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 req.params = { **(&.additional_query_parameters || {}), "account_id": account_id, "created_after": created_after, "created_before": created_before, "cursor": cursor, "expand": , "include_deleted_data": include_deleted_data, "include_remote_data": include_remote_data, "include_remote_fields": include_remote_fields, "modified_after": modified_after, "modified_before": modified_before, "owner_id": owner_id, "page_size": page_size, "remote_created_after": remote_created_after, "remote_fields": remote_fields, "remote_id": remote_id, "show_enum_origins": show_enum_origins, "stage_id": stage_id, "status": status }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/crm/v1/opportunities" end Merge::Crm::PaginatedOpportunityList.from_json(json_object: response.body) end |
#meta_patch_retrieve(id:, request_options: nil) ⇒ Merge::Crm::MetaResponse
Returns metadata for ‘Opportunity` PATCHs.
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/merge_ruby_client/crm/opportunities/client.rb', line 265 def (id:, 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/opportunities/meta/patch/#{id}" end Merge::Crm::MetaResponse.from_json(json_object: response.body) end |
#meta_post_retrieve(request_options: nil) ⇒ Merge::Crm::MetaResponse
Returns metadata for ‘Opportunity` POSTs.
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
# File 'lib/merge_ruby_client/crm/opportunities/client.rb', line 297 def (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/opportunities/meta/post" end Merge::Crm::MetaResponse.from_json(json_object: response.body) end |
#partial_update(id:, model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Crm::OpportunityResponse
Updates an ‘Opportunity` object with the given `id`.
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/merge_ruby_client/crm/opportunities/client.rb', line 232 def partial_update(id:, model:, is_debug_mode: nil, run_async: nil, request_options: nil) response = @request_client.conn.patch 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 req.params = { **(&.additional_query_parameters || {}), "is_debug_mode": is_debug_mode, "run_async": run_async }.compact req.body = { **(&.additional_body_parameters || {}), model: model }.compact req.url "#{@request_client.get_url(request_options: )}/crm/v1/opportunities/#{id}" end Merge::Crm::OpportunityResponse.from_json(json_object: response.body) end |
#remote_field_classes_list(cursor: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, is_common_model_field: nil, page_size: nil, request_options: nil) ⇒ Merge::Crm::PaginatedRemoteFieldClassList
Returns a list of ‘RemoteFieldClass` objects.
338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 |
# File 'lib/merge_ruby_client/crm/opportunities/client.rb', line 338 def remote_field_classes_list(cursor: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, is_common_model_field: nil, page_size: nil, 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 req.params = { **(&.additional_query_parameters || {}), "cursor": cursor, "include_deleted_data": include_deleted_data, "include_remote_data": include_remote_data, "include_remote_fields": include_remote_fields, "is_common_model_field": is_common_model_field, "page_size": page_size }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/crm/v1/opportunities/remote-field-classes" end Merge::Crm::PaginatedRemoteFieldClassList.from_json(json_object: response.body) end |
#retrieve(id:, expand: nil, include_remote_data: nil, include_remote_fields: nil, remote_fields: nil, show_enum_origins: nil, request_options: nil) ⇒ Merge::Crm::Opportunity
Returns an ‘Opportunity` object with the given `id`.
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
# File 'lib/merge_ruby_client/crm/opportunities/client.rb', line 178 def retrieve(id:, expand: nil, include_remote_data: nil, include_remote_fields: nil, remote_fields: nil, show_enum_origins: nil, 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 req.params = { **(&.additional_query_parameters || {}), "expand": , "include_remote_data": include_remote_data, "include_remote_fields": include_remote_fields, "remote_fields": remote_fields, "show_enum_origins": show_enum_origins }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/crm/v1/opportunities/#{id}" end Merge::Crm::Opportunity.from_json(json_object: response.body) end |