msfabricpysdkcore 0.2.3__py3-none-any.whl → 0.2.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -502,7 +502,121 @@ class FabricClientAdmin(FabricClient):
502
502
  error_message = "Error setting labels", return_format="json")
503
503
 
504
504
  return response_json
505
+
506
+ # POST https://api.fabric.microsoft.com/v1/admin/items/bulkRemoveSharingLinks
507
+ def bulk_remove_sharing_links(self, items, sharing_link_type):
508
+ """Remove sharing links in bulk
509
+ Args:
510
+ items (list): The list of item IDs
511
+ sharing_link_type (str): The type of the sharing link
512
+ Returns:
513
+ Response: The response from the API
514
+ """
515
+ url = "https://api.fabric.microsoft.com/v1/admin/items/bulkRemoveSharingLinks"
516
+
517
+ if len(items) > 500:
518
+ self.bulk_remove_sharing_links(items = items[500:], sharing_link_type = sharing_link_type)
519
+ items = items[:500]
520
+
521
+ body = {
522
+ "items": items,
523
+ "sharingLinkType": sharing_link_type
524
+ }
525
+
526
+ response = self.calling_routine(url = url, operation = "POST", body = body, response_codes = [200, 202, 429],
527
+ error_message = "Error removing sharing links", return_format="response")
528
+
529
+ return response
530
+
531
+ # POST https://api.fabric.microsoft.com/v1/admin/items/removeAllSharingLinks
532
+ def remove_all_sharing_links(self, sharing_link_type):
533
+ """Remove all sharing links
534
+ Args:
535
+ sharing_link_type (str): The type of the sharing link
536
+ Returns:
537
+ Response: The response from the API
538
+ """
539
+ url = "https://api.fabric.microsoft.com/v1/admin/items/removeAllSharingLinks"
540
+
541
+ body = {
542
+ "sharingLinkType": sharing_link_type
543
+ }
544
+
545
+ response= self.calling_routine(url = url, operation = "POST", body = body, response_codes = [200, 202, 429],
546
+ error_message = "Error removing all sharing links", return_format="response")
547
+
548
+ return response
549
+
550
+ # Tags APIs
551
+
552
+ #POST https://api.fabric.microsoft.com/v1/admin/tags/bulkCreateTags
553
+ def bulk_create_tags(self, create_tags_request):
554
+ """Create tags in bulk
555
+ Args:
556
+ create_tags_request (list): The request body
557
+ Returns:
558
+ dict: The response from the API
559
+ """
560
+ url = "https://api.fabric.microsoft.com/v1/admin/tags/bulkCreateTags"
561
+
562
+ body = {
563
+ "createTagsRequest": create_tags_request
564
+ }
565
+
566
+ response_json: dict = self.calling_routine(url = url, operation = "POST", body = body,
567
+ response_codes = [201, 429], error_message = "Error creating tags",
568
+ return_format="json")
505
569
 
570
+ return response_json
571
+
572
+ # DELETE https://api.fabric.microsoft.com/v1/admin/tags/{tagId}
573
+ def delete_tag(self, tag_id):
574
+ """Delete a tag
575
+ Args:
576
+ tag_id (str): The ID of the tag
577
+ Returns:
578
+ int: The status code of the response
579
+ """
580
+ url = f"https://api.fabric.microsoft.com/v1/admin/tags/{tag_id}"
581
+
582
+ response:requests.Response = self.calling_routine(url = url, operation = "DELETE", response_codes = [200, 429],
583
+ error_message = "Error deleting tag", return_format="response")
584
+
585
+ return response.status_code
586
+
587
+ # GET https://api.fabric.microsoft.com/v1/admin/tags
588
+ def list_tags(self):
589
+ """List all tags
590
+ Returns:
591
+ list: The list of tags
592
+ """
593
+ url = "https://api.fabric.microsoft.com/v1/admin/tags"
594
+
595
+ items: list = self.calling_routine(url = url, operation = "GET", response_codes = [200, 429],
596
+ error_message = "Error listing tags", return_format="value_json", paging=True)
597
+
598
+ return items
599
+
600
+ # PATCH https://api.fabric.microsoft.com/v1/admin/tags/{tagId}
601
+ def update_tag(self, tag_id, display_name = None):
602
+ """Update a tag
603
+ Args:
604
+ tag_id (str): The ID of the tag
605
+ display_name (str): The display name of the tag
606
+ Returns:
607
+ dict: The response from the API
608
+ """
609
+ url = f"https://api.fabric.microsoft.com/v1/admin/tags/{tag_id}"
610
+ body = {}
611
+ if display_name:
612
+ body["displayName"] = display_name
613
+
614
+ response_json: dict = self.calling_routine(url = url, operation = "PATCH", body = body, response_codes = [200, 429],
615
+ error_message = "Error updating tag", return_format="json")
616
+
617
+ return response_json
618
+
619
+
506
620
  # Tenant Settings APIs
507
621
 
508
622
  # DELETE https://api.fabric.microsoft.com/v1/admin/capacities/{capacityId}/delegatedTenantSettingOverrides/{tenantSettingName}