nifi-rust-client 0.2.1

Apache NiFi REST API client library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
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
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
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
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
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
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
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
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
// @generated — do not edit; run `cargo run -p nifi-openapi-gen`

use crate::NifiClient;
use crate::NifiError;
pub struct ProcessGroupsApi<'a> {
    pub(crate) client: &'a NifiClient,
}
#[allow(
    private_interfaces,
    clippy::too_many_arguments,
    clippy::vec_init_then_push
)]
impl<'a> ProcessGroupsApi<'a> {
    /// Deletes the Replace Request with the given ID
    ///
    /// Deletes the Replace Request with the given ID. After a request is created via a POST to /process-groups/{id}/replace-requests, it is expected that the client will properly clean up the request by DELETE'ing it, once the Replace process has completed. If the request is deleted before the request completes, then the Replace request will finish the step that it is currently performing and then will cancel any subsequent steps. Note: This endpoint is subject to change as NiFi and it's REST API evolve.
    ///
    /// Calls `DELETE /nifi-api/process-groups/replace-requests/{id}`.
    ///
    /// # Parameters
    /// - `id`: The ID of the Update Request
    /// - `disconnected_node_acknowledged`: Acknowledges that this node is disconnected to allow for mutable requests to proceed.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// Requires `Only the user that submitted the request can remove it`.
    pub async fn delete_replace_process_group_request(
        &self,
        id: &str,
        disconnected_node_acknowledged: Option<bool>,
    ) -> Result<crate::v2_8_0::types::ProcessGroupReplaceRequestEntity, NifiError> {
        let mut query: Vec<(&str, String)> = vec![];
        if let Some(v) = disconnected_node_acknowledged {
            query.push(("disconnectedNodeAcknowledged", v.to_string()));
        }
        self.client
            .delete_returning_with_query(&format!("/process-groups/replace-requests/{id}"), &query)
            .await
    }
    /// Returns the Replace Request with the given ID
    ///
    /// Returns the Replace Request with the given ID. Once a Replace Request has been created by performing a POST to /process-groups/{id}/replace-requests, that request can subsequently be retrieved via this endpoint, and the request that is fetched will contain the updated state, such as percent complete, the current state of the request, and any failures. Note: This endpoint is subject to change as NiFi and it's REST API evolve.
    ///
    /// Calls `GET /nifi-api/process-groups/replace-requests/{id}`.
    ///
    /// # Parameters
    /// - `id`: The ID of the Replace Request
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// Requires `Only the user that submitted the request can get it`.
    pub async fn get_replace_process_group_request(
        &self,
        id: &str,
    ) -> Result<crate::v2_8_0::types::ProcessGroupReplaceRequestEntity, NifiError> {
        self.client
            .get(&format!("/process-groups/replace-requests/{id}"))
            .await
    }
    /// Deletes a process group
    ///
    /// Calls `DELETE /nifi-api/process-groups/{id}`.
    ///
    /// # Parameters
    /// - `id`: The process group id.
    /// - `version`: The revision is used to verify the client is working with the latest version of the flow.
    /// - `client_id`: If the client id is not specified, new one will be generated. This value (whether specified or generated) is included in the response.
    /// - `disconnected_node_acknowledged`: Acknowledges that this node is disconnected to allow for mutable requests to proceed.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// - `Write - /process-groups/{uuid}`
    /// - `Write - Parent Process Group - /process-groups/{uuid}`
    /// - `Read - any referenced Controller Services by any encapsulated components - /controller-services/{uuid}`
    /// - `Write - /{component-type}/{uuid} - For all encapsulated components`
    pub async fn remove_process_group(
        &self,
        id: &str,
        version: Option<&str>,
        client_id: Option<&str>,
        disconnected_node_acknowledged: Option<bool>,
    ) -> Result<crate::v2_8_0::types::ProcessGroupEntity, NifiError> {
        let mut query: Vec<(&str, String)> = vec![];
        if let Some(v) = version {
            query.push(("version", v.to_string()));
        }
        if let Some(v) = client_id {
            query.push(("clientId", v.to_string()));
        }
        if let Some(v) = disconnected_node_acknowledged {
            query.push(("disconnectedNodeAcknowledged", v.to_string()));
        }
        self.client
            .delete_returning_with_query(&format!("/process-groups/{id}"), &query)
            .await
    }
    /// Gets a process group
    ///
    /// Calls `GET /nifi-api/process-groups/{id}`.
    ///
    /// # Parameters
    /// - `id`: The process group id.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// Requires `Read - /process-groups/{uuid}`.
    pub async fn get_process_group(
        &self,
        id: &str,
    ) -> Result<crate::v2_8_0::types::ProcessGroupEntity, NifiError> {
        self.client.get(&format!("/process-groups/{id}")).await
    }
    /// Updates a process group
    ///
    /// Calls `PUT /nifi-api/process-groups/{id}`.
    ///
    /// # Parameters
    /// - `id`: The process group id.
    /// - `body`: The process group configuration details.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// Requires `Write - /process-groups/{uuid}`.
    pub async fn update_process_group(
        &self,
        id: &str,
        body: &crate::v2_8_0::types::ProcessGroupEntity,
    ) -> Result<crate::v2_8_0::types::ProcessGroupEntity, NifiError> {
        self.client
            .put(&format!("/process-groups/{id}"), body)
            .await
    }
    /// Scope operations to the `connections` sub-resource of a specific process group.
    ///
    /// - `id`: The process group id.
    pub fn connections<'b>(&'b self, id: &'b str) -> ProcessGroupsConnectionsApi<'b> {
        ProcessGroupsConnectionsApi {
            client: self.client,
            id,
        }
    }
    /// Scope operations to the `controller_services` sub-resource of a specific process group.
    ///
    /// - `id`: The process group id.
    pub fn controller_services<'b>(
        &'b self,
        id: &'b str,
    ) -> ProcessGroupsControllerServicesApi<'b> {
        ProcessGroupsControllerServicesApi {
            client: self.client,
            id,
        }
    }
    /// Scope operations to the `copy` sub-resource of a specific process group.
    ///
    /// - `id`: The process group id.
    pub fn copy<'b>(&'b self, id: &'b str) -> ProcessGroupsCopyApi<'b> {
        ProcessGroupsCopyApi {
            client: self.client,
            id,
        }
    }
    /// Scope operations to the `download` sub-resource of a specific process group.
    ///
    /// - `id`: The process group id.
    pub fn download<'b>(&'b self, id: &'b str) -> ProcessGroupsDownloadApi<'b> {
        ProcessGroupsDownloadApi {
            client: self.client,
            id,
        }
    }
    /// Scope operations to the `empty_all_connections_requests` sub-resource of a specific process group.
    ///
    /// - `id`: The process group id.
    pub fn empty_all_connections_requests<'b>(
        &'b self,
        id: &'b str,
    ) -> ProcessGroupsEmptyAllConnectionsRequestsApi<'b> {
        ProcessGroupsEmptyAllConnectionsRequestsApi {
            client: self.client,
            id,
        }
    }
    /// Scope operations to the `flow_contents` sub-resource of a specific process group.
    ///
    /// - `id`: The process group id.
    pub fn flow_contents<'b>(&'b self, id: &'b str) -> ProcessGroupsFlowContentsApi<'b> {
        ProcessGroupsFlowContentsApi {
            client: self.client,
            id,
        }
    }
    /// Scope operations to the `funnels` sub-resource of a specific process group.
    ///
    /// - `id`: The process group id.
    pub fn funnels<'b>(&'b self, id: &'b str) -> ProcessGroupsFunnelsApi<'b> {
        ProcessGroupsFunnelsApi {
            client: self.client,
            id,
        }
    }
    /// Scope operations to the `input_ports` sub-resource of a specific process group.
    ///
    /// - `id`: The process group id.
    pub fn input_ports<'b>(&'b self, id: &'b str) -> ProcessGroupsInputPortsApi<'b> {
        ProcessGroupsInputPortsApi {
            client: self.client,
            id,
        }
    }
    /// Scope operations to the `labels` sub-resource of a specific process group.
    ///
    /// - `id`: The process group id.
    pub fn labels<'b>(&'b self, id: &'b str) -> ProcessGroupsLabelsApi<'b> {
        ProcessGroupsLabelsApi {
            client: self.client,
            id,
        }
    }
    /// Scope operations to the `local_modifications` sub-resource of a specific process group.
    ///
    /// - `id`: The process group id.
    pub fn local_modifications<'b>(
        &'b self,
        id: &'b str,
    ) -> ProcessGroupsLocalModificationsApi<'b> {
        ProcessGroupsLocalModificationsApi {
            client: self.client,
            id,
        }
    }
    /// Scope operations to the `output_ports` sub-resource of a specific process group.
    ///
    /// - `id`: The process group id.
    pub fn output_ports<'b>(&'b self, id: &'b str) -> ProcessGroupsOutputPortsApi<'b> {
        ProcessGroupsOutputPortsApi {
            client: self.client,
            id,
        }
    }
    /// Scope operations to the `paste` sub-resource of a specific process group.
    ///
    /// - `id`: The process group id.
    pub fn paste<'b>(&'b self, id: &'b str) -> ProcessGroupsPasteApi<'b> {
        ProcessGroupsPasteApi {
            client: self.client,
            id,
        }
    }
    /// Scope operations to the `process_groups` sub-resource of a specific process group.
    ///
    /// - `id`: The process group id.
    pub fn process_groups<'b>(&'b self, id: &'b str) -> ProcessGroupsProcessGroupsApi<'b> {
        ProcessGroupsProcessGroupsApi {
            client: self.client,
            id,
        }
    }
    /// Scope operations to the `processors` sub-resource of a specific process group.
    ///
    /// - `id`: The process group id.
    pub fn processors<'b>(&'b self, id: &'b str) -> ProcessGroupsProcessorsApi<'b> {
        ProcessGroupsProcessorsApi {
            client: self.client,
            id,
        }
    }
    /// Scope operations to the `remote_process_groups` sub-resource of a specific process group.
    ///
    /// - `id`: The process group id.
    pub fn remote_process_groups<'b>(
        &'b self,
        id: &'b str,
    ) -> ProcessGroupsRemoteProcessGroupsApi<'b> {
        ProcessGroupsRemoteProcessGroupsApi {
            client: self.client,
            id,
        }
    }
    /// Scope operations to the `replace_requests` sub-resource of a specific process group.
    ///
    /// - `id`: The process group id.
    pub fn replace_requests<'b>(&'b self, id: &'b str) -> ProcessGroupsReplaceRequestsApi<'b> {
        ProcessGroupsReplaceRequestsApi {
            client: self.client,
            id,
        }
    }
    /// Scope operations to the `snippet_instance` sub-resource of a specific process group.
    ///
    /// - `id`: The process group id.
    pub fn snippet_instance<'b>(&'b self, id: &'b str) -> ProcessGroupsSnippetInstanceApi<'b> {
        ProcessGroupsSnippetInstanceApi {
            client: self.client,
            id,
        }
    }
}
pub struct ProcessGroupsConnectionsApi<'a> {
    pub(crate) client: &'a NifiClient,
    pub(crate) id: &'a str,
}
#[allow(
    private_interfaces,
    clippy::too_many_arguments,
    clippy::vec_init_then_push
)]
impl<'a> ProcessGroupsConnectionsApi<'a> {
    /// Gets all connections
    ///
    /// Calls `GET /nifi-api/process-groups/{id}/connections`.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// Requires `Read - /process-groups/{uuid}`.
    pub async fn get_connections(
        &self,
    ) -> Result<crate::v2_8_0::types::ConnectionsEntity, NifiError> {
        let id = self.id;
        self.client
            .get(&format!("/process-groups/{id}/connections"))
            .await
    }
    /// Creates a connection
    ///
    /// Calls `POST /nifi-api/process-groups/{id}/connections`.
    ///
    /// # Parameters
    /// - `body`: The connection configuration details.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// - `Write - /process-groups/{uuid}`
    /// - `Write Source - /{component-type}/{uuid}`
    /// - `Write Destination - /{component-type}/{uuid}`
    pub async fn create_connection(
        &self,
        body: &crate::v2_8_0::types::ConnectionEntity,
    ) -> Result<crate::v2_8_0::types::ConnectionEntity, NifiError> {
        let id = self.id;
        self.client
            .post(&format!("/process-groups/{id}/connections"), body)
            .await
    }
}
pub struct ProcessGroupsControllerServicesApi<'a> {
    pub(crate) client: &'a NifiClient,
    pub(crate) id: &'a str,
}
#[allow(
    private_interfaces,
    clippy::too_many_arguments,
    clippy::vec_init_then_push
)]
impl<'a> ProcessGroupsControllerServicesApi<'a> {
    /// Creates a new controller service
    ///
    /// Calls `POST /nifi-api/process-groups/{id}/controller-services`.
    ///
    /// # Parameters
    /// - `body`: The controller service configuration details.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// - `Write - /process-groups/{uuid}`
    /// - `Read - any referenced Controller Services - /controller-services/{uuid}`
    /// - `Write - if the Controller Service is restricted - /restricted-components`
    pub async fn create_controller_service_1(
        &self,
        body: &crate::v2_8_0::types::ControllerServiceEntity,
    ) -> Result<crate::v2_8_0::types::ControllerServiceEntity, NifiError> {
        let id = self.id;
        self.client
            .post(&format!("/process-groups/{id}/controller-services"), body)
            .await
    }
}
pub struct ProcessGroupsCopyApi<'a> {
    pub(crate) client: &'a NifiClient,
    pub(crate) id: &'a str,
}
#[allow(
    private_interfaces,
    clippy::too_many_arguments,
    clippy::vec_init_then_push
)]
impl<'a> ProcessGroupsCopyApi<'a> {
    /// Generates a copy response for the given copy request
    ///
    /// Calls `POST /nifi-api/process-groups/{id}/copy`.
    ///
    /// # Parameters
    /// - `body`: The request including the components to be copied from the specified Process Group.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// Requires `Read - /{component-type}/{uuid} - For all encapsulated components`.
    pub async fn copy(
        &self,
        body: &crate::v2_8_0::types::CopyRequestEntity,
    ) -> Result<crate::v2_8_0::types::CopyResponseEntity, NifiError> {
        let id = self.id;
        self.client
            .post(&format!("/process-groups/{id}/copy"), body)
            .await
    }
}
pub struct ProcessGroupsDownloadApi<'a> {
    pub(crate) client: &'a NifiClient,
    pub(crate) id: &'a str,
}
#[allow(
    private_interfaces,
    clippy::too_many_arguments,
    clippy::vec_init_then_push
)]
impl<'a> ProcessGroupsDownloadApi<'a> {
    /// Gets a process group for download
    ///
    /// Calls `GET /nifi-api/process-groups/{id}/download`.
    ///
    /// # Parameters
    /// - `include_referenced_services`: If referenced services from outside the target group should be included
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// Requires `Read - /process-groups/{uuid}`.
    pub async fn export_process_group(
        &self,
        include_referenced_services: Option<bool>,
    ) -> Result<(), NifiError> {
        let id = self.id;
        let mut query: Vec<(&str, String)> = vec![];
        if let Some(v) = include_referenced_services {
            query.push(("includeReferencedServices", v.to_string()));
        }
        self.client
            .get_void_with_query(&format!("/process-groups/{id}/download"), &query)
            .await
    }
}
pub struct ProcessGroupsEmptyAllConnectionsRequestsApi<'a> {
    pub(crate) client: &'a NifiClient,
    pub(crate) id: &'a str,
}
#[allow(
    private_interfaces,
    clippy::too_many_arguments,
    clippy::vec_init_then_push
)]
impl<'a> ProcessGroupsEmptyAllConnectionsRequestsApi<'a> {
    /// Creates a request to drop all flowfiles of all connection queues in this process group.
    ///
    /// Calls `POST /nifi-api/process-groups/{id}/empty-all-connections-requests`.
    ///
    /// # Errors
    /// - `202`: The request has been accepted. An HTTP response header will contain the URI where the status can be polled.
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// - `Read - /process-groups/{uuid} - For this and all encapsulated process groups`
    /// - `Write Source Data - /data/{component-type}/{uuid} - For all encapsulated connections`
    pub async fn create_empty_all_connections_request(&self) -> Result<(), NifiError> {
        let id = self.id;
        self.client
            .post_void_no_body(&format!(
                "/process-groups/{id}/empty-all-connections-requests"
            ))
            .await
    }
    /// Cancels and/or removes a request to drop all flowfiles.
    ///
    /// Calls `DELETE /nifi-api/process-groups/{id}/empty-all-connections-requests/{drop-request-id}`.
    ///
    /// # Parameters
    /// - `drop_request_id`: The drop request id.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// - `Read - /process-groups/{uuid} - For this and all encapsulated process groups`
    /// - `Write Source Data - /data/{component-type}/{uuid} - For all encapsulated connections`
    pub async fn remove_drop_request_1(
        &self,
        drop_request_id: &str,
    ) -> Result<crate::v2_8_0::types::DropRequestDto, NifiError> {
        let id = self.id;
        let e: crate::v2_8_0::types::DropRequestEntity = self
            .client
            .delete_returning(&format!(
                "/process-groups/{id}/empty-all-connections-requests/{drop_request_id}"
            ))
            .await?;
        Ok(e.drop_request)
    }
    /// Gets the current status of a drop all flowfiles request.
    ///
    /// Calls `GET /nifi-api/process-groups/{id}/empty-all-connections-requests/{drop-request-id}`.
    ///
    /// # Parameters
    /// - `drop_request_id`: The drop request id.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// - `Read - /process-groups/{uuid} - For this and all encapsulated process groups`
    /// - `Write Source Data - /data/{component-type}/{uuid} - For all encapsulated connections`
    pub async fn get_drop_all_flowfiles_request(
        &self,
        drop_request_id: &str,
    ) -> Result<crate::v2_8_0::types::DropRequestDto, NifiError> {
        let id = self.id;
        let e: crate::v2_8_0::types::DropRequestEntity = self
            .client
            .get(&format!(
                "/process-groups/{id}/empty-all-connections-requests/{drop_request_id}"
            ))
            .await?;
        Ok(e.drop_request)
    }
}
pub struct ProcessGroupsFlowContentsApi<'a> {
    pub(crate) client: &'a NifiClient,
    pub(crate) id: &'a str,
}
#[allow(
    private_interfaces,
    clippy::too_many_arguments,
    clippy::vec_init_then_push
)]
impl<'a> ProcessGroupsFlowContentsApi<'a> {
    /// Replace Process Group contents with the given ID with the specified Process Group contents
    ///
    /// This endpoint is used for replication within a cluster, when replacing a flow with a new flow. It expects that the flow beingreplaced is not under version control and that the given snapshot will not modify any Processor that is currently running or any Controller Service that is enabled. Note: This endpoint is subject to change as NiFi and it's REST API evolve.
    ///
    /// Calls `PUT /nifi-api/process-groups/{id}/flow-contents`.
    ///
    /// # Parameters
    /// - `body`: The process group replace request entity.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// - `Read - /process-groups/{uuid}`
    /// - `Write - /process-groups/{uuid}`
    pub async fn replace_process_group(
        &self,
        body: &crate::v2_8_0::types::ProcessGroupImportEntity,
    ) -> Result<crate::v2_8_0::types::ProcessGroupImportEntity, NifiError> {
        let id = self.id;
        self.client
            .put(&format!("/process-groups/{id}/flow-contents"), body)
            .await
    }
}
pub struct ProcessGroupsFunnelsApi<'a> {
    pub(crate) client: &'a NifiClient,
    pub(crate) id: &'a str,
}
#[allow(
    private_interfaces,
    clippy::too_many_arguments,
    clippy::vec_init_then_push
)]
impl<'a> ProcessGroupsFunnelsApi<'a> {
    /// Gets all funnels
    ///
    /// Calls `GET /nifi-api/process-groups/{id}/funnels`.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// Requires `Read - /process-groups/{uuid}`.
    pub async fn get_funnels(&self) -> Result<crate::v2_8_0::types::FunnelsEntity, NifiError> {
        let id = self.id;
        self.client
            .get(&format!("/process-groups/{id}/funnels"))
            .await
    }
    /// Creates a funnel
    ///
    /// Calls `POST /nifi-api/process-groups/{id}/funnels`.
    ///
    /// # Parameters
    /// - `body`: The funnel configuration details.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// Requires `Write - /process-groups/{uuid}`.
    pub async fn create_funnel(
        &self,
        body: &crate::v2_8_0::types::FunnelEntity,
    ) -> Result<crate::v2_8_0::types::FunnelEntity, NifiError> {
        let id = self.id;
        self.client
            .post(&format!("/process-groups/{id}/funnels"), body)
            .await
    }
}
pub struct ProcessGroupsInputPortsApi<'a> {
    pub(crate) client: &'a NifiClient,
    pub(crate) id: &'a str,
}
#[allow(
    private_interfaces,
    clippy::too_many_arguments,
    clippy::vec_init_then_push
)]
impl<'a> ProcessGroupsInputPortsApi<'a> {
    /// Gets all input ports
    ///
    /// Calls `GET /nifi-api/process-groups/{id}/input-ports`.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// Requires `Read - /process-groups/{uuid}`.
    pub async fn get_input_ports(
        &self,
    ) -> Result<crate::v2_8_0::types::InputPortsEntity, NifiError> {
        let id = self.id;
        self.client
            .get(&format!("/process-groups/{id}/input-ports"))
            .await
    }
    /// Creates an input port
    ///
    /// Calls `POST /nifi-api/process-groups/{id}/input-ports`.
    ///
    /// # Parameters
    /// - `body`: The input port configuration details.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// Requires `Write - /process-groups/{uuid}`.
    pub async fn create_input_port(
        &self,
        body: &crate::v2_8_0::types::PortEntity,
    ) -> Result<crate::v2_8_0::types::PortEntity, NifiError> {
        let id = self.id;
        self.client
            .post(&format!("/process-groups/{id}/input-ports"), body)
            .await
    }
}
pub struct ProcessGroupsLabelsApi<'a> {
    pub(crate) client: &'a NifiClient,
    pub(crate) id: &'a str,
}
#[allow(
    private_interfaces,
    clippy::too_many_arguments,
    clippy::vec_init_then_push
)]
impl<'a> ProcessGroupsLabelsApi<'a> {
    /// Gets all labels
    ///
    /// Calls `GET /nifi-api/process-groups/{id}/labels`.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// Requires `Read - /process-groups/{uuid}`.
    pub async fn get_labels(&self) -> Result<crate::v2_8_0::types::LabelsEntity, NifiError> {
        let id = self.id;
        self.client
            .get(&format!("/process-groups/{id}/labels"))
            .await
    }
    /// Creates a label
    ///
    /// Calls `POST /nifi-api/process-groups/{id}/labels`.
    ///
    /// # Parameters
    /// - `body`: The label configuration details.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// Requires `Write - /process-groups/{uuid}`.
    pub async fn create_label(
        &self,
        body: &crate::v2_8_0::types::LabelEntity,
    ) -> Result<crate::v2_8_0::types::LabelEntity, NifiError> {
        let id = self.id;
        self.client
            .post(&format!("/process-groups/{id}/labels"), body)
            .await
    }
}
pub struct ProcessGroupsLocalModificationsApi<'a> {
    pub(crate) client: &'a NifiClient,
    pub(crate) id: &'a str,
}
#[allow(
    private_interfaces,
    clippy::too_many_arguments,
    clippy::vec_init_then_push
)]
impl<'a> ProcessGroupsLocalModificationsApi<'a> {
    /// Gets a list of local modifications to the Process Group since it was last synchronized with the Flow Registry
    ///
    /// Calls `GET /nifi-api/process-groups/{id}/local-modifications`.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// - `Read - /process-groups/{uuid}`
    /// - `Read - /{component-type}/{uuid} - For all encapsulated components`
    pub async fn get_local_modifications(
        &self,
    ) -> Result<crate::v2_8_0::types::FlowComparisonEntity, NifiError> {
        let id = self.id;
        self.client
            .get(&format!("/process-groups/{id}/local-modifications"))
            .await
    }
}
pub struct ProcessGroupsOutputPortsApi<'a> {
    pub(crate) client: &'a NifiClient,
    pub(crate) id: &'a str,
}
#[allow(
    private_interfaces,
    clippy::too_many_arguments,
    clippy::vec_init_then_push
)]
impl<'a> ProcessGroupsOutputPortsApi<'a> {
    /// Gets all output ports
    ///
    /// Calls `GET /nifi-api/process-groups/{id}/output-ports`.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// Requires `Read - /process-groups/{uuid}`.
    pub async fn get_output_ports(
        &self,
    ) -> Result<crate::v2_8_0::types::OutputPortsEntity, NifiError> {
        let id = self.id;
        self.client
            .get(&format!("/process-groups/{id}/output-ports"))
            .await
    }
    /// Creates an output port
    ///
    /// Calls `POST /nifi-api/process-groups/{id}/output-ports`.
    ///
    /// # Parameters
    /// - `body`: The output port configuration.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// Requires `Write - /process-groups/{uuid}`.
    pub async fn create_output_port(
        &self,
        body: &crate::v2_8_0::types::PortEntity,
    ) -> Result<crate::v2_8_0::types::PortEntity, NifiError> {
        let id = self.id;
        self.client
            .post(&format!("/process-groups/{id}/output-ports"), body)
            .await
    }
}
pub struct ProcessGroupsPasteApi<'a> {
    pub(crate) client: &'a NifiClient,
    pub(crate) id: &'a str,
}
#[allow(
    private_interfaces,
    clippy::too_many_arguments,
    clippy::vec_init_then_push
)]
impl<'a> ProcessGroupsPasteApi<'a> {
    /// Pastes into the specified process group
    ///
    /// Calls `PUT /nifi-api/process-groups/{id}/paste`.
    ///
    /// # Parameters
    /// - `body`: The request including the components to be pasted into the specified Process Group.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// Requires `Write - /process-groups/{uuid}`.
    pub async fn paste(
        &self,
        body: &crate::v2_8_0::types::PasteRequestEntity,
    ) -> Result<crate::v2_8_0::types::PasteResponseEntity, NifiError> {
        let id = self.id;
        self.client
            .put(&format!("/process-groups/{id}/paste"), body)
            .await
    }
}
pub struct ProcessGroupsProcessGroupsApi<'a> {
    pub(crate) client: &'a NifiClient,
    pub(crate) id: &'a str,
}
#[allow(
    private_interfaces,
    clippy::too_many_arguments,
    clippy::vec_init_then_push
)]
impl<'a> ProcessGroupsProcessGroupsApi<'a> {
    /// Gets all process groups
    ///
    /// Calls `GET /nifi-api/process-groups/{id}/process-groups`.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// Requires `Read - /process-groups/{uuid}`.
    pub async fn get_process_groups(
        &self,
    ) -> Result<crate::v2_8_0::types::ProcessGroupsEntity, NifiError> {
        let id = self.id;
        self.client
            .get(&format!("/process-groups/{id}/process-groups"))
            .await
    }
    /// Creates a process group
    ///
    /// Calls `POST /nifi-api/process-groups/{id}/process-groups`.
    ///
    /// # Parameters
    /// - `parameter_context_handling_strategy`: Handling Strategy controls whether to keep or replace Parameter Contexts
    /// - `body`: The process group configuration details.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// Requires `Write - /process-groups/{uuid}`.
    pub async fn create_process_group(
        &self,
        parameter_context_handling_strategy: Option<
            crate::v2_8_0::types::ParameterContextHandlingStrategy,
        >,
        body: &crate::v2_8_0::types::ProcessGroupEntity,
    ) -> Result<crate::v2_8_0::types::ProcessGroupEntity, NifiError> {
        let id = self.id;
        let mut query: Vec<(&str, String)> = vec![];
        if let Some(v) = parameter_context_handling_strategy {
            query.push(("parameterContextHandlingStrategy", v.to_string()));
        }
        self.client
            .post_with_query(
                &format!("/process-groups/{id}/process-groups"),
                body,
                &query,
            )
            .await
    }
    /// Imports a specified process group
    ///
    /// Calls `POST /nifi-api/process-groups/{id}/process-groups/import`.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// Requires `Write - /process-groups/{uuid}`.
    pub async fn import_process_group(
        &self,
        body: &crate::v2_8_0::types::ProcessGroupUploadEntity,
    ) -> Result<crate::v2_8_0::types::ProcessGroupEntity, NifiError> {
        let id = self.id;
        self.client
            .post(&format!("/process-groups/{id}/process-groups/import"), body)
            .await
    }
    /// Uploads a versioned flow definition and creates a process group
    ///
    /// Calls `POST /nifi-api/process-groups/{id}/process-groups/upload`.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// Requires `Write - /process-groups/{uuid}`.
    pub async fn upload_process_group(
        &self,
    ) -> Result<crate::v2_8_0::types::ProcessGroupEntity, NifiError> {
        let id = self.id;
        self.client
            .post_no_body(&format!("/process-groups/{id}/process-groups/upload"))
            .await
    }
}
pub struct ProcessGroupsProcessorsApi<'a> {
    pub(crate) client: &'a NifiClient,
    pub(crate) id: &'a str,
}
#[allow(
    private_interfaces,
    clippy::too_many_arguments,
    clippy::vec_init_then_push
)]
impl<'a> ProcessGroupsProcessorsApi<'a> {
    /// Gets all processors
    ///
    /// Calls `GET /nifi-api/process-groups/{id}/processors`.
    ///
    /// # Parameters
    /// - `include_descendant_groups`: Whether or not to include processors from descendant process groups
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// Requires `Read - /process-groups/{uuid}`.
    pub async fn get_processors(
        &self,
        include_descendant_groups: Option<bool>,
    ) -> Result<crate::v2_8_0::types::ProcessorsEntity, NifiError> {
        let id = self.id;
        let mut query: Vec<(&str, String)> = vec![];
        if let Some(v) = include_descendant_groups {
            query.push(("includeDescendantGroups", v.to_string()));
        }
        self.client
            .get_with_query(&format!("/process-groups/{id}/processors"), &query)
            .await
    }
    /// Creates a new processor
    ///
    /// Calls `POST /nifi-api/process-groups/{id}/processors`.
    ///
    /// # Parameters
    /// - `body`: The processor configuration details.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// - `Write - /process-groups/{uuid}`
    /// - `Read - any referenced Controller Services - /controller-services/{uuid}`
    /// - `Write - if the Processor is restricted - /restricted-components`
    pub async fn create_processor(
        &self,
        body: &crate::v2_8_0::types::ProcessorEntity,
    ) -> Result<crate::v2_8_0::types::ProcessorEntity, NifiError> {
        let id = self.id;
        self.client
            .post(&format!("/process-groups/{id}/processors"), body)
            .await
    }
}
pub struct ProcessGroupsRemoteProcessGroupsApi<'a> {
    pub(crate) client: &'a NifiClient,
    pub(crate) id: &'a str,
}
#[allow(
    private_interfaces,
    clippy::too_many_arguments,
    clippy::vec_init_then_push
)]
impl<'a> ProcessGroupsRemoteProcessGroupsApi<'a> {
    /// Gets all remote process groups
    ///
    /// Calls `GET /nifi-api/process-groups/{id}/remote-process-groups`.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// Requires `Read - /process-groups/{uuid}`.
    pub async fn get_remote_process_groups(
        &self,
    ) -> Result<crate::v2_8_0::types::RemoteProcessGroupsEntity, NifiError> {
        let id = self.id;
        self.client
            .get(&format!("/process-groups/{id}/remote-process-groups"))
            .await
    }
    /// Creates a new process group
    ///
    /// Calls `POST /nifi-api/process-groups/{id}/remote-process-groups`.
    ///
    /// # Parameters
    /// - `body`: The remote process group configuration details.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// Requires `Write - /process-groups/{uuid}`.
    pub async fn create_remote_process_group(
        &self,
        body: &crate::v2_8_0::types::RemoteProcessGroupEntity,
    ) -> Result<crate::v2_8_0::types::RemoteProcessGroupEntity, NifiError> {
        let id = self.id;
        self.client
            .post(&format!("/process-groups/{id}/remote-process-groups"), body)
            .await
    }
}
pub struct ProcessGroupsReplaceRequestsApi<'a> {
    pub(crate) client: &'a NifiClient,
    pub(crate) id: &'a str,
}
#[allow(
    private_interfaces,
    clippy::too_many_arguments,
    clippy::vec_init_then_push
)]
impl<'a> ProcessGroupsReplaceRequestsApi<'a> {
    /// Initiate the Replace Request of a Process Group with the given ID
    ///
    /// This will initiate the action of replacing a process group with the given process group. This can be a lengthy process, as it will stop any Processors and disable any Controller Services necessary to perform the action and then restart them. As a result, the endpoint will immediately return a ProcessGroupReplaceRequestEntity, and the process of replacing the flow will occur asynchronously in the background. The client may then periodically poll the status of the request by issuing a GET request to /process-groups/replace-requests/{requestId}. Once the request is completed, the client is expected to issue a DELETE request to /process-groups/replace-requests/{requestId}. Note: This endpoint is subject to change as NiFi and it's REST API evolve.
    ///
    /// Calls `POST /nifi-api/process-groups/{id}/replace-requests`.
    ///
    /// # Parameters
    /// - `body`: The process group replace request entity
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// - `Read - /process-groups/{uuid}`
    /// - `Write - /process-groups/{uuid}`
    /// - `Read - /{component-type}/{uuid} - For all encapsulated components`
    /// - `Write - /{component-type}/{uuid} - For all encapsulated components`
    /// - `Write - if the snapshot contains any restricted components - /restricted-components`
    /// - `Read - /parameter-contexts/{uuid} - For any Parameter Context that is referenced by a Property that is changed, added, or removed`
    pub async fn initiate_replace_process_group(
        &self,
        body: &crate::v2_8_0::types::ProcessGroupImportEntity,
    ) -> Result<crate::v2_8_0::types::ProcessGroupReplaceRequestEntity, NifiError> {
        let id = self.id;
        self.client
            .post(&format!("/process-groups/{id}/replace-requests"), body)
            .await
    }
}
pub struct ProcessGroupsSnippetInstanceApi<'a> {
    pub(crate) client: &'a NifiClient,
    pub(crate) id: &'a str,
}
#[allow(
    private_interfaces,
    clippy::too_many_arguments,
    clippy::vec_init_then_push
)]
impl<'a> ProcessGroupsSnippetInstanceApi<'a> {
    /// Copies a snippet and discards it.
    ///
    /// Calls `POST /nifi-api/process-groups/{id}/snippet-instance`.
    ///
    /// # Parameters
    /// - `body`: The copy snippet request.
    ///
    /// # Errors
    /// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
    /// - `401`: Client could not be authenticated.
    /// - `403`: Client is not authorized to make this request.
    /// - `404`: The specified resource could not be found.
    /// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
    ///
    /// # Permissions
    /// - `Write - /process-groups/{uuid}`
    /// - `Read - /{component-type}/{uuid} - For each component in the snippet and their descendant components`
    /// - `Write - if the snippet contains any restricted Processors - /restricted-components`
    pub async fn copy_snippet(
        &self,
        body: &crate::v2_8_0::types::CopySnippetRequestEntity,
    ) -> Result<crate::v2_8_0::types::FlowDto, NifiError> {
        let id = self.id;
        let e: crate::v2_8_0::types::FlowEntity = self
            .client
            .post(&format!("/process-groups/{id}/snippet-instance"), body)
            .await?;
        Ok(e.flow)
    }
}