From 96b971d3b61ec675c4f387e2a245b3261c1970e8 Mon Sep 17 00:00:00 2001 From: GitHub Action Bot Date: Wed, 3 Jul 2024 13:34:14 +0000 Subject: [PATCH] Automated build 'Automated commit 'Merge pull request #1727 from sailpoint/fix/BulkTaggedObjects Update response schema for setting tags to objects in bulk' by github action: 9778860320' python sdk: 9778867399 --- sailpoint/v3/__init__.py | 1 + sailpoint/v3/api/tagged_objects_api.py | 11 ++- sailpoint/v3/docs/BulkTaggedObjectResponse.md | 30 ++++++ sailpoint/v3/docs/TaggedObjectsApi.md | 5 +- sailpoint/v3/models/__init__.py | 1 + .../v3/models/bulk_tagged_object_response.py | 99 +++++++++++++++++++ .../test/test_bulk_tagged_object_response.py | 58 +++++++++++ sailpoint/v3_README.md | 1 + 8 files changed, 199 insertions(+), 7 deletions(-) create mode 100644 sailpoint/v3/docs/BulkTaggedObjectResponse.md create mode 100644 sailpoint/v3/models/bulk_tagged_object_response.py create mode 100644 sailpoint/v3/test/test_bulk_tagged_object_response.py diff --git a/sailpoint/v3/__init__.py b/sailpoint/v3/__init__.py index 283b7f4b7..51d5ce556 100644 --- a/sailpoint/v3/__init__.py +++ b/sailpoint/v3/__init__.py @@ -171,6 +171,7 @@ from sailpoint.v3.models.bucket_aggregation import BucketAggregation from sailpoint.v3.models.bucket_type import BucketType from sailpoint.v3.models.bulk_tagged_object import BulkTaggedObject +from sailpoint.v3.models.bulk_tagged_object_response import BulkTaggedObjectResponse from sailpoint.v3.models.campaign import Campaign from sailpoint.v3.models.campaign_alert import CampaignAlert from sailpoint.v3.models.campaign_all_of_filter import CampaignAllOfFilter diff --git a/sailpoint/v3/api/tagged_objects_api.py b/sailpoint/v3/api/tagged_objects_api.py index 73d1ae8ce..549ce72ac 100644 --- a/sailpoint/v3/api/tagged_objects_api.py +++ b/sailpoint/v3/api/tagged_objects_api.py @@ -30,6 +30,7 @@ from typing import List, Optional from sailpoint.v3.models.bulk_tagged_object import BulkTaggedObject +from sailpoint.v3.models.bulk_tagged_object_response import BulkTaggedObjectResponse from sailpoint.v3.models.tagged_object import TaggedObject from sailpoint.v3.api_client import ApiClient @@ -2204,7 +2205,7 @@ def set_tags_to_many_objects( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BulkTaggedObject: + ) -> List[BulkTaggedObjectResponse]: """Tag Multiple Objects This API adds tags to multiple objects. A token with API, CERT_ADMIN, ORG_ADMIN, REPORT_ADMIN, ROLE_ADMIN, ROLE_SUBADMIN, SOURCE_ADMIN, or SOURCE_SUBADMIN authority is required to call this API. @@ -2242,7 +2243,7 @@ def set_tags_to_many_objects( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BulkTaggedObject", + '200': "List[BulkTaggedObjectResponse]", '400': "ErrorResponseDto", '401': "ListAccessProfiles401Response", '403': "ErrorResponseDto", @@ -2276,7 +2277,7 @@ def set_tags_to_many_objects_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BulkTaggedObject]: + ) -> ApiResponse[List[BulkTaggedObjectResponse]]: """Tag Multiple Objects This API adds tags to multiple objects. A token with API, CERT_ADMIN, ORG_ADMIN, REPORT_ADMIN, ROLE_ADMIN, ROLE_SUBADMIN, SOURCE_ADMIN, or SOURCE_SUBADMIN authority is required to call this API. @@ -2314,7 +2315,7 @@ def set_tags_to_many_objects_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BulkTaggedObject", + '200': "List[BulkTaggedObjectResponse]", '400': "ErrorResponseDto", '401': "ListAccessProfiles401Response", '403': "ErrorResponseDto", @@ -2386,7 +2387,7 @@ def set_tags_to_many_objects_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BulkTaggedObject", + '200': "List[BulkTaggedObjectResponse]", '400': "ErrorResponseDto", '401': "ListAccessProfiles401Response", '403': "ErrorResponseDto", diff --git a/sailpoint/v3/docs/BulkTaggedObjectResponse.md b/sailpoint/v3/docs/BulkTaggedObjectResponse.md new file mode 100644 index 000000000..b2ecf4918 --- /dev/null +++ b/sailpoint/v3/docs/BulkTaggedObjectResponse.md @@ -0,0 +1,30 @@ +# BulkTaggedObjectResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**object_refs** | [**List[TaggedObjectDto]**](TaggedObjectDto.md) | | [optional] +**tags** | **List[str]** | Label to be applied to an Object | [optional] + +## Example + +```python +from sailpoint.v3.models.bulk_tagged_object_response import BulkTaggedObjectResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of BulkTaggedObjectResponse from a JSON string +bulk_tagged_object_response_instance = BulkTaggedObjectResponse.from_json(json) +# print the JSON string representation of the object +print BulkTaggedObjectResponse.to_json() + +# convert the object into a dict +bulk_tagged_object_response_dict = bulk_tagged_object_response_instance.to_dict() +# create an instance of BulkTaggedObjectResponse from a dict +bulk_tagged_object_response_form_dict = bulk_tagged_object_response.from_dict(bulk_tagged_object_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sailpoint/v3/docs/TaggedObjectsApi.md b/sailpoint/v3/docs/TaggedObjectsApi.md index 306c7971d..41a2f5f9c 100644 --- a/sailpoint/v3/docs/TaggedObjectsApi.md +++ b/sailpoint/v3/docs/TaggedObjectsApi.md @@ -625,7 +625,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **set_tags_to_many_objects** -> BulkTaggedObject set_tags_to_many_objects(bulk_tagged_object) +> List[BulkTaggedObjectResponse] set_tags_to_many_objects(bulk_tagged_object) Tag Multiple Objects @@ -641,6 +641,7 @@ import time import os import sailpoint.v3 from sailpoint.v3.models.bulk_tagged_object import BulkTaggedObject +from sailpoint.v3.models.bulk_tagged_object_response import BulkTaggedObjectResponse from sailpoint.v3.rest import ApiException from pprint import pprint @@ -685,7 +686,7 @@ Name | Type | Description | Notes ### Return type -[**BulkTaggedObject**](BulkTaggedObject.md) +[**List[BulkTaggedObjectResponse]**](BulkTaggedObjectResponse.md) ### Authorization diff --git a/sailpoint/v3/models/__init__.py b/sailpoint/v3/models/__init__.py index c2d1f612d..6a6c72a9e 100644 --- a/sailpoint/v3/models/__init__.py +++ b/sailpoint/v3/models/__init__.py @@ -108,6 +108,7 @@ from sailpoint.v3.models.bucket_aggregation import BucketAggregation from sailpoint.v3.models.bucket_type import BucketType from sailpoint.v3.models.bulk_tagged_object import BulkTaggedObject +from sailpoint.v3.models.bulk_tagged_object_response import BulkTaggedObjectResponse from sailpoint.v3.models.campaign import Campaign from sailpoint.v3.models.campaign_alert import CampaignAlert from sailpoint.v3.models.campaign_all_of_filter import CampaignAllOfFilter diff --git a/sailpoint/v3/models/bulk_tagged_object_response.py b/sailpoint/v3/models/bulk_tagged_object_response.py new file mode 100644 index 000000000..6600d25d3 --- /dev/null +++ b/sailpoint/v3/models/bulk_tagged_object_response.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Identity Security Cloud V3 API + + Use these APIs to interact with the Identity Security Cloud platform to achieve repeatable, automated processes with greater scalability. We encourage you to join the SailPoint Developer Community forum at https://developer.sailpoint.com/discuss to connect with other developers using our APIs. + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictStr +from pydantic import Field +from sailpoint.v3.models.tagged_object_dto import TaggedObjectDto +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class BulkTaggedObjectResponse(BaseModel): + """ + BulkTaggedObjectResponse + """ # noqa: E501 + object_refs: Optional[List[TaggedObjectDto]] = Field(default=None, alias="objectRefs") + tags: Optional[List[StrictStr]] = Field(default=None, description="Label to be applied to an Object") + __properties: ClassVar[List[str]] = ["objectRefs", "tags"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of BulkTaggedObjectResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in object_refs (list) + _items = [] + if self.object_refs: + for _item in self.object_refs: + if _item: + _items.append(_item.to_dict()) + _dict['objectRefs'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of BulkTaggedObjectResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "objectRefs": [TaggedObjectDto.from_dict(_item) for _item in obj.get("objectRefs")] if obj.get("objectRefs") is not None else None, + "tags": obj.get("tags") + }) + return _obj + + diff --git a/sailpoint/v3/test/test_bulk_tagged_object_response.py b/sailpoint/v3/test/test_bulk_tagged_object_response.py new file mode 100644 index 000000000..55a22ee60 --- /dev/null +++ b/sailpoint/v3/test/test_bulk_tagged_object_response.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Identity Security Cloud V3 API + + Use these APIs to interact with the Identity Security Cloud platform to achieve repeatable, automated processes with greater scalability. We encourage you to join the SailPoint Developer Community forum at https://developer.sailpoint.com/discuss to connect with other developers using our APIs. + + The version of the OpenAPI document: 3.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from sailpoint.v3.models.bulk_tagged_object_response import BulkTaggedObjectResponse + +class TestBulkTaggedObjectResponse(unittest.TestCase): + """BulkTaggedObjectResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BulkTaggedObjectResponse: + """Test BulkTaggedObjectResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BulkTaggedObjectResponse` + """ + model = BulkTaggedObjectResponse() + if include_optional: + return BulkTaggedObjectResponse( + object_refs = [ + sailpoint.v3.models.tagged_object_dto.TaggedObjectDto( + type = 'IDENTITY', + id = '2c91808568c529c60168cca6f90c1313', + name = 'William Wilson', ) + ], + tags = [BU_FINANCE, PCI] + ) + else: + return BulkTaggedObjectResponse( + ) + """ + + def testBulkTaggedObjectResponse(self): + """Test BulkTaggedObjectResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/sailpoint/v3_README.md b/sailpoint/v3_README.md index 7adc325d7..5fec362b6 100644 --- a/sailpoint/v3_README.md +++ b/sailpoint/v3_README.md @@ -515,6 +515,7 @@ Class | Method | HTTP request | Description - [BucketAggregation](sailpoint/v3/docs/BucketAggregation.md) - [BucketType](sailpoint/v3/docs/BucketType.md) - [BulkTaggedObject](sailpoint/v3/docs/BulkTaggedObject.md) + - [BulkTaggedObjectResponse](sailpoint/v3/docs/BulkTaggedObjectResponse.md) - [Campaign](sailpoint/v3/docs/Campaign.md) - [CampaignAlert](sailpoint/v3/docs/CampaignAlert.md) - [CampaignAllOfFilter](sailpoint/v3/docs/CampaignAllOfFilter.md)