Class: NewDemoApiClient::AsyncDealClient
- Inherits:
-
Object
- Object
- NewDemoApiClient::AsyncDealClient
- Defined in:
- lib/test_sdk/deal/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(group_id:, name:, round_name:, status:, company_id:, notes: nil, priority: nil, round_amount: nil, round_target: nil, tags: nil, request_options: nil) ⇒ NewDemoApiClient::DealWithFilesResponse
Create a new deal.
-
#delete(deal_id:, group_id:, archive: nil, request_options: nil) ⇒ Hash{String => String}
Delete a deal.
-
#get(group_id:, deal_id:, request_options: nil) ⇒ NewDemoApiClient::DealWithFilesResponse
Retrieve a deal by its ID.
- #initialize(request_client:) ⇒ NewDemoApiClient::AsyncDealClient constructor
-
#list(group_id:, sort_by: nil, sort_order: nil, page: nil, page_size: nil, request_options: nil) ⇒ NewDemoApiClient::PaginatedResponseDealWithFilesResponse
Get all deals for a group.
-
#search(group_id:, name: nil, round_name: nil, notes: nil, tags: nil, company_name: nil, company_domain: nil, ignore_archived: nil, sort_by: nil, sort_order: nil, page: nil, page_size: nil, request_options: nil) ⇒ NewDemoApiClient::PaginatedResponseDealWithFilesResponse
Search deals within a group.
-
#update(group_id:, deal_id:, name: nil, round_name: nil, status: nil, notes: nil, priority: nil, round_amount: nil, round_target: nil, tags: nil, company_id: nil, request_options: nil) ⇒ NewDemoApiClient::DealWithFilesResponse
Update a deal.
Constructor Details
#initialize(request_client:) ⇒ NewDemoApiClient::AsyncDealClient
298 299 300 |
# File 'lib/test_sdk/deal/client.rb', line 298 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ NewDemoApiClient::AsyncRequestClient (readonly)
294 295 296 |
# File 'lib/test_sdk/deal/client.rb', line 294 def request_client @request_client end |
Instance Method Details
#create(group_id:, name:, round_name:, status:, company_id:, notes: nil, priority: nil, round_amount: nil, round_target: nil, tags: nil, request_options: nil) ⇒ NewDemoApiClient::DealWithFilesResponse
Create a new deal.
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 |
# File 'lib/test_sdk/deal/client.rb', line 329 def create(group_id:, name:, round_name:, status:, company_id:, notes: nil, priority: nil, round_amount: nil, round_target: nil, tags: 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"] = .token unless &.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 || {}), name: name, round_name: round_name, status: status, notes: notes, priority: priority, round_amount: round_amount, round_target: round_target, tags: , company_id: company_id }.compact req.url "#{@request_client.get_url(request_options: )}/api/v1/group/#{group_id}/deal" end NewDemoApiClient::DealWithFilesResponse.from_json(json_object: response.body) end end |
#delete(deal_id:, group_id:, archive: nil, request_options: nil) ⇒ Hash{String => String}
Delete a deal.
563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 |
# File 'lib/test_sdk/deal/client.rb', line 563 def delete(deal_id:, group_id:, archive: nil, request_options: nil) Async do response = @request_client.conn.delete do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "archive": archive }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/api/v1/group/#{deal_id}/deal/#{group_id}" end parsed_json = JSON.parse(response.body) parsed_json end end |
#get(group_id:, deal_id:, request_options: nil) ⇒ NewDemoApiClient::DealWithFilesResponse
Retrieve a deal by its ID.
473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 |
# File 'lib/test_sdk/deal/client.rb', line 473 def get(group_id:, deal_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"] = .token unless &.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: )}/api/v1/group/#{group_id}/deal/#{deal_id}" end NewDemoApiClient::DealWithFilesResponse.from_json(json_object: response.body) end end |
#list(group_id:, sort_by: nil, sort_order: nil, page: nil, page_size: nil, request_options: nil) ⇒ NewDemoApiClient::PaginatedResponseDealWithFilesResponse
Get all deals for a group.
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 |
# File 'lib/test_sdk/deal/client.rb', line 377 def list(group_id:, sort_by: nil, sort_order: nil, page: 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"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "sort_by": sort_by, "sort_order": sort_order, "page": page, "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: )}/api/v1/group/#{group_id}/deal/all" end NewDemoApiClient::PaginatedResponseDealWithFilesResponse.from_json(json_object: response.body) end end |
#search(group_id:, name: nil, round_name: nil, notes: nil, tags: nil, company_name: nil, company_domain: nil, ignore_archived: nil, sort_by: nil, sort_order: nil, page: nil, page_size: nil, request_options: nil) ⇒ NewDemoApiClient::PaginatedResponseDealWithFilesResponse
Search deals within a group.
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 458 |
# File 'lib/test_sdk/deal/client.rb', line 426 def search(group_id:, name: nil, round_name: nil, notes: nil, tags: nil, company_name: nil, company_domain: nil, ignore_archived: nil, sort_by: nil, sort_order: nil, page: 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"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "name": name, "round_name": round_name, "notes": notes, "tags": , "company_name": company_name, "company_domain": company_domain, "ignore_archived": ignore_archived, "sort_by": sort_by, "sort_order": sort_order, "page": page, "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: )}/api/v1/group/#{group_id}/deal/search" end NewDemoApiClient::PaginatedResponseDealWithFilesResponse.from_json(json_object: response.body) end end |
#update(group_id:, deal_id:, name: nil, round_name: nil, status: nil, notes: nil, priority: nil, round_amount: nil, round_target: nil, tags: nil, company_id: nil, request_options: nil) ⇒ NewDemoApiClient::DealWithFilesResponse
Update a deal.
517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 |
# File 'lib/test_sdk/deal/client.rb', line 517 def update(group_id:, deal_id:, name: nil, round_name: nil, status: nil, notes: nil, priority: nil, round_amount: nil, round_target: nil, tags: nil, company_id: nil, request_options: nil) Async do response = @request_client.conn.put do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.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 || {}), name: name, round_name: round_name, status: status, notes: notes, priority: priority, round_amount: round_amount, round_target: round_target, tags: , company_id: company_id }.compact req.url "#{@request_client.get_url(request_options: )}/api/v1/group/#{group_id}/deal/#{deal_id}" end NewDemoApiClient::DealWithFilesResponse.from_json(json_object: response.body) end end |