Skip to content

Commit c675436

Browse files
committed
Merge branch 'release/3.1.0'
2 parents 9ac6331 + bf828e8 commit c675436

File tree

11 files changed

+163
-75
lines changed

11 files changed

+163
-75
lines changed

.idea/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.idea/client-api-python.iml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.idea/misc.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.idea/modules.xml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.idea/vcs.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

kameleo/local_api_client/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
55
# --------------------------------------------------------------------------
66

7-
VERSION = "3.0.0"
7+
VERSION = "3.1.0"

kameleo/local_api_client/builder_for_create_profile.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,19 @@ def set_tags(self, tags):
181181
self.profile_request['tags'] = tags
182182
return self
183183

184+
def set_hardware_concurrency(self, value, options):
185+
"""Tells the mode how the HardwareConcurrency will be spoofed. Possible values:
186+
'automatic': Automatically override the HardwareConcurrency based on the Base Profile.
187+
'manual': Manually override the HardwareConcurrency.
188+
'off': Turn off the spoofing, use the original settings.
189+
:param int value: HardwareConcurrency spoofing type. Possible values: 'automatic', 'manual', 'off'
190+
:param int options: When the HardwareConcurrency spoofing is set to manual, the required value must be provided.
191+
Valid values: 1,2,4,8,16.
192+
"""
193+
self.profile_request['hardwareConcurrency']['value'] = value
194+
self.profile_request['hardwareConcurrency']['extra'] = options
195+
return self
196+
184197
def set_launcher(self, browser_launcher):
185198
"""The mode how the profile should be launched. It determines which browser to launch. This cannot be modified after creation.
186199
Possible values for Desktop profiles 'automatic'.
@@ -203,6 +216,7 @@ def set_recommended_defaults(self):
203216
self.profile_request['webRtc']['value'] = "automatic"
204217
self.profile_request['fonts']['value'] = "enabled"
205218
self.profile_request['screen']['value'] = "automatic"
219+
self.profile_request['hardwareConcurrency']['value'] = "automatic"
206220
self.profile_request['launcher'] = "automatic"
207221

208222
return self
@@ -241,6 +255,10 @@ def reset(self, base_profile_id) -> Optional[Union[JSON, IO]]:
241255
"value": "off",
242256
"extra": None
243257
},
258+
"hardwareConcurrency": {
259+
"value": "off",
260+
"extra": None
261+
},
244262
"passwordManager": "disabled"
245263
}
246264
return data

kameleo/local_api_client/models/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from ._models import FontSpoofingTypeFontIListMultiLevelChoice
1717
from ._models import GeolocationSpoofingOptions
1818
from ._models import GeolocationSpoofingTypeGeolocationSpoofingOptionsMultiLevelChoice
19+
from ._models import HardwareConcurrencySpoofingTypeInt32NullableMultiLevelChoice
1920
from ._models import ImportProfileRequest
2021
from ._models import Os
2122
from ._models import Preference
@@ -40,6 +41,7 @@
4041
from ._enums import CanvasSpoofingType
4142
from ._enums import FontSpoofingType
4243
from ._enums import GeolocationSpoofingType
44+
from ._enums import HardwareConcurrencySpoofingType
4345
from ._enums import PasswordManagerType
4446
from ._enums import ProfileLifetimeState
4547
from ._enums import ProfilePersistenceState
@@ -66,6 +68,7 @@
6668
"FontSpoofingTypeFontIListMultiLevelChoice",
6769
"GeolocationSpoofingOptions",
6870
"GeolocationSpoofingTypeGeolocationSpoofingOptionsMultiLevelChoice",
71+
"HardwareConcurrencySpoofingTypeInt32NullableMultiLevelChoice",
6972
"ImportProfileRequest",
7073
"Os",
7174
"Preference",
@@ -89,6 +92,7 @@
8992
"CanvasSpoofingType",
9093
"FontSpoofingType",
9194
"GeolocationSpoofingType",
95+
"HardwareConcurrencySpoofingType",
9296
"PasswordManagerType",
9397
"ProfileLifetimeState",
9498
"ProfilePersistenceState",

kameleo/local_api_client/models/_enums.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ class GeolocationSpoofingType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
6060
OFF = "off"
6161

6262

63+
class HardwareConcurrencySpoofingType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
64+
"""Tells the mode how the HardwareConcurrency will be spoofed. Possible values:
65+
'automatic': Automatically set the values based on the Base Profile.
66+
'manual': Manually set the value in the profile. Valid values: 1, 2, 4, 8, 12, 16.
67+
'off': Turn off the spoofing, use the original settings.
68+
"""
69+
70+
AUTOMATIC = "automatic"
71+
MANUAL = "manual"
72+
OFF = "off"
73+
74+
6375
class PasswordManagerType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
6476
"""Tells if the browser should support credential saving. Possible values are:
6577
'enabled': Credential saving is enabled.
@@ -71,20 +83,24 @@ class PasswordManagerType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
7183

7284

7385
class ProfileLifetimeState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
74-
"""Tells the lifetime state of the profile. This is important, because several actions can only be
75-
performed in a specific state. Possible values:
76-
'created': Profile is created but never started.
77-
'starting': Profile is starting the browser.
78-
'running': Profile is running the browser.
79-
'terminating': Profile is terminating the browser.
80-
'terminated': Profile is not running, but it has been run at least once.
86+
"""Represents the lifetime states of a profile, indicating which actions
87+
can be performed with the associated browser engine at each state. Possible values are:
88+
89+
90+
* Unknown: State of the profile is undefined.
91+
* Created: Profile is created; the associated browser engine is not started.
92+
* Starting: The associated browser engine is starting.
93+
* Running: The associated browser engine is currently running.
94+
* Terminating: The associated browser engine is in the process of terminating.
95+
* Terminated: The associated browser engine is not running but has been started at least once.
8196
"""
8297

8398
CREATED = "created"
8499
STARTING = "starting"
85100
RUNNING = "running"
86101
TERMINATING = "terminating"
87102
TERMINATED = "terminated"
103+
UNKNOWN = "unknown"
88104

89105

90106
class ProfilePersistenceState(str, Enum, metaclass=CaseInsensitiveEnumMeta):

0 commit comments

Comments
 (0)