Skip to content

Commit 788762a

Browse files
Somchavanpadamstx
andauthored
fix(IAM Identity): re-gen with latest API definition (#190)
* user mfa API Signed-off-by: Somanath Chavan <[email protected]> * iam identity user mfa Signed-off-by: Somanath Chavan <[email protected]> * build: pin older versions of pylint and black Signed-off-by: Phil Adams <[email protected]> --------- Signed-off-by: Somanath Chavan <[email protected]> Signed-off-by: Phil Adams <[email protected]> Co-authored-by: Phil Adams <[email protected]>
1 parent 2f6b2a1 commit 788762a

File tree

5 files changed

+1755
-99
lines changed

5 files changed

+1755
-99
lines changed

examples/test_iam_identity_v1_examples.py

Lines changed: 72 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@
6767

6868
account_settings_etag = None
6969

70+
report_reference_mfa = None
71+
72+
iam_id_member = None
73+
7074

7175
##############################################################################
7276
# Start of Examples for Service: IamIdentityV1
@@ -100,6 +104,9 @@ def setup_class(cls):
100104
global iam_id
101105
iam_id = config['IAM_ID']
102106

107+
global iam_id_member
108+
iam_id_member = config['IAM_ID_MEMBER']
109+
103110
global apikey
104111
apikey = config['APIKEY']
105112

@@ -789,7 +796,7 @@ def test_update_account_settings_example(self):
789796
# begin-updateAccountSettings
790797

791798
account_settings_user_mfa = {}
792-
account_settings_user_mfa['iam_id'] = self.iam_id_member
799+
account_settings_user_mfa['iam_id'] = iam_id_member
793800
account_settings_user_mfa['mfa'] = 'NONE'
794801

795802
account_settings_response = iam_identity_service.update_account_settings(
@@ -803,7 +810,7 @@ def test_update_account_settings_example(self):
803810
session_invalidation_in_seconds="7200",
804811
max_sessions_per_identity='10',
805812
system_access_token_expiration_in_seconds='3600',
806-
system_refresh_token_expiration_in_seconds='2592000',
813+
system_refresh_token_expiration_in_seconds='259200',
807814
).get_result()
808815

809816
print(json.dumps(account_settings_response, indent=2))
@@ -845,8 +852,7 @@ def test_get_report(self):
845852
# begin-get_report
846853

847854
get_report_response = iam_identity_service.get_report(
848-
account_id=account_id,
849-
type="latest",
855+
account_id=account_id, reference="latest"
850856
).get_result()
851857

852858
print(json.dumps(get_report_response, indent=2))
@@ -856,6 +862,68 @@ def test_get_report(self):
856862
except ApiException as e:
857863
pytest.fail(str(e))
858864

865+
@needscredentials
866+
def test_create_mfa_report(self):
867+
"""
868+
create_mfa_report request example
869+
"""
870+
try:
871+
global report_reference_mfa
872+
print('\ncreate_mfa_report() result:')
873+
# begin-create_mfa_report
874+
875+
create_report_response = iam_identity_service.create_mfa_report(
876+
account_id=account_id, type="mfa_status"
877+
).get_result()
878+
879+
print(json.dumps(create_report_response, indent=2))
880+
report_reference_mfa = create_report_response['reference']
881+
882+
# end-create_mfa_report
883+
884+
except ApiException as e:
885+
pytest.fail(str(e))
886+
887+
@needscredentials
888+
def test_get_mfa_report(self):
889+
"""
890+
get_mfa_report request example
891+
"""
892+
try:
893+
print('\nget_mfa_report() result:')
894+
# begin-get_mfa_report
895+
896+
get_report_response = iam_identity_service.get_mfa_report(
897+
account_id=account_id, reference=report_reference_mfa
898+
).get_result()
899+
900+
print(json.dumps(get_report_response, indent=2))
901+
902+
# end-get_mfa_report
903+
904+
except ApiException as e:
905+
pytest.fail(str(e))
906+
907+
@needscredentials
908+
def test_get_mfa_status(self):
909+
"""
910+
get_mfa_status request example
911+
"""
912+
try:
913+
print('\nget_mfa_status() result:')
914+
# begin-get_mfa_status
915+
916+
get_mfa_status_response = iam_identity_service.get_mfa_status(
917+
account_id=account_id, iam_id=iam_id
918+
).get_result()
919+
920+
print(json.dumps(get_mfa_status_response, indent=2))
921+
922+
# end-get_mfa_status
923+
924+
except ApiException as e:
925+
pytest.fail(str(e))
926+
859927

860928
# endregion
861929
##############################################################################

0 commit comments

Comments
 (0)