Class: Merge::Crm::AsyncOpportunitiesClient
- Inherits:
-
Object
- Object
- Merge::Crm::AsyncOpportunitiesClient
- 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::AsyncOpportunitiesClient 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::AsyncOpportunitiesClient
373 374 375 |
# File 'lib/merge_ruby_client/crm/opportunities/client.rb', line 373 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ Merge::AsyncRequestClient (readonly)
369 370 371 |
# File 'lib/merge_ruby_client/crm/opportunities/client.rb', line 369 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.
485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 |
# File 'lib/merge_ruby_client/crm/opportunities/client.rb', line 485 def create(model:, is_debug_mode: nil, run_async: nil, 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 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 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.
417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 |
# File 'lib/merge_ruby_client/crm/opportunities/client.rb', line 417 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) 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 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 end |
#meta_patch_retrieve(id:, request_options: nil) ⇒ Merge::Crm::MetaResponse
Returns metadata for ‘Opportunity` PATCHs.
621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 |
# File 'lib/merge_ruby_client/crm/opportunities/client.rb', line 621 def (id:, 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: )}/crm/v1/opportunities/meta/patch/#{id}" end Merge::Crm::MetaResponse.from_json(json_object: response.body) end end |
#meta_post_retrieve(request_options: nil) ⇒ Merge::Crm::MetaResponse
Returns metadata for ‘Opportunity` POSTs.
655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 |
# File 'lib/merge_ruby_client/crm/opportunities/client.rb', line 655 def (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: )}/crm/v1/opportunities/meta/post" end Merge::Crm::MetaResponse.from_json(json_object: response.body) end 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`.
586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 |
# File 'lib/merge_ruby_client/crm/opportunities/client.rb', line 586 def partial_update(id:, model:, is_debug_mode: nil, run_async: nil, request_options: nil) Async do 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 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.
698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 |
# File 'lib/merge_ruby_client/crm/opportunities/client.rb', line 698 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) 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 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 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`.
530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 |
# File 'lib/merge_ruby_client/crm/opportunities/client.rb', line 530 def retrieve(id:, expand: nil, include_remote_data: nil, include_remote_fields: nil, remote_fields: nil, show_enum_origins: nil, 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 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 end |