@@ -486,6 +486,262 @@ async def put(
486
486
path_parts = __path_parts ,
487
487
)
488
488
489
+ @_rewrite_parameters ()
490
+ async def sync_job_cancel (
491
+ self ,
492
+ * ,
493
+ connector_sync_job_id : str ,
494
+ error_trace : t .Optional [bool ] = None ,
495
+ filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
496
+ human : t .Optional [bool ] = None ,
497
+ pretty : t .Optional [bool ] = None ,
498
+ ) -> ObjectApiResponse [t .Any ]:
499
+ """
500
+ Cancels a connector sync job.
501
+
502
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/master/cancel-connector-sync-job-api.html>`_
503
+
504
+ :param connector_sync_job_id: The unique identifier of the connector sync job
505
+ """
506
+ if connector_sync_job_id in SKIP_IN_PATH :
507
+ raise ValueError ("Empty value passed for parameter 'connector_sync_job_id'" )
508
+ __path_parts : t .Dict [str , str ] = {
509
+ "connector_sync_job_id" : _quote (connector_sync_job_id )
510
+ }
511
+ __path = (
512
+ f'/_connector/_sync_job/{ __path_parts ["connector_sync_job_id" ]} /_cancel'
513
+ )
514
+ __query : t .Dict [str , t .Any ] = {}
515
+ if error_trace is not None :
516
+ __query ["error_trace" ] = error_trace
517
+ if filter_path is not None :
518
+ __query ["filter_path" ] = filter_path
519
+ if human is not None :
520
+ __query ["human" ] = human
521
+ if pretty is not None :
522
+ __query ["pretty" ] = pretty
523
+ __headers = {"accept" : "application/json" }
524
+ return await self .perform_request ( # type: ignore[return-value]
525
+ "PUT" ,
526
+ __path ,
527
+ params = __query ,
528
+ headers = __headers ,
529
+ endpoint_id = "connector.sync_job_cancel" ,
530
+ path_parts = __path_parts ,
531
+ )
532
+
533
+ @_rewrite_parameters ()
534
+ async def sync_job_delete (
535
+ self ,
536
+ * ,
537
+ connector_sync_job_id : str ,
538
+ error_trace : t .Optional [bool ] = None ,
539
+ filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
540
+ human : t .Optional [bool ] = None ,
541
+ pretty : t .Optional [bool ] = None ,
542
+ ) -> ObjectApiResponse [t .Any ]:
543
+ """
544
+ Deletes a connector sync job.
545
+
546
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-connector-sync-job-api.html>`_
547
+
548
+ :param connector_sync_job_id: The unique identifier of the connector sync job
549
+ to be deleted
550
+ """
551
+ if connector_sync_job_id in SKIP_IN_PATH :
552
+ raise ValueError ("Empty value passed for parameter 'connector_sync_job_id'" )
553
+ __path_parts : t .Dict [str , str ] = {
554
+ "connector_sync_job_id" : _quote (connector_sync_job_id )
555
+ }
556
+ __path = f'/_connector/_sync_job/{ __path_parts ["connector_sync_job_id" ]} '
557
+ __query : t .Dict [str , t .Any ] = {}
558
+ if error_trace is not None :
559
+ __query ["error_trace" ] = error_trace
560
+ if filter_path is not None :
561
+ __query ["filter_path" ] = filter_path
562
+ if human is not None :
563
+ __query ["human" ] = human
564
+ if pretty is not None :
565
+ __query ["pretty" ] = pretty
566
+ __headers = {"accept" : "application/json" }
567
+ return await self .perform_request ( # type: ignore[return-value]
568
+ "DELETE" ,
569
+ __path ,
570
+ params = __query ,
571
+ headers = __headers ,
572
+ endpoint_id = "connector.sync_job_delete" ,
573
+ path_parts = __path_parts ,
574
+ )
575
+
576
+ @_rewrite_parameters ()
577
+ async def sync_job_get (
578
+ self ,
579
+ * ,
580
+ connector_sync_job_id : str ,
581
+ error_trace : t .Optional [bool ] = None ,
582
+ filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
583
+ human : t .Optional [bool ] = None ,
584
+ pretty : t .Optional [bool ] = None ,
585
+ ) -> ObjectApiResponse [t .Any ]:
586
+ """
587
+ Returns the details about a connector sync job.
588
+
589
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/master/get-connector-sync-job-api.html>`_
590
+
591
+ :param connector_sync_job_id: The unique identifier of the connector sync job
592
+ """
593
+ if connector_sync_job_id in SKIP_IN_PATH :
594
+ raise ValueError ("Empty value passed for parameter 'connector_sync_job_id'" )
595
+ __path_parts : t .Dict [str , str ] = {
596
+ "connector_sync_job_id" : _quote (connector_sync_job_id )
597
+ }
598
+ __path = f'/_connector/_sync_job/{ __path_parts ["connector_sync_job_id" ]} '
599
+ __query : t .Dict [str , t .Any ] = {}
600
+ if error_trace is not None :
601
+ __query ["error_trace" ] = error_trace
602
+ if filter_path is not None :
603
+ __query ["filter_path" ] = filter_path
604
+ if human is not None :
605
+ __query ["human" ] = human
606
+ if pretty is not None :
607
+ __query ["pretty" ] = pretty
608
+ __headers = {"accept" : "application/json" }
609
+ return await self .perform_request ( # type: ignore[return-value]
610
+ "GET" ,
611
+ __path ,
612
+ params = __query ,
613
+ headers = __headers ,
614
+ endpoint_id = "connector.sync_job_get" ,
615
+ path_parts = __path_parts ,
616
+ )
617
+
618
+ @_rewrite_parameters (
619
+ parameter_aliases = {"from" : "from_" },
620
+ )
621
+ async def sync_job_list (
622
+ self ,
623
+ * ,
624
+ connector_id : t .Optional [str ] = None ,
625
+ error_trace : t .Optional [bool ] = None ,
626
+ filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
627
+ from_ : t .Optional [int ] = None ,
628
+ human : t .Optional [bool ] = None ,
629
+ job_type : t .Optional [
630
+ t .Sequence [
631
+ t .Union ["t.Literal['access_control', 'full', 'incremental']" , str ]
632
+ ]
633
+ ] = None ,
634
+ pretty : t .Optional [bool ] = None ,
635
+ size : t .Optional [int ] = None ,
636
+ status : t .Optional [
637
+ t .Union [
638
+ "t.Literal['canceled', 'canceling', 'completed', 'error', 'in_progress', 'pending', 'suspended']" ,
639
+ str ,
640
+ ]
641
+ ] = None ,
642
+ ) -> ObjectApiResponse [t .Any ]:
643
+ """
644
+ Lists all connector sync jobs.
645
+
646
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/{list}/list-connector-sync-jobs-api.html>`_
647
+
648
+ :param connector_id: A connector id to fetch connector sync jobs for
649
+ :param from_: Starting offset (default: 0)
650
+ :param job_type: A comma-separated list of job types to fetch the sync jobs for
651
+ :param size: Specifies a max number of results to get
652
+ :param status: A sync job status to fetch connector sync jobs for
653
+ """
654
+ __path_parts : t .Dict [str , str ] = {}
655
+ __path = "/_connector/_sync_job"
656
+ __query : t .Dict [str , t .Any ] = {}
657
+ if connector_id is not None :
658
+ __query ["connector_id" ] = connector_id
659
+ if error_trace is not None :
660
+ __query ["error_trace" ] = error_trace
661
+ if filter_path is not None :
662
+ __query ["filter_path" ] = filter_path
663
+ if from_ is not None :
664
+ __query ["from" ] = from_
665
+ if human is not None :
666
+ __query ["human" ] = human
667
+ if job_type is not None :
668
+ __query ["job_type" ] = job_type
669
+ if pretty is not None :
670
+ __query ["pretty" ] = pretty
671
+ if size is not None :
672
+ __query ["size" ] = size
673
+ if status is not None :
674
+ __query ["status" ] = status
675
+ __headers = {"accept" : "application/json" }
676
+ return await self .perform_request ( # type: ignore[return-value]
677
+ "GET" ,
678
+ __path ,
679
+ params = __query ,
680
+ headers = __headers ,
681
+ endpoint_id = "connector.sync_job_list" ,
682
+ path_parts = __path_parts ,
683
+ )
684
+
685
+ @_rewrite_parameters (
686
+ body_fields = ("id" , "job_type" , "trigger_method" ),
687
+ )
688
+ async def sync_job_post (
689
+ self ,
690
+ * ,
691
+ id : t .Optional [str ] = None ,
692
+ error_trace : t .Optional [bool ] = None ,
693
+ filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
694
+ human : t .Optional [bool ] = None ,
695
+ job_type : t .Optional [
696
+ t .Union ["t.Literal['access_control', 'full', 'incremental']" , str ]
697
+ ] = None ,
698
+ pretty : t .Optional [bool ] = None ,
699
+ trigger_method : t .Optional [
700
+ t .Union ["t.Literal['on_demand', 'scheduled']" , str ]
701
+ ] = None ,
702
+ body : t .Optional [t .Dict [str , t .Any ]] = None ,
703
+ ) -> ObjectApiResponse [t .Any ]:
704
+ """
705
+ Creates a connector sync job.
706
+
707
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-sync-job-api.html>`_
708
+
709
+ :param id: The id of the associated connector
710
+ :param job_type:
711
+ :param trigger_method:
712
+ """
713
+ if id is None and body is None :
714
+ raise ValueError ("Empty value passed for parameter 'id'" )
715
+ __path_parts : t .Dict [str , str ] = {}
716
+ __path = "/_connector/_sync_job"
717
+ __query : t .Dict [str , t .Any ] = {}
718
+ __body : t .Dict [str , t .Any ] = body if body is not None else {}
719
+ if error_trace is not None :
720
+ __query ["error_trace" ] = error_trace
721
+ if filter_path is not None :
722
+ __query ["filter_path" ] = filter_path
723
+ if human is not None :
724
+ __query ["human" ] = human
725
+ if pretty is not None :
726
+ __query ["pretty" ] = pretty
727
+ if not __body :
728
+ if id is not None :
729
+ __body ["id" ] = id
730
+ if job_type is not None :
731
+ __body ["job_type" ] = job_type
732
+ if trigger_method is not None :
733
+ __body ["trigger_method" ] = trigger_method
734
+ __headers = {"accept" : "application/json" , "content-type" : "application/json" }
735
+ return await self .perform_request ( # type: ignore[return-value]
736
+ "POST" ,
737
+ __path ,
738
+ params = __query ,
739
+ headers = __headers ,
740
+ body = __body ,
741
+ endpoint_id = "connector.sync_job_post" ,
742
+ path_parts = __path_parts ,
743
+ )
744
+
489
745
@_rewrite_parameters (
490
746
body_fields = ("api_key_id" , "api_key_secret_id" ),
491
747
)
0 commit comments