|
| 1 | +# -------------------------------------------------------------------------------------------- |
| 2 | +# Copyright (c) Microsoft Corporation. All rights reserved. |
| 3 | +# Licensed under the MIT License. See License.txt in the project root for license information. |
| 4 | +# -------------------------------------------------------------------------------------------- |
| 5 | +# Generated file, DO NOT EDIT |
| 6 | +# Changes may cause incorrect behavior and will be lost if the code is regenerated. |
| 7 | +# -------------------------------------------------------------------------------------------- |
| 8 | + |
| 9 | +from msrest import Serializer, Deserializer |
| 10 | +from ...vss_client import VssClient |
| 11 | + |
| 12 | + |
| 13 | +class SettingsClient(VssClient): |
| 14 | + """Settings |
| 15 | + :param str base_url: Service URL |
| 16 | + :param Authentication creds: Authenticated credentials. |
| 17 | + """ |
| 18 | + |
| 19 | + def __init__(self, base_url=None, creds=None): |
| 20 | + super(SettingsClient, self).__init__(base_url, creds) |
| 21 | + self._serialize = Serializer() |
| 22 | + self._deserialize = Deserializer() |
| 23 | + |
| 24 | + resource_area_identifier = None |
| 25 | + |
| 26 | + def get_entries(self, user_scope, key=None): |
| 27 | + """GetEntries. |
| 28 | + [Preview API] Get all setting entries for the given user/all-users scope |
| 29 | + :param str user_scope: User-Scope at which to get the value. Should be "me" for the current user or "host" for all users. |
| 30 | + :param str key: Optional key under which to filter all the entries |
| 31 | + :rtype: {object} |
| 32 | + """ |
| 33 | + route_values = {} |
| 34 | + if user_scope is not None: |
| 35 | + route_values['userScope'] = self._serialize.url('user_scope', user_scope, 'str') |
| 36 | + if key is not None: |
| 37 | + route_values['key'] = self._serialize.url('key', key, 'str') |
| 38 | + response = self._send(http_method='GET', |
| 39 | + location_id='cd006711-163d-4cd4-a597-b05bad2556ff', |
| 40 | + version='4.0-preview.1', |
| 41 | + route_values=route_values, |
| 42 | + returns_collection=True) |
| 43 | + return self._deserialize('{object}', response) |
| 44 | + |
| 45 | + def remove_entries(self, user_scope, key): |
| 46 | + """RemoveEntries. |
| 47 | + [Preview API] Remove the entry or entries under the specified path |
| 48 | + :param str user_scope: User-Scope at which to remove the value. Should be "me" for the current user or "host" for all users. |
| 49 | + :param str key: Root key of the entry or entries to remove |
| 50 | + """ |
| 51 | + route_values = {} |
| 52 | + if user_scope is not None: |
| 53 | + route_values['userScope'] = self._serialize.url('user_scope', user_scope, 'str') |
| 54 | + if key is not None: |
| 55 | + route_values['key'] = self._serialize.url('key', key, 'str') |
| 56 | + self._send(http_method='DELETE', |
| 57 | + location_id='cd006711-163d-4cd4-a597-b05bad2556ff', |
| 58 | + version='4.0-preview.1', |
| 59 | + route_values=route_values) |
| 60 | + |
| 61 | + def set_entries(self, entries, user_scope): |
| 62 | + """SetEntries. |
| 63 | + [Preview API] Set the specified setting entry values for the given user/all-users scope |
| 64 | + :param {object} entries: The entries to set |
| 65 | + :param str user_scope: User-Scope at which to set the values. Should be "me" for the current user or "host" for all users. |
| 66 | + """ |
| 67 | + route_values = {} |
| 68 | + if user_scope is not None: |
| 69 | + route_values['userScope'] = self._serialize.url('user_scope', user_scope, 'str') |
| 70 | + content = self._serialize.body(entries, '{object}') |
| 71 | + self._send(http_method='PATCH', |
| 72 | + location_id='cd006711-163d-4cd4-a597-b05bad2556ff', |
| 73 | + version='4.0-preview.1', |
| 74 | + route_values=route_values, |
| 75 | + content=content) |
| 76 | + |
| 77 | + def get_entries_for_scope(self, user_scope, scope_name, scope_value, key=None): |
| 78 | + """GetEntriesForScope. |
| 79 | + [Preview API] Get all setting entries for the given named scope |
| 80 | + :param str user_scope: User-Scope at which to get the value. Should be "me" for the current user or "host" for all users. |
| 81 | + :param str scope_name: Scope at which to get the setting for (e.g. "project" or "team") |
| 82 | + :param str scope_value: Value of the scope (e.g. the project or team id) |
| 83 | + :param str key: Optional key under which to filter all the entries |
| 84 | + :rtype: {object} |
| 85 | + """ |
| 86 | + route_values = {} |
| 87 | + if user_scope is not None: |
| 88 | + route_values['userScope'] = self._serialize.url('user_scope', user_scope, 'str') |
| 89 | + if scope_name is not None: |
| 90 | + route_values['scopeName'] = self._serialize.url('scope_name', scope_name, 'str') |
| 91 | + if scope_value is not None: |
| 92 | + route_values['scopeValue'] = self._serialize.url('scope_value', scope_value, 'str') |
| 93 | + if key is not None: |
| 94 | + route_values['key'] = self._serialize.url('key', key, 'str') |
| 95 | + response = self._send(http_method='GET', |
| 96 | + location_id='4cbaafaf-e8af-4570-98d1-79ee99c56327', |
| 97 | + version='4.0-preview.1', |
| 98 | + route_values=route_values, |
| 99 | + returns_collection=True) |
| 100 | + return self._deserialize('{object}', response) |
| 101 | + |
| 102 | + def remove_entries_for_scope(self, user_scope, scope_name, scope_value, key): |
| 103 | + """RemoveEntriesForScope. |
| 104 | + [Preview API] Remove the entry or entries under the specified path |
| 105 | + :param str user_scope: User-Scope at which to remove the value. Should be "me" for the current user or "host" for all users. |
| 106 | + :param str scope_name: Scope at which to get the setting for (e.g. "project" or "team") |
| 107 | + :param str scope_value: Value of the scope (e.g. the project or team id) |
| 108 | + :param str key: Root key of the entry or entries to remove |
| 109 | + """ |
| 110 | + route_values = {} |
| 111 | + if user_scope is not None: |
| 112 | + route_values['userScope'] = self._serialize.url('user_scope', user_scope, 'str') |
| 113 | + if scope_name is not None: |
| 114 | + route_values['scopeName'] = self._serialize.url('scope_name', scope_name, 'str') |
| 115 | + if scope_value is not None: |
| 116 | + route_values['scopeValue'] = self._serialize.url('scope_value', scope_value, 'str') |
| 117 | + if key is not None: |
| 118 | + route_values['key'] = self._serialize.url('key', key, 'str') |
| 119 | + self._send(http_method='DELETE', |
| 120 | + location_id='4cbaafaf-e8af-4570-98d1-79ee99c56327', |
| 121 | + version='4.0-preview.1', |
| 122 | + route_values=route_values) |
| 123 | + |
| 124 | + def set_entries_for_scope(self, entries, user_scope, scope_name, scope_value): |
| 125 | + """SetEntriesForScope. |
| 126 | + [Preview API] Set the specified entries for the given named scope |
| 127 | + :param {object} entries: The entries to set |
| 128 | + :param str user_scope: User-Scope at which to set the values. Should be "me" for the current user or "host" for all users. |
| 129 | + :param str scope_name: Scope at which to set the settings on (e.g. "project" or "team") |
| 130 | + :param str scope_value: Value of the scope (e.g. the project or team id) |
| 131 | + """ |
| 132 | + route_values = {} |
| 133 | + if user_scope is not None: |
| 134 | + route_values['userScope'] = self._serialize.url('user_scope', user_scope, 'str') |
| 135 | + if scope_name is not None: |
| 136 | + route_values['scopeName'] = self._serialize.url('scope_name', scope_name, 'str') |
| 137 | + if scope_value is not None: |
| 138 | + route_values['scopeValue'] = self._serialize.url('scope_value', scope_value, 'str') |
| 139 | + content = self._serialize.body(entries, '{object}') |
| 140 | + self._send(http_method='PATCH', |
| 141 | + location_id='4cbaafaf-e8af-4570-98d1-79ee99c56327', |
| 142 | + version='4.0-preview.1', |
| 143 | + route_values=route_values, |
| 144 | + content=content) |
| 145 | + |
0 commit comments