Skip to content

Commit

Permalink
Automated build 'Automated commit 'Merge pull request #1727 from sail…
Browse files Browse the repository at this point in the history
…point/fix/BulkTaggedObjects

Update response schema for setting tags to objects in bulk' by github action: 9778860320' python sdk: 9778867399
  • Loading branch information
developer-relations-sp committed Jul 3, 2024
1 parent 5b41bf5 commit 96b971d
Show file tree
Hide file tree
Showing 8 changed files with 199 additions and 7 deletions.
1 change: 1 addition & 0 deletions sailpoint/v3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions sailpoint/v3/api/tagged_objects_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
30 changes: 30 additions & 0 deletions sailpoint/v3/docs/BulkTaggedObjectResponse.md
Original file line number Diff line number Diff line change
@@ -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)


5 changes: 3 additions & 2 deletions sailpoint/v3/docs/TaggedObjectsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -685,7 +686,7 @@ Name | Type | Description | Notes

### Return type

[**BulkTaggedObject**](BulkTaggedObject.md)
[**List[BulkTaggedObjectResponse]**](BulkTaggedObjectResponse.md)

### Authorization

Expand Down
1 change: 1 addition & 0 deletions sailpoint/v3/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
99 changes: 99 additions & 0 deletions sailpoint/v3/models/bulk_tagged_object_response.py
Original file line number Diff line number Diff line change
@@ -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


58 changes: 58 additions & 0 deletions sailpoint/v3/test/test_bulk_tagged_object_response.py
Original file line number Diff line number Diff line change
@@ -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()
1 change: 1 addition & 0 deletions sailpoint/v3_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 96b971d

Please sign in to comment.