|
38 | 38 | # IAM_IDENTITY_IAM_ID_MEMBER=<IAM ID of a user belonging to the account but different to the one above>
|
39 | 39 | # IAM_IDENTITY_ENTERPRISE_ACCOUNT_ID=<AccountID of the enterprise account>
|
40 | 40 | # IAM_IDENTITY_ENTERPRISE_SUBACCOUNT_ID=<AccountID of an account in the enterprise>
|
| 41 | +# IAM_IDENTITY_IAM_ID_FOR_PREFERENCES=<IAM id of the profile to set preferences> |
41 | 42 | #
|
42 | 43 | # These configuration properties can be exported as environment variables, or stored
|
43 | 44 | # in a configuration file and then:
|
|
51 | 52 |
|
52 | 53 | apikey_name = 'Example-ApiKey'
|
53 | 54 | serviceid_name = 'Example-ServiceId'
|
| 55 | +service = 'console' |
| 56 | +value_string = '/billing' |
| 57 | +preference_id1 = 'landing_page' |
54 | 58 |
|
55 | 59 | # config property values
|
56 | 60 | account_id = None
|
|
91 | 95 | account_settings_template_assignment_id = None
|
92 | 96 | account_settings_template_assignment_etag = None
|
93 | 97 |
|
| 98 | +iam_id_for_preferences = None |
| 99 | + |
94 | 100 |
|
95 | 101 | ##############################################################################
|
96 | 102 | # Start of Examples for Service: IamIdentityV1
|
@@ -136,6 +142,9 @@ def setup_class(cls):
|
136 | 142 | global enterprise_subaccount_id
|
137 | 143 | enterprise_subaccount_id = config['ENTERPRISE_SUBACCOUNT_ID']
|
138 | 144 |
|
| 145 | + global iam_id_for_preferences |
| 146 | + iam_id_for_preferences = config['IAM_ID_FOR_PREFERENCES'] |
| 147 | + |
139 | 148 | print('Setup complete.')
|
140 | 149 |
|
141 | 150 | needscredentials = pytest.mark.skipif(
|
@@ -1775,6 +1784,82 @@ def test_delete_account_settings_template(self):
|
1775 | 1784 | except ApiException as e:
|
1776 | 1785 | pytest.fail(str(e))
|
1777 | 1786 |
|
| 1787 | + @needscredentials |
| 1788 | + def test_update_preference_on_scope_account(self): |
| 1789 | + """ |
| 1790 | + update_preference_on_scope_account request example |
| 1791 | + """ |
| 1792 | + try: |
| 1793 | + print('\nupdate_preference_on_scope_account() result:') |
| 1794 | + # begin-update_preference_on_scope_account |
| 1795 | + |
| 1796 | + preference = iam_identity_service.update_preference_on_scope_account( |
| 1797 | + iam_id=iam_id_for_preferences, service=service, preference_id=preference_id1, value_string=value_string |
| 1798 | + ).get_result() |
| 1799 | + print(json.dumps(preference, indent=2)) |
| 1800 | + |
| 1801 | + # end-update_preference_on_scope_account |
| 1802 | + |
| 1803 | + except ApiException as e: |
| 1804 | + pytest.fail(str(e)) |
| 1805 | + |
| 1806 | + @needscredentials |
| 1807 | + def test_get_preferences_on_scope_account(self): |
| 1808 | + """ |
| 1809 | + get_preferences_on_scope_account request example |
| 1810 | + """ |
| 1811 | + try: |
| 1812 | + print('\nget_preferences_on_scope_account() result:') |
| 1813 | + # begin-get_preferences_on_scope_account |
| 1814 | + |
| 1815 | + preference = iam_identity_service.get_preferences_on_scope_account( |
| 1816 | + iam_id=iam_id_for_preferences, service=service, preference_id=preference_id1 |
| 1817 | + ).get_result() |
| 1818 | + print(json.dumps(preference, indent=2)) |
| 1819 | + |
| 1820 | + # end-get_preferences_on_scope_account |
| 1821 | + |
| 1822 | + except ApiException as e: |
| 1823 | + pytest.fail(str(e)) |
| 1824 | + |
| 1825 | + @needscredentials |
| 1826 | + def test_get_all_preferences_on_scope_account(self): |
| 1827 | + """ |
| 1828 | + get_all_preferences_on_scope_account request example |
| 1829 | + """ |
| 1830 | + try: |
| 1831 | + print('\nget_all_preferences_on_scope_account() result:') |
| 1832 | + # begin-get_all_preferences_on_scope_account |
| 1833 | + |
| 1834 | + preference = iam_identity_service.get_all_preferences_on_scope_account( |
| 1835 | + iam_id=iam_id_for_preferences |
| 1836 | + ).get_result() |
| 1837 | + print(json.dumps(preference, indent=2)) |
| 1838 | + |
| 1839 | + # end-get_all_preferences_on_scope_account |
| 1840 | + |
| 1841 | + except ApiException as e: |
| 1842 | + pytest.fail(str(e)) |
| 1843 | + |
| 1844 | + @needscredentials |
| 1845 | + def test_delete_preferences_on_scope_account(self): |
| 1846 | + """ |
| 1847 | + delete_preferences_on_scope_account request example |
| 1848 | + """ |
| 1849 | + try: |
| 1850 | + # begin-delete_preferences_on_scope_account |
| 1851 | + |
| 1852 | + response = iam_identity_service.delete_preferences_on_scope_account( |
| 1853 | + iam_id=iam_id_for_preferences, service=service, preference_id=preference_id1 |
| 1854 | + ) |
| 1855 | + |
| 1856 | + # end-delete_preferences_on_scope_account |
| 1857 | + |
| 1858 | + print('\ndelete_preferences_on_scope_account() response status code: ', response.get_status_code()) |
| 1859 | + |
| 1860 | + except ApiException as e: |
| 1861 | + pytest.fail(str(e)) |
| 1862 | + |
1778 | 1863 |
|
1779 | 1864 | # endregion
|
1780 | 1865 | ##############################################################################
|
|
0 commit comments