Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 33 additions & 11 deletions ibm_platform_services/iam_identity_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-e6cfc86e-20210308-084627
# IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-46891d34-20210426-162952

"""
The IAM Identity Service API allows for the management of Account Settings and Identities
Expand Down Expand Up @@ -418,10 +418,9 @@ def delete_api_key(self,
"""
Deletes an API key.

Deletes an API key. Existing tokens will remain valid until expired. Refresh
tokens will not work any more for this API key. Users can manage user API keys
for themself, or service ID API keys for service IDs that are bound to an entity
they have access to.
Deletes an API key. Existing tokens will remain valid until expired. Users can
manage user API keys for themself, or service ID API keys for service IDs that
are bound to an entity they have access to.

:param str id: Unique ID of the API key.
:param dict headers: A `dict` containing the request headers
Expand Down Expand Up @@ -995,6 +994,7 @@ def update_account_settings(self,
mfa: str = None,
session_expiration_in_seconds: str = None,
session_invalidation_in_seconds: str = None,
max_sessions_per_identity: str = None,
**kwargs
) -> DetailedResponse:
"""
Expand All @@ -1016,7 +1016,7 @@ def update_account_settings(self,
* NOT_RESTRICTED - to remove access control
* NOT_SET - to unset a previously set value.
:param str restrict_create_platform_apikey: (optional) Defines whether or
not creating a Service Id is access controlled. Valid values:
not creating platform API keys is access controlled. Valid values:
* RESTRICTED - to apply access control
* NOT_RESTRICTED - to remove access control
* NOT_SET - to 'unset' a previous set value.
Expand All @@ -1039,6 +1039,10 @@ def update_account_settings(self,
inactivity. Valid values:
* Any whole number between '900' and '7200'
* NOT_SET - To unset account setting and use service default.
:param str max_sessions_per_identity: (optional) Defines the max allowed
sessions per identity required by the account. Value values:
* Any whole number greater than 0
* NOT_SET - To unset account setting and use service default.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse with `dict` result representing a `AccountSettingsResponse` object
Expand All @@ -1062,7 +1066,8 @@ def update_account_settings(self,
'allowed_ip_addresses': allowed_ip_addresses,
'mfa': mfa,
'session_expiration_in_seconds': session_expiration_in_seconds,
'session_invalidation_in_seconds': session_invalidation_in_seconds
'session_invalidation_in_seconds': session_invalidation_in_seconds,
'max_sessions_per_identity': max_sessions_per_identity
}
data = {k: v for (k, v) in data.items() if v is not None}
data = json.dumps(data)
Expand Down Expand Up @@ -1142,8 +1147,8 @@ class AccountSettingsResponse():
* RESTRICTED - to apply access control
* NOT_RESTRICTED - to remove access control
* NOT_SET - to 'unset' a previous set value.
:attr str restrict_create_platform_apikey: Defines whether or not creating a
Service Id is access controlled. Valid values:
:attr str restrict_create_platform_apikey: Defines whether or not creating
platform API keys is access controlled. Valid values:
* RESTRICTED - to apply access control
* NOT_RESTRICTED - to remove access control
* NOT_SET - to 'unset' a previous set value.
Expand All @@ -1167,6 +1172,10 @@ class AccountSettingsResponse():
in which a session will be invalidated due to inactivity. Valid values:
* Any whole number between '900' and '7200'
* NOT_SET - To unset account setting and use service default.
:attr str max_sessions_per_identity: Defines the max allowed sessions per
identity required by the account. Valid values:
* Any whole number greater than 0
* NOT_SET - To unset account setting and use service default.
"""

def __init__(self,
Expand All @@ -1178,6 +1187,7 @@ def __init__(self,
mfa: str,
session_expiration_in_seconds: str,
session_invalidation_in_seconds: str,
max_sessions_per_identity: str,
*,
context: 'ResponseContext' = None,
history: List['EnityHistoryRecord'] = None) -> None:
Expand All @@ -1191,7 +1201,7 @@ def __init__(self,
* NOT_RESTRICTED - to remove access control
* NOT_SET - to 'unset' a previous set value.
:param str restrict_create_platform_apikey: Defines whether or not creating
a Service Id is access controlled. Valid values:
platform API keys is access controlled. Valid values:
* RESTRICTED - to apply access control
* NOT_RESTRICTED - to remove access control
* NOT_SET - to 'unset' a previous set value.
Expand All @@ -1214,6 +1224,10 @@ def __init__(self,
values:
* Any whole number between '900' and '7200'
* NOT_SET - To unset account setting and use service default.
:param str max_sessions_per_identity: Defines the max allowed sessions per
identity required by the account. Valid values:
* Any whole number greater than 0
* NOT_SET - To unset account setting and use service default.
:param ResponseContext context: (optional) Context with key properties for
problem determination.
:param List[EnityHistoryRecord] history: (optional) History of the Account
Expand All @@ -1229,6 +1243,7 @@ def __init__(self,
self.history = history
self.session_expiration_in_seconds = session_expiration_in_seconds
self.session_invalidation_in_seconds = session_invalidation_in_seconds
self.max_sessions_per_identity = max_sessions_per_identity

@classmethod
def from_dict(cls, _dict: Dict) -> 'AccountSettingsResponse':
Expand Down Expand Up @@ -1270,6 +1285,10 @@ def from_dict(cls, _dict: Dict) -> 'AccountSettingsResponse':
args['session_invalidation_in_seconds'] = _dict.get('session_invalidation_in_seconds')
else:
raise ValueError('Required property \'session_invalidation_in_seconds\' not present in AccountSettingsResponse JSON')
if 'max_sessions_per_identity' in _dict:
args['max_sessions_per_identity'] = _dict.get('max_sessions_per_identity')
else:
raise ValueError('Required property \'max_sessions_per_identity\' not present in AccountSettingsResponse JSON')
return cls(**args)

@classmethod
Expand Down Expand Up @@ -1300,6 +1319,8 @@ def to_dict(self) -> Dict:
_dict['session_expiration_in_seconds'] = self.session_expiration_in_seconds
if hasattr(self, 'session_invalidation_in_seconds') and self.session_invalidation_in_seconds is not None:
_dict['session_invalidation_in_seconds'] = self.session_invalidation_in_seconds
if hasattr(self, 'max_sessions_per_identity') and self.max_sessions_per_identity is not None:
_dict['max_sessions_per_identity'] = self.max_sessions_per_identity
return _dict

def _to_dict(self):
Expand Down Expand Up @@ -1334,7 +1355,8 @@ class RestrictCreateServiceIdEnum(str, Enum):

class RestrictCreatePlatformApikeyEnum(str, Enum):
"""
Defines whether or not creating a Service Id is access controlled. Valid values:
Defines whether or not creating platform API keys is access controlled. Valid
values:
* RESTRICTED - to apply access control
* NOT_RESTRICTED - to remove access control
* NOT_SET - to 'unset' a previous set value.
Expand Down
3 changes: 2 additions & 1 deletion test/integration/test_iam_identity_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,8 @@ def test_update_account_settings(self):
# allowed_ip_addresses='testString',
mfa='NONE',
session_expiration_in_seconds="86400",
session_invalidation_in_seconds="7200"
session_invalidation_in_seconds="7200",
max_sessions_per_identity='10',
)

assert update_account_settings_response.get_status_code() == 200
Expand Down
Loading