From f7e71d3f25a5d91f35628b414e8abe9e6849d316 Mon Sep 17 00:00:00 2001 From: Tarun Vashisth Date: Mon, 5 Oct 2020 12:59:51 +0530 Subject: [PATCH] Release 0.1.0: Nested groups, subscription and commands --- README.md | 14 +- docs/CommandsV2Api.md | 60 --- docs/DeviceGroup.md | 13 +- docs/DeviceGroupApi.md | 24 +- docs/DeviceGroupPartialUpdate.md | 21 + docs/DeviceGroupUpdate.md | 13 +- docs/EnterprisePolicy.md | 7 +- docs/EnterprisePolicyApi.md | 4 +- docs/EnterprisePolicyPartialUpdate.md | 23 + docs/EventSubscription.md | 19 + docs/EventSubscriptionArgs.md | 13 + docs/InlineResponse20012.md | 16 + docs/SubscriptionApi.md | 225 +++++++++ docs/V0CommandArgs.md | 9 +- docs/V0DeviceCommandEnum.md | 10 +- esperclient/__init__.py | 8 +- esperclient/api/__init__.py | 1 + esperclient/api/commands_v2_api.py | 123 ----- esperclient/api/device_group_api.py | 24 +- esperclient/api/enterprise_policy_api.py | 4 +- esperclient/api/subscription_api.py | 458 ++++++++++++++++++ esperclient/api_client.py | 2 +- esperclient/configuration.py | 2 +- esperclient/models/__init__.py | 7 +- esperclient/models/device_group.py | 156 ++++-- .../models/device_group_partial_update.py | 354 ++++++++++++++ esperclient/models/device_group_update.py | 211 +++++--- esperclient/models/enterprise_policy.py | 95 ++-- esperclient/models/enterprise_policy_data.py | 2 +- .../enterprise_policy_partial_update.py | 410 ++++++++++++++++ esperclient/models/event_subscription.py | 288 +++++++++++ esperclient/models/event_subscription_args.py | 131 +++++ esperclient/models/inline_response20012.py | 210 ++++++++ esperclient/models/v0_command_args.py | 150 +++++- esperclient/models/v0_device_command_enum.py | 8 + setup.py | 4 +- test/test_device_group_partial_update.py | 52 ++ test/test_enterprise_policy_partial_update.py | 52 ++ test/test_event_subscription.py | 52 ++ test/test_event_subscription_args.py | 52 ++ test/test_inline_response20012.py | 52 ++ test/test_subscription_api.py | 75 +++ 42 files changed, 3092 insertions(+), 362 deletions(-) create mode 100644 docs/DeviceGroupPartialUpdate.md create mode 100644 docs/EnterprisePolicyPartialUpdate.md create mode 100644 docs/EventSubscription.md create mode 100644 docs/EventSubscriptionArgs.md create mode 100644 docs/InlineResponse20012.md create mode 100644 docs/SubscriptionApi.md create mode 100644 esperclient/api/subscription_api.py create mode 100644 esperclient/models/device_group_partial_update.py create mode 100644 esperclient/models/enterprise_policy_partial_update.py create mode 100644 esperclient/models/event_subscription.py create mode 100644 esperclient/models/event_subscription_args.py create mode 100644 esperclient/models/inline_response20012.py create mode 100644 test/test_device_group_partial_update.py create mode 100644 test/test_enterprise_policy_partial_update.py create mode 100644 test/test_event_subscription.py create mode 100644 test/test_event_subscription_args.py create mode 100644 test/test_inline_response20012.py create mode 100644 test/test_subscription_api.py diff --git a/README.md b/README.md index 8f29f93..926111e 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Esper provides a Python client library to communicate with the Esper APIs to pro - API version: 1.0.0 -- Package version: 0.0.15 +- Package version: 0.1.0 ## Requirements. @@ -94,7 +94,6 @@ Class | Method | HTTP request *CommandsV2Api* | [**get_command_request_status**](docs/CommandsV2Api.md#get_command_request_status) | **GET** /v0/enterprise/{enterprise_id}/command/{request_id}/status/ *CommandsV2Api* | [**get_device_command_history**](docs/CommandsV2Api.md#get_device_command_history) | **GET** /v0/enterprise/{enterprise_id}/device/{device_id}/command-history/ *CommandsV2Api* | [**list_command_request**](docs/CommandsV2Api.md#list_command_request) | **GET** /v0/enterprise/{enterprise_id}/command/ -*CommandsV2Api* | [**partial_update_command_status**](docs/CommandsV2Api.md#partial_update_command_status) | **PATCH** /v0/enterprise/{enterprise_id}/command/{request_id}/status/{command_id}/ *DeviceApi* | [**get_all_devices**](docs/DeviceApi.md#get_all_devices) | **GET** /enterprise/{enterprise_id}/device/ *DeviceApi* | [**get_app_installs**](docs/DeviceApi.md#get_app_installs) | **GET** /enterprise/{enterprise_id}/device/{device_id}/install/ *DeviceApi* | [**get_device_app_by_id**](docs/DeviceApi.md#get_device_app_by_id) | **GET** /enterprise/{enterprise_id}/device/{device_id}/app/{app_id}/ @@ -123,6 +122,10 @@ Class | Method | HTTP request *GeofenceApi* | [**update_geofence**](docs/GeofenceApi.md#update_geofence) | **PUT** /v0/enterprise/{enterprise_id}/geofence/{geofence_id}/ *GroupCommandsApi* | [**get_group_command**](docs/GroupCommandsApi.md#get_group_command) | **GET** /enterprise/{enterprise_id}/devicegroup/{group_id}/command/{command_id}/ *GroupCommandsApi* | [**run_group_command**](docs/GroupCommandsApi.md#run_group_command) | **POST** /enterprise/{enterprise_id}/devicegroup/{group_id}/command/ +*SubscriptionApi* | [**create_subscription**](docs/SubscriptionApi.md#create_subscription) | **POST** /v0/enterprise/{enterprise_id}/subscription/ +*SubscriptionApi* | [**delete_subscription**](docs/SubscriptionApi.md#delete_subscription) | **DELETE** /v0/enterprise/{enterprise_id}/subscription/{subscription_id}/ +*SubscriptionApi* | [**get_all_subscriptions**](docs/SubscriptionApi.md#get_all_subscriptions) | **GET** /v0/enterprise/{enterprise_id}/subscription/ +*SubscriptionApi* | [**get_subscription**](docs/SubscriptionApi.md#get_subscription) | **GET** /v0/enterprise/{enterprise_id}/subscription/{subscription_id}/ *TokenApi* | [**get_token_info**](docs/TokenApi.md#get_token_info) | **GET** /v1/token-info/ *TokenApi* | [**renew_token**](docs/TokenApi.md#renew_token) | **POST** /v0/enterprise/{enterprise_id}/developerapp/{developerapp_id}/renew-token/ @@ -143,6 +146,7 @@ Class | Method | HTTP request - [DeviceAppPermission](docs/DeviceAppPermission.md) - [DeviceCommand](docs/DeviceCommand.md) - [DeviceGroup](docs/DeviceGroup.md) + - [DeviceGroupPartialUpdate](docs/DeviceGroupPartialUpdate.md) - [DeviceGroupUpdate](docs/DeviceGroupUpdate.md) - [DeviceStatus](docs/DeviceStatus.md) - [EmmDevice](docs/EmmDevice.md) @@ -153,8 +157,11 @@ Class | Method | HTTP request - [EnterprisePolicyDataFrpGoogles](docs/EnterprisePolicyDataFrpGoogles.md) - [EnterprisePolicyDataGoogleAccountPermission](docs/EnterprisePolicyDataGoogleAccountPermission.md) - [EnterprisePolicyDataPhonePolicy](docs/EnterprisePolicyDataPhonePolicy.md) + - [EnterprisePolicyPartialUpdate](docs/EnterprisePolicyPartialUpdate.md) - [EnterpriseUpdateV1](docs/EnterpriseUpdateV1.md) - [EnterpriseV1](docs/EnterpriseV1.md) + - [EventSubscription](docs/EventSubscription.md) + - [EventSubscriptionArgs](docs/EventSubscriptionArgs.md) - [Geofence](docs/Geofence.md) - [GeofenceUpdate](docs/GeofenceUpdate.md) - [GoogleEMM](docs/GoogleEMM.md) @@ -165,6 +172,7 @@ Class | Method | HTTP request - [InlineResponse2001](docs/InlineResponse2001.md) - [InlineResponse20010](docs/InlineResponse20010.md) - [InlineResponse20011](docs/InlineResponse20011.md) + - [InlineResponse20012](docs/InlineResponse20012.md) - [InlineResponse2002](docs/InlineResponse2002.md) - [InlineResponse2003](docs/InlineResponse2003.md) - [InlineResponse2004](docs/InlineResponse2004.md) @@ -182,8 +190,6 @@ Class | Method | HTTP request - [V0CommandRequestStatus](docs/V0CommandRequestStatus.md) - [V0CommandScheduleArgs](docs/V0CommandScheduleArgs.md) - [V0CommandStatus](docs/V0CommandStatus.md) - - [V0CommandStatusUpdate](docs/V0CommandStatusUpdate.md) - - [V0CommandStatusUpdateDetails](docs/V0CommandStatusUpdateDetails.md) ## Documentation For Enums diff --git a/docs/CommandsV2Api.md b/docs/CommandsV2Api.md index 35ff532..2638995 100644 --- a/docs/CommandsV2Api.md +++ b/docs/CommandsV2Api.md @@ -8,7 +8,6 @@ Method | HTTP request | Description [**get_command_request_status**](CommandsV2Api.md#get_command_request_status) | **GET** /v0/enterprise/{enterprise_id}/command/{request_id}/status/ | get status list for command request [**get_device_command_history**](CommandsV2Api.md#get_device_command_history) | **GET** /v0/enterprise/{enterprise_id}/device/{device_id}/command-history/ | get command history for device [**list_command_request**](CommandsV2Api.md#list_command_request) | **GET** /v0/enterprise/{enterprise_id}/command/ | List command requests -[**partial_update_command_status**](CommandsV2Api.md#partial_update_command_status) | **PATCH** /v0/enterprise/{enterprise_id}/command/{request_id}/status/{command_id}/ | Update command status # **create_command** @@ -237,62 +236,3 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **partial_update_command_status** -> V0CommandStatus partial_update_command_status(enterprise_id, request_id, command_id, action, data=data) - -Update command status - -API to patch the state of command - -### Example -```python -import esperclient -from esperclient.rest import ApiException - -# Configure API key authorization: apiKey -configuration = esperclient.Configuration() -configuration.host = 'SERVER_URL' -configuration.api_key['Authorization'] = 'YOUR_API_KEY' -configuration.api_key_prefix['Authorization'] = 'Bearer' - -# create an instance of the API class -api_instance = esperclient.CommandsV2Api(esperclient.ApiClient(configuration)) -enterprise_id = 'enterprise_id_example' # str | ID of the enterprise -request_id = 'request_id_example' # str | ID for the command request -command_id = 'command_id_example' # str | ID for the command -action = 'action_example' # str | Action to be performed on device -data = esperclient.V0CommandStatusUpdate() # V0CommandStatusUpdate | (optional) - -try: - # Update command status - api_response = api_instance.partial_update_command_status(enterprise_id, request_id, command_id, action, data=data) - print(api_response) -except ApiException as e: - print("Exception when calling CommandsV2Api->partial_update_command_status: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enterprise_id** | [**str**](.md)| ID of the enterprise | - **request_id** | [**str**](.md)| ID for the command request | - **command_id** | [**str**](.md)| ID for the command | - **action** | **str**| Action to be performed on device | - **data** | [**V0CommandStatusUpdate**](V0CommandStatusUpdate.md)| | [optional] - -### Return type - -[**V0CommandStatus**](V0CommandStatus.md) - -### Authorization - -[apiKey](../README.md#apiKey) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/docs/DeviceGroup.md b/docs/DeviceGroup.md index 42f8aec..ccf2726 100644 --- a/docs/DeviceGroup.md +++ b/docs/DeviceGroup.md @@ -6,11 +6,14 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | [optional] -**device_count** | **int** | | [optional] -**name** | **str** | | -**created_on** | **datetime** | | [optional] -**enterprise** | **str** | | [optional] +**id** | **str** | Group id | [optional] +**name** | **str** | Group name | +**created_on** | **datetime** | Date and time of when the group was created | [optional] +**enterprise** | **str** | Enterprise url | [optional] +**parent** | **str** | Parent group url | [optional] +**device_count** | **int** | Count of devices in the group | [optional] +**path** | **str** | Path of the group | [optional] +**children_count** | **int** | Count of child groups | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/DeviceGroupApi.md b/docs/DeviceGroupApi.md index a499a6f..2bb7bef 100644 --- a/docs/DeviceGroupApi.md +++ b/docs/DeviceGroupApi.md @@ -33,7 +33,7 @@ configuration.api_key_prefix['Authorization'] = 'Bearer' # create an instance of the API class api_instance = esperclient.DeviceGroupApi(esperclient.ApiClient(configuration)) enterprise_id = 'enterprise_id_example' # str | A UUID string identifying enterprise. -data = esperclient.DeviceGroup() # DeviceGroup | +data = esperclient.DeviceGroupUpdate() # DeviceGroupUpdate | try: # Create a device group @@ -48,7 +48,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **enterprise_id** | **str**| A UUID string identifying enterprise. | - **data** | [**DeviceGroup**](DeviceGroup.md)| | + **data** | [**DeviceGroupUpdate**](DeviceGroupUpdate.md)| | ### Return type @@ -138,7 +138,7 @@ configuration.api_key_prefix['Authorization'] = 'Bearer' # create an instance of the API class api_instance = esperclient.DeviceGroupApi(esperclient.ApiClient(configuration)) enterprise_id = 'enterprise_id_example' # str | A UUID string identifying enterprise. -name = 'name_example' # str | filter by group name (optional) +name = 'name_example' # str | Filter by group name (optional) limit = 20 # int | Number of results to return per page. (optional) (default to 20) offset = 0 # int | The initial index from which to return the results. (optional) (default to 0) @@ -155,7 +155,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **enterprise_id** | **str**| A UUID string identifying enterprise. | - **name** | **str**| filter by group name | [optional] + **name** | **str**| Filter by group name | [optional] **limit** | **int**| Number of results to return per page. | [optional] [default to 20] **offset** | **int**| The initial index from which to return the results. | [optional] [default to 0] @@ -228,7 +228,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **partial_update_group** -> DeviceGroup partial_update_group(group_id, enterprise_id, data) +> DeviceGroup partial_update_group(group_id, enterprise_id, data, action=action) Partial update group @@ -249,11 +249,12 @@ configuration.api_key_prefix['Authorization'] = 'Bearer' api_instance = esperclient.DeviceGroupApi(esperclient.ApiClient(configuration)) group_id = 'group_id_example' # str | A UUID string identifying this enterprise device group. enterprise_id = 'enterprise_id_example' # str | A UUID string identifying enterprise. -data = esperclient.DeviceGroupUpdate() # DeviceGroupUpdate | +data = esperclient.DeviceGroupPartialUpdate() # DeviceGroupPartialUpdate | +action = 'action_example' # str | add / remove / rename / move (optional) try: # Partial update group - api_response = api_instance.partial_update_group(group_id, enterprise_id, data) + api_response = api_instance.partial_update_group(group_id, enterprise_id, data, action=action) print(api_response) except ApiException as e: print("Exception when calling DeviceGroupApi->partial_update_group: %s\n" % e) @@ -265,7 +266,8 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | [**str**](.md)| A UUID string identifying this enterprise device group. | **enterprise_id** | **str**| A UUID string identifying enterprise. | - **data** | [**DeviceGroupUpdate**](DeviceGroupUpdate.md)| | + **data** | [**DeviceGroupPartialUpdate**](DeviceGroupPartialUpdate.md)| | + **action** | **str**| add / remove / rename / move | [optional] ### Return type @@ -283,7 +285,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_group** -> DeviceGroup update_group(group_id, enterprise_id, data) +> DeviceGroup update_group(group_id, enterprise_id, data, action=action) Update device group @@ -305,10 +307,11 @@ api_instance = esperclient.DeviceGroupApi(esperclient.ApiClient(configuration)) group_id = 'group_id_example' # str | A UUID string identifying this enterprise device group. enterprise_id = 'enterprise_id_example' # str | A UUID string identifying enterprise. data = esperclient.DeviceGroupUpdate() # DeviceGroupUpdate | +action = 'action_example' # str | add / remove / rename / move (optional) try: # Update device group - api_response = api_instance.update_group(group_id, enterprise_id, data) + api_response = api_instance.update_group(group_id, enterprise_id, data, action=action) print(api_response) except ApiException as e: print("Exception when calling DeviceGroupApi->update_group: %s\n" % e) @@ -321,6 +324,7 @@ Name | Type | Description | Notes **group_id** | [**str**](.md)| A UUID string identifying this enterprise device group. | **enterprise_id** | **str**| A UUID string identifying enterprise. | **data** | [**DeviceGroupUpdate**](DeviceGroupUpdate.md)| | + **action** | **str**| add / remove / rename / move | [optional] ### Return type diff --git a/docs/DeviceGroupPartialUpdate.md b/docs/DeviceGroupPartialUpdate.md new file mode 100644 index 0000000..eefea63 --- /dev/null +++ b/docs/DeviceGroupPartialUpdate.md @@ -0,0 +1,21 @@ +# DeviceGroupPartialUpdate +> esperclient.models.device_group_partial_update + +### Description + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Group id | [optional] +**name** | **str** | Group name | [optional] +**created_on** | **datetime** | Date and time of when the group was created | [optional] +**enterprise** | **str** | Enterprise url | [optional] +**parent** | **str** | Parent group id | [optional] +**device_ids** | **list[str]** | Device ids | [optional] +**device_count** | **int** | Count of devices in the group | [optional] +**path** | **str** | Path of the group | [optional] +**children_count** | **int** | Count of child groups | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DeviceGroupUpdate.md b/docs/DeviceGroupUpdate.md index cc48581..4e3e268 100644 --- a/docs/DeviceGroupUpdate.md +++ b/docs/DeviceGroupUpdate.md @@ -6,12 +6,15 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | [optional] -**device_ids** | **list[str]** | | [optional] +**id** | **str** | Group id | [optional] +**name** | **str** | Group name | +**created_on** | **datetime** | Date and time of when the group was created | [optional] +**enterprise** | **str** | Enterprise url | [optional] +**parent** | **str** | Parent group id | [optional] +**device_ids** | **list[str]** | Devices ids | [optional] **device_count** | **int** | | [optional] -**name** | **str** | | [optional] -**created_on** | **datetime** | | [optional] -**enterprise** | **str** | | [optional] +**path** | **str** | Path of the group | [optional] +**children_count** | **int** | Count of child groups | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/EnterprisePolicy.md b/docs/EnterprisePolicy.md index e61fb11..f955e87 100644 --- a/docs/EnterprisePolicy.md +++ b/docs/EnterprisePolicy.md @@ -6,13 +6,14 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | Unique Policy identifier | [optional] **uuid** | **str** | Unique Policy identifier | [optional] +**enterprise** | **str** | Url of the enterprise resource | **url** | **str** | URL link to policy | [optional] -**name** | **str** | Name of the Policy | [optional] +**name** | **str** | Name of the Policy | **description** | **str** | Details regarding the Policy | [optional] **device_count** | **int** | Count of Devices with this policy applied | [optional] -**policy** | [**EnterprisePolicyData**](EnterprisePolicyData.md) | | [optional] +**google_policy_id** | **str** | Id of the Google policy | [optional] +**policy** | [**EnterprisePolicyData**](EnterprisePolicyData.md) | | **updated_on** | **datetime** | Last-Updated Timestamp of Policy | [optional] **created_on** | **datetime** | Creation Timestamp of Policy | [optional] **is_active** | **bool** | Is this policy currently active | [optional] diff --git a/docs/EnterprisePolicyApi.md b/docs/EnterprisePolicyApi.md index 8dd0fba..4bc7cae 100644 --- a/docs/EnterprisePolicyApi.md +++ b/docs/EnterprisePolicyApi.md @@ -251,7 +251,7 @@ configuration.api_key_prefix['Authorization'] = 'Bearer' api_instance = esperclient.EnterprisePolicyApi(esperclient.ApiClient(configuration)) policy_id = 56 # int | An integer identifying this EnterprisePolicy. enterprise_id = 'enterprise_id_example' # str | A UUID string identifying enterprise. -data = esperclient.EnterprisePolicy() # EnterprisePolicy | +data = esperclient.EnterprisePolicyPartialUpdate() # EnterprisePolicyPartialUpdate | try: # Partial update EnterprisePolicy @@ -267,7 +267,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **policy_id** | **int**| An integer identifying this EnterprisePolicy. | **enterprise_id** | **str**| A UUID string identifying enterprise. | - **data** | [**EnterprisePolicy**](EnterprisePolicy.md)| | + **data** | [**EnterprisePolicyPartialUpdate**](EnterprisePolicyPartialUpdate.md)| | ### Return type diff --git a/docs/EnterprisePolicyPartialUpdate.md b/docs/EnterprisePolicyPartialUpdate.md new file mode 100644 index 0000000..c4b3d47 --- /dev/null +++ b/docs/EnterprisePolicyPartialUpdate.md @@ -0,0 +1,23 @@ +# EnterprisePolicyPartialUpdate +> esperclient.models.enterprise_policy_partial_update + +### Description + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **str** | Unique Policy identifier | [optional] +**enterprise** | **str** | Url of the enterprise resource | [optional] +**url** | **str** | URL link to policy | [optional] +**name** | **str** | Name of the Policy | [optional] +**description** | **str** | Details regarding the Policy | [optional] +**device_count** | **int** | Count of Devices with this policy applied | [optional] +**policy** | [**EnterprisePolicyData**](EnterprisePolicyData.md) | | [optional] +**updated_on** | **datetime** | Last-Updated Timestamp of Policy | [optional] +**created_on** | **datetime** | Creation Timestamp of Policy | [optional] +**is_active** | **bool** | Is this policy currently active | [optional] +**google_policy_id** | **str** | Id of the Google policy | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EventSubscription.md b/docs/EventSubscription.md new file mode 100644 index 0000000..c1d6619 --- /dev/null +++ b/docs/EventSubscription.md @@ -0,0 +1,19 @@ +# EventSubscription +> esperclient.models.event_subscription + +### Description + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**aws_account_id** | **str** | | +**sns_topic_arn** | **str** | | [optional] +**created_on** | **datetime** | | [optional] +**updated_on** | **datetime** | | [optional] +**is_subscribed** | **bool** | | [optional] +**enterprise** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EventSubscriptionArgs.md b/docs/EventSubscriptionArgs.md new file mode 100644 index 0000000..1d4f9ce --- /dev/null +++ b/docs/EventSubscriptionArgs.md @@ -0,0 +1,13 @@ +# EventSubscriptionArgs +> esperclient.models.event_subscription_args + +### Description + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aws_account_id** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/InlineResponse20012.md b/docs/InlineResponse20012.md new file mode 100644 index 0000000..bd46eae --- /dev/null +++ b/docs/InlineResponse20012.md @@ -0,0 +1,16 @@ +# InlineResponse20012 +> esperclient.models.inline_response20012 + +### Description + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | | +**next** | **str** | | [optional] +**previous** | **str** | | [optional] +**results** | [**list[EventSubscription]**](EventSubscription.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SubscriptionApi.md b/docs/SubscriptionApi.md new file mode 100644 index 0000000..1a1553b --- /dev/null +++ b/docs/SubscriptionApi.md @@ -0,0 +1,225 @@ +# esperclient.SubscriptionApi + +All URIs are relative to *https://foo-api.esper.cloud/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_subscription**](SubscriptionApi.md#create_subscription) | **POST** /v0/enterprise/{enterprise_id}/subscription/ | Create a Subscription +[**delete_subscription**](SubscriptionApi.md#delete_subscription) | **DELETE** /v0/enterprise/{enterprise_id}/subscription/{subscription_id}/ | Delete a subscription +[**get_all_subscriptions**](SubscriptionApi.md#get_all_subscriptions) | **GET** /v0/enterprise/{enterprise_id}/subscription/ | List Subscriptions in Enterprise +[**get_subscription**](SubscriptionApi.md#get_subscription) | **GET** /v0/enterprise/{enterprise_id}/subscription/{subscription_id}/ | Get subscription information + + +# **create_subscription** +> EventSubscription create_subscription(data, enterprise_id) + +Create a Subscription + +Returns Subscription instance + +### Example +```python +import esperclient +from esperclient.rest import ApiException + +# Configure API key authorization: apiKey +configuration = esperclient.Configuration() +configuration.host = 'SERVER_URL' +configuration.api_key['Authorization'] = 'YOUR_API_KEY' +configuration.api_key_prefix['Authorization'] = 'Bearer' + +# create an instance of the API class +api_instance = esperclient.SubscriptionApi(esperclient.ApiClient(configuration)) +data = esperclient.EventSubscriptionArgs() # EventSubscriptionArgs | +enterprise_id = 'enterprise_id_example' # str | A UUID string identifying the enterprise. + +try: + # Create a Subscription + api_response = api_instance.create_subscription(data, enterprise_id) + print(api_response) +except ApiException as e: + print("Exception when calling SubscriptionApi->create_subscription: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **data** | [**EventSubscriptionArgs**](EventSubscriptionArgs.md)| | + **enterprise_id** | [**str**](.md)| A UUID string identifying the enterprise. | + +### Return type + +[**EventSubscription**](EventSubscription.md) + +### Authorization + +[apiKey](../README.md#apiKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_subscription** +> delete_subscription(subscription_id, enterprise_id) + +Delete a subscription + +Empty response + +### Example +```python +import esperclient +from esperclient.rest import ApiException + +# Configure API key authorization: apiKey +configuration = esperclient.Configuration() +configuration.host = 'SERVER_URL' +configuration.api_key['Authorization'] = 'YOUR_API_KEY' +configuration.api_key_prefix['Authorization'] = 'Bearer' + +# create an instance of the API class +api_instance = esperclient.SubscriptionApi(esperclient.ApiClient(configuration)) +subscription_id = 'subscription_id_example' # str | A UUID string identifying the subscription. +enterprise_id = 'enterprise_id_example' # str | A UUID string identifying the enterprise. + +try: + # Delete a subscription + api_instance.delete_subscription(subscription_id, enterprise_id) +except ApiException as e: + print("Exception when calling SubscriptionApi->delete_subscription: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **subscription_id** | [**str**](.md)| A UUID string identifying the subscription. | + **enterprise_id** | [**str**](.md)| A UUID string identifying the enterprise. | + +### Return type + +void (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_all_subscriptions** +> InlineResponse20012 get_all_subscriptions(enterprise_id, limit=limit, offset=offset) + +List Subscriptions in Enterprise + +API to view all the subscriptions in an enterprise + +### Example +```python +import esperclient +from esperclient.rest import ApiException + +# Configure API key authorization: apiKey +configuration = esperclient.Configuration() +configuration.host = 'SERVER_URL' +configuration.api_key['Authorization'] = 'YOUR_API_KEY' +configuration.api_key_prefix['Authorization'] = 'Bearer' + +# create an instance of the API class +api_instance = esperclient.SubscriptionApi(esperclient.ApiClient(configuration)) +enterprise_id = 'enterprise_id_example' # str | A UUID string identifying the enterprise. +limit = 56 # int | Number of results to return per page. (optional) +offset = 56 # int | The initial index from which to return the results. (optional) + +try: + # List Subscriptions in Enterprise + api_response = api_instance.get_all_subscriptions(enterprise_id, limit=limit, offset=offset) + print(api_response) +except ApiException as e: + print("Exception when calling SubscriptionApi->get_all_subscriptions: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enterprise_id** | [**str**](.md)| A UUID string identifying the enterprise. | + **limit** | **int**| Number of results to return per page. | [optional] + **offset** | **int**| The initial index from which to return the results. | [optional] + +### Return type + +[**InlineResponse20012**](InlineResponse20012.md) + +### Authorization + +[apiKey](../README.md#apiKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_subscription** +> EventSubscription get_subscription(subscription_id, enterprise_id) + +Get subscription information + +Returns subscription instance + +### Example +```python +import esperclient +from esperclient.rest import ApiException + +# Configure API key authorization: apiKey +configuration = esperclient.Configuration() +configuration.host = 'SERVER_URL' +configuration.api_key['Authorization'] = 'YOUR_API_KEY' +configuration.api_key_prefix['Authorization'] = 'Bearer' + +# create an instance of the API class +api_instance = esperclient.SubscriptionApi(esperclient.ApiClient(configuration)) +subscription_id = 'subscription_id_example' # str | A UUID string identifying the subscription. +enterprise_id = 'enterprise_id_example' # str | A UUID string identifying the enterprise. + +try: + # Get subscription information + api_response = api_instance.get_subscription(subscription_id, enterprise_id) + print(api_response) +except ApiException as e: + print("Exception when calling SubscriptionApi->get_subscription: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **subscription_id** | [**str**](.md)| A UUID string identifying the subscription. | + **enterprise_id** | [**str**](.md)| A UUID string identifying the enterprise. | + +### Return type + +[**EventSubscription**](EventSubscription.md) + +### Authorization + +[apiKey](../README.md#apiKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/V0CommandArgs.md b/docs/V0CommandArgs.md index b8e0031..b2b1f36 100644 --- a/docs/V0CommandArgs.md +++ b/docs/V0CommandArgs.md @@ -8,8 +8,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **device_alias_name** | **str** | Alternate human-readable name for your Device | [optional] **custom_settings_config** | **object** | Managed configurations for your device (passed as JSON object) | [optional] -**app_version** | **str** | | [optional] -**package_name** | **str** | | [optional] +**app_version** | **str** | The version id of app uploaded on Esper | [optional] +**package_name** | **str** | The app package name uploaded on Esper | [optional] +**policy_url** | **str** | The URL to the policy | [optional] +**wifi_access_points** | **object** | Wifi access points for the device (passed as JSON object) | [optional] +**state** | **str** | LOCKED/UNLOCKED | [optional] +**message** | **str** | Message to be added with command | [optional] +**app_state** | **str** | The state of app - SHOW/HIDE/DISABLE | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/V0DeviceCommandEnum.md b/docs/V0DeviceCommandEnum.md index 5f26ed3..126a042 100644 --- a/docs/V0DeviceCommandEnum.md +++ b/docs/V0DeviceCommandEnum.md @@ -3,7 +3,7 @@ ### Description -Following commands are supported ``` * REBOOT: Reboot a device * UPDATE_HEARTBEAT: Ping a device * UPDATE_DEVICE_CONFIG: Push additional configurations to the Device * INSTALL: Install an app on a device. Requires `app_version` in command arguments where `app_version` is the version id of app uploaded on Esper * UNINSTALL: UnInstall an app from device. Requires `package_name` in command arguments where `package_name` is the app package uploaded on Esper ``` +Following commands are supported ``` * REBOOT: Reboot a device * UPDATE_HEARTBEAT: Ping a device * UPDATE_DEVICE_CONFIG: Push additional configurations to the Device * INSTALL: Install an app on a device. Requires `app_version` in command arguments where `app_version` is the version id of app uploaded on Esper * UNINSTALL: UnInstall an app from device. Requires `package_name` in command arguments where `package_name` is the app package uploaded on Esper * SET_NEW_POLICY : Apply policy on device. Requires `policy_url` in command arguments where `policy_url` is the URL to the policy * ADD_WIFI_AP : Add wifi access points for device. Requires `wifi_access_points` in command arguments where `wifi_access_points` is the data with access points * REMOVE_WIFI_AP : Remove Wifi access points for device. Requires `wifi_access_points` in command arguments where `wifi_access_points` is the data with access points * SET_KIOSK_APP : Command to set the Kiosk app for a device. Requires `package_name` in command arguments where `package_name` is the app package uploaded on Esper * SET_DEVICE_LOCKDOWN_STATE : Set lockdown state for a device. Requires `state` and `message` in command arguments where `state` is LOCKED/UNLOCKED and `message` is the message to be added with command * SET_APP_STATE : Set the state of an app - SHOW/HIDE/DISABLE. Requries `app_state` and `package_name` in command arguments where `app_state` is the state of app and `package_name` is the app package uploaded on Esper * WIPE : Wipes the device. * UPDATE_LATEST_DPC : Prompt device to update the DPC app to the latest versions. ``` ## Properties Name | Type @@ -13,6 +13,14 @@ Name | Type **UPDATE_DEVICE_CONFIG** | string **INSTALL** | string **UNINSTALL** | string +**SET_NEW_POLICY** | string +**ADD_WIFI_AP** | string +**REMOVE_WIFI_AP** | string +**SET_KIOSK_APP** | string +**SET_DEVICE_LOCKDOWN_STATE** | string +**SET_APP_STATE** | string +**WIPE** | string +**UPDATE_LATEST_DPC** | string [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/esperclient/__init__.py b/esperclient/__init__.py index 38f8a6c..11f1357 100644 --- a/esperclient/__init__.py +++ b/esperclient/__init__.py @@ -36,6 +36,7 @@ from esperclient.api.enterprise_policy_api import EnterprisePolicyApi from esperclient.api.geofence_api import GeofenceApi from esperclient.api.group_commands_api import GroupCommandsApi +from esperclient.api.subscription_api import SubscriptionApi from esperclient.api.token_api import TokenApi # import ApiClient @@ -58,6 +59,7 @@ from esperclient.models.device_command import DeviceCommand from esperclient.models.device_command_enum import DeviceCommandEnum from esperclient.models.device_group import DeviceGroup +from esperclient.models.device_group_partial_update import DeviceGroupPartialUpdate from esperclient.models.device_group_update import DeviceGroupUpdate from esperclient.models.device_status import DeviceStatus from esperclient.models.emm_device import EmmDevice @@ -68,8 +70,11 @@ from esperclient.models.enterprise_policy_data_frp_googles import EnterprisePolicyDataFrpGoogles from esperclient.models.enterprise_policy_data_google_account_permission import EnterprisePolicyDataGoogleAccountPermission from esperclient.models.enterprise_policy_data_phone_policy import EnterprisePolicyDataPhonePolicy +from esperclient.models.enterprise_policy_partial_update import EnterprisePolicyPartialUpdate from esperclient.models.enterprise_update_v1 import EnterpriseUpdateV1 from esperclient.models.enterprise_v1 import EnterpriseV1 +from esperclient.models.event_subscription import EventSubscription +from esperclient.models.event_subscription_args import EventSubscriptionArgs from esperclient.models.geofence import Geofence from esperclient.models.geofence_update import GeofenceUpdate from esperclient.models.google_emm import GoogleEMM @@ -81,6 +86,7 @@ from esperclient.models.inline_response2001 import InlineResponse2001 from esperclient.models.inline_response20010 import InlineResponse20010 from esperclient.models.inline_response20011 import InlineResponse20011 +from esperclient.models.inline_response20012 import InlineResponse20012 from esperclient.models.inline_response2002 import InlineResponse2002 from esperclient.models.inline_response2003 import InlineResponse2003 from esperclient.models.inline_response2004 import InlineResponse2004 @@ -103,6 +109,4 @@ from esperclient.models.v0_command_schedule_args_time_type_enum import V0CommandScheduleArgsTimeTypeEnum from esperclient.models.v0_command_schedule_enum import V0CommandScheduleEnum from esperclient.models.v0_command_status import V0CommandStatus -from esperclient.models.v0_command_status_update import V0CommandStatusUpdate -from esperclient.models.v0_command_status_update_details import V0CommandStatusUpdateDetails from esperclient.models.v0_device_command_enum import V0DeviceCommandEnum diff --git a/esperclient/api/__init__.py b/esperclient/api/__init__.py index f627b68..61968c8 100644 --- a/esperclient/api/__init__.py +++ b/esperclient/api/__init__.py @@ -10,4 +10,5 @@ from esperclient.api.enterprise_policy_api import EnterprisePolicyApi from esperclient.api.geofence_api import GeofenceApi from esperclient.api.group_commands_api import GroupCommandsApi +from esperclient.api.subscription_api import SubscriptionApi from esperclient.api.token_api import TokenApi diff --git a/esperclient/api/commands_v2_api.py b/esperclient/api/commands_v2_api.py index c9944c9..cf43116 100644 --- a/esperclient/api/commands_v2_api.py +++ b/esperclient/api/commands_v2_api.py @@ -480,126 +480,3 @@ def list_command_request_with_http_info(self, enterprise_id, **kwargs): _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - - def partial_update_command_status(self, enterprise_id, request_id, command_id, action, **kwargs): - """Update command status - - API to patch the state of command - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.partial_update_command_status(enterprise_id, request_id, command_id, action, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str enterprise_id: ID of the enterprise (required) - :param str request_id: ID for the command request (required) - :param str command_id: ID for the command (required) - :param str action: Action to be performed on device (required) - :param V0CommandStatusUpdate data: - :return: V0CommandStatus - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.partial_update_command_status_with_http_info(enterprise_id, request_id, command_id, action, **kwargs) - else: - (data) = self.partial_update_command_status_with_http_info(enterprise_id, request_id, command_id, action, **kwargs) - return data - - def partial_update_command_status_with_http_info(self, enterprise_id, request_id, command_id, action, **kwargs): - """Update command status - - API to patch the state of command - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.partial_update_command_status_with_http_info(enterprise_id, request_id, command_id, action, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str enterprise_id: ID of the enterprise (required) - :param str request_id: ID for the command request (required) - :param str command_id: ID for the command (required) - :param str action: Action to be performed on device (required) - :param V0CommandStatusUpdate data: - :return: V0CommandStatus - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['enterprise_id', 'request_id', 'command_id', 'action', 'data'] - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method partial_update_command_status" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'enterprise_id' is set - if ('enterprise_id' not in params or - params['enterprise_id'] is None): - raise ValueError("Missing the required parameter `enterprise_id` when calling `partial_update_command_status`") - # verify the required parameter 'request_id' is set - if ('request_id' not in params or - params['request_id'] is None): - raise ValueError("Missing the required parameter `request_id` when calling `partial_update_command_status`") - # verify the required parameter 'command_id' is set - if ('command_id' not in params or - params['command_id'] is None): - raise ValueError("Missing the required parameter `command_id` when calling `partial_update_command_status`") - # verify the required parameter 'action' is set - if ('action' not in params or - params['action'] is None): - raise ValueError("Missing the required parameter `action` when calling `partial_update_command_status`") - - collection_formats = {} - - path_params = {} - if 'enterprise_id' in params: - path_params['enterprise_id'] = params['enterprise_id'] - if 'request_id' in params: - path_params['request_id'] = params['request_id'] - if 'command_id' in params: - path_params['command_id'] = params['command_id'] - - query_params = [] - if 'action' in params: - query_params.append(('action', params['action'])) - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'data' in params: - body_params = params['data'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) - - # Authentication setting - auth_settings = ['apiKey'] - - return self.api_client.call_api( - '/v0/enterprise/{enterprise_id}/command/{request_id}/status/{command_id}/', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='V0CommandStatus', - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) diff --git a/esperclient/api/device_group_api.py b/esperclient/api/device_group_api.py index 48c1339..0945cb5 100644 --- a/esperclient/api/device_group_api.py +++ b/esperclient/api/device_group_api.py @@ -56,7 +56,7 @@ def create_group(self, enterprise_id, data, **kwargs): :param async_req bool :param str enterprise_id: A UUID string identifying enterprise. (required) - :param DeviceGroup data: (required) + :param DeviceGroupUpdate data: (required) :return: DeviceGroup If the method is called asynchronously, returns the request thread. @@ -79,7 +79,7 @@ def create_group_with_http_info(self, enterprise_id, data, **kwargs): :param async_req bool :param str enterprise_id: A UUID string identifying enterprise. (required) - :param DeviceGroup data: (required) + :param DeviceGroupUpdate data: (required) :return: DeviceGroup If the method is called asynchronously, returns the request thread. @@ -262,7 +262,7 @@ def get_all_groups(self, enterprise_id, **kwargs): :param async_req bool :param str enterprise_id: A UUID string identifying enterprise. (required) - :param str name: filter by group name + :param str name: Filter by group name :param int limit: Number of results to return per page. :param int offset: The initial index from which to return the results. :return: InlineResponse2007 @@ -287,7 +287,7 @@ def get_all_groups_with_http_info(self, enterprise_id, **kwargs): :param async_req bool :param str enterprise_id: A UUID string identifying enterprise. (required) - :param str name: filter by group name + :param str name: Filter by group name :param int limit: Number of results to return per page. :param int offset: The initial index from which to return the results. :return: InlineResponse2007 @@ -473,7 +473,8 @@ def partial_update_group(self, group_id, enterprise_id, data, **kwargs): :param async_req bool :param str group_id: A UUID string identifying this enterprise device group. (required) :param str enterprise_id: A UUID string identifying enterprise. (required) - :param DeviceGroupUpdate data: (required) + :param DeviceGroupPartialUpdate data: (required) + :param str action: add / remove / rename / move :return: DeviceGroup If the method is called asynchronously, returns the request thread. @@ -497,13 +498,14 @@ def partial_update_group_with_http_info(self, group_id, enterprise_id, data, **k :param async_req bool :param str group_id: A UUID string identifying this enterprise device group. (required) :param str enterprise_id: A UUID string identifying enterprise. (required) - :param DeviceGroupUpdate data: (required) + :param DeviceGroupPartialUpdate data: (required) + :param str action: add / remove / rename / move :return: DeviceGroup If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'enterprise_id', 'data'] + all_params = ['group_id', 'enterprise_id', 'data', 'action'] all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -540,6 +542,8 @@ def partial_update_group_with_http_info(self, group_id, enterprise_id, data, **k path_params['enterprise_id'] = params['enterprise_id'] query_params = [] + if 'action' in params: + query_params.append(('action', params['action'])) header_params = {} @@ -585,6 +589,7 @@ def update_group(self, group_id, enterprise_id, data, **kwargs): :param str group_id: A UUID string identifying this enterprise device group. (required) :param str enterprise_id: A UUID string identifying enterprise. (required) :param DeviceGroupUpdate data: (required) + :param str action: add / remove / rename / move :return: DeviceGroup If the method is called asynchronously, returns the request thread. @@ -609,12 +614,13 @@ def update_group_with_http_info(self, group_id, enterprise_id, data, **kwargs): :param str group_id: A UUID string identifying this enterprise device group. (required) :param str enterprise_id: A UUID string identifying enterprise. (required) :param DeviceGroupUpdate data: (required) + :param str action: add / remove / rename / move :return: DeviceGroup If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'enterprise_id', 'data'] + all_params = ['group_id', 'enterprise_id', 'data', 'action'] all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -651,6 +657,8 @@ def update_group_with_http_info(self, group_id, enterprise_id, data, **kwargs): path_params['enterprise_id'] = params['enterprise_id'] query_params = [] + if 'action' in params: + query_params.append(('action', params['action'])) header_params = {} diff --git a/esperclient/api/enterprise_policy_api.py b/esperclient/api/enterprise_policy_api.py index 6e841c3..a4e3975 100644 --- a/esperclient/api/enterprise_policy_api.py +++ b/esperclient/api/enterprise_policy_api.py @@ -477,7 +477,7 @@ def partialupdate_policy(self, policy_id, enterprise_id, data, **kwargs): :param async_req bool :param int policy_id: An integer identifying this EnterprisePolicy. (required) :param str enterprise_id: A UUID string identifying enterprise. (required) - :param EnterprisePolicy data: (required) + :param EnterprisePolicyPartialUpdate data: (required) :return: EnterprisePolicy If the method is called asynchronously, returns the request thread. @@ -501,7 +501,7 @@ def partialupdate_policy_with_http_info(self, policy_id, enterprise_id, data, ** :param async_req bool :param int policy_id: An integer identifying this EnterprisePolicy. (required) :param str enterprise_id: A UUID string identifying enterprise. (required) - :param EnterprisePolicy data: (required) + :param EnterprisePolicyPartialUpdate data: (required) :return: EnterprisePolicy If the method is called asynchronously, returns the request thread. diff --git a/esperclient/api/subscription_api.py b/esperclient/api/subscription_api.py new file mode 100644 index 0000000..38a6c83 --- /dev/null +++ b/esperclient/api/subscription_api.py @@ -0,0 +1,458 @@ +# coding: utf-8 + +""" +ESPER API REFERENCE + +OpenAPI spec version: 1.0.0 +Contact: developer@esper.io +--------------------------------------------------------- + +Copyright 2019 Shoonya Enterprises Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + + + +from __future__ import absolute_import + +import re + +# python 2 and python 3 compatibility library +import six + +from esperclient.api_client import ApiClient + + +class SubscriptionApi(object): + """NOTE: This class is auto generated. + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_subscription(self, data, enterprise_id, **kwargs): + """Create a Subscription + + Returns Subscription instance + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_subscription(data, enterprise_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param EventSubscriptionArgs data: (required) + :param str enterprise_id: A UUID string identifying the enterprise. (required) + :return: EventSubscription + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_subscription_with_http_info(data, enterprise_id, **kwargs) + else: + (data) = self.create_subscription_with_http_info(data, enterprise_id, **kwargs) + return data + + def create_subscription_with_http_info(self, data, enterprise_id, **kwargs): + """Create a Subscription + + Returns Subscription instance + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_subscription_with_http_info(data, enterprise_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param EventSubscriptionArgs data: (required) + :param str enterprise_id: A UUID string identifying the enterprise. (required) + :return: EventSubscription + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['data', 'enterprise_id'] + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_subscription" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'data' is set + if ('data' not in params or + params['data'] is None): + raise ValueError("Missing the required parameter `data` when calling `create_subscription`") + # verify the required parameter 'enterprise_id' is set + if ('enterprise_id' not in params or + params['enterprise_id'] is None): + raise ValueError("Missing the required parameter `enterprise_id` when calling `create_subscription`") + + collection_formats = {} + + path_params = {} + if 'enterprise_id' in params: + path_params['enterprise_id'] = params['enterprise_id'] + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'data' in params: + body_params = params['data'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) + + # Authentication setting + auth_settings = ['apiKey'] + + return self.api_client.call_api( + '/v0/enterprise/{enterprise_id}/subscription/', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EventSubscription', + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_subscription(self, subscription_id, enterprise_id, **kwargs): + """Delete a subscription + + Empty response + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_subscription(subscription_id, enterprise_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str subscription_id: A UUID string identifying the subscription. (required) + :param str enterprise_id: A UUID string identifying the enterprise. (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_subscription_with_http_info(subscription_id, enterprise_id, **kwargs) + else: + (data) = self.delete_subscription_with_http_info(subscription_id, enterprise_id, **kwargs) + return data + + def delete_subscription_with_http_info(self, subscription_id, enterprise_id, **kwargs): + """Delete a subscription + + Empty response + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_subscription_with_http_info(subscription_id, enterprise_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str subscription_id: A UUID string identifying the subscription. (required) + :param str enterprise_id: A UUID string identifying the enterprise. (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['subscription_id', 'enterprise_id'] + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_subscription" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'subscription_id' is set + if ('subscription_id' not in params or + params['subscription_id'] is None): + raise ValueError("Missing the required parameter `subscription_id` when calling `delete_subscription`") + # verify the required parameter 'enterprise_id' is set + if ('enterprise_id' not in params or + params['enterprise_id'] is None): + raise ValueError("Missing the required parameter `enterprise_id` when calling `delete_subscription`") + + collection_formats = {} + + path_params = {} + if 'subscription_id' in params: + path_params['subscription_id'] = params['subscription_id'] + if 'enterprise_id' in params: + path_params['enterprise_id'] = params['enterprise_id'] + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) + + # Authentication setting + auth_settings = ['apiKey'] + + return self.api_client.call_api( + '/v0/enterprise/{enterprise_id}/subscription/{subscription_id}/', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_all_subscriptions(self, enterprise_id, **kwargs): + """List Subscriptions in Enterprise + + API to view all the subscriptions in an enterprise + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all_subscriptions(enterprise_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str enterprise_id: A UUID string identifying the enterprise. (required) + :param int limit: Number of results to return per page. + :param int offset: The initial index from which to return the results. + :return: InlineResponse20012 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_all_subscriptions_with_http_info(enterprise_id, **kwargs) + else: + (data) = self.get_all_subscriptions_with_http_info(enterprise_id, **kwargs) + return data + + def get_all_subscriptions_with_http_info(self, enterprise_id, **kwargs): + """List Subscriptions in Enterprise + + API to view all the subscriptions in an enterprise + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all_subscriptions_with_http_info(enterprise_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str enterprise_id: A UUID string identifying the enterprise. (required) + :param int limit: Number of results to return per page. + :param int offset: The initial index from which to return the results. + :return: InlineResponse20012 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['enterprise_id', 'limit', 'offset'] + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_all_subscriptions" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'enterprise_id' is set + if ('enterprise_id' not in params or + params['enterprise_id'] is None): + raise ValueError("Missing the required parameter `enterprise_id` when calling `get_all_subscriptions`") + + collection_formats = {} + + path_params = {} + if 'enterprise_id' in params: + path_params['enterprise_id'] = params['enterprise_id'] + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) + if 'offset' in params: + query_params.append(('offset', params['offset'])) + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) + + # Authentication setting + auth_settings = ['apiKey'] + + return self.api_client.call_api( + '/v0/enterprise/{enterprise_id}/subscription/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='InlineResponse20012', + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_subscription(self, subscription_id, enterprise_id, **kwargs): + """Get subscription information + + Returns subscription instance + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_subscription(subscription_id, enterprise_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str subscription_id: A UUID string identifying the subscription. (required) + :param str enterprise_id: A UUID string identifying the enterprise. (required) + :return: EventSubscription + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_subscription_with_http_info(subscription_id, enterprise_id, **kwargs) + else: + (data) = self.get_subscription_with_http_info(subscription_id, enterprise_id, **kwargs) + return data + + def get_subscription_with_http_info(self, subscription_id, enterprise_id, **kwargs): + """Get subscription information + + Returns subscription instance + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_subscription_with_http_info(subscription_id, enterprise_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str subscription_id: A UUID string identifying the subscription. (required) + :param str enterprise_id: A UUID string identifying the enterprise. (required) + :return: EventSubscription + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['subscription_id', 'enterprise_id'] + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_subscription" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'subscription_id' is set + if ('subscription_id' not in params or + params['subscription_id'] is None): + raise ValueError("Missing the required parameter `subscription_id` when calling `get_subscription`") + # verify the required parameter 'enterprise_id' is set + if ('enterprise_id' not in params or + params['enterprise_id'] is None): + raise ValueError("Missing the required parameter `enterprise_id` when calling `get_subscription`") + + collection_formats = {} + + path_params = {} + if 'subscription_id' in params: + path_params['subscription_id'] = params['subscription_id'] + if 'enterprise_id' in params: + path_params['enterprise_id'] = params['enterprise_id'] + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) + + # Authentication setting + auth_settings = ['apiKey'] + + return self.api_client.call_api( + '/v0/enterprise/{enterprise_id}/subscription/{subscription_id}/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EventSubscription', + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/esperclient/api_client.py b/esperclient/api_client.py index 4a1f37d..fe94ca9 100644 --- a/esperclient/api_client.py +++ b/esperclient/api_client.py @@ -87,7 +87,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'Swagger-Codegen/0.0.15/python' + self.user_agent = 'Swagger-Codegen/0.1.0/python' def __del__(self): if self._pool is not None: diff --git a/esperclient/configuration.py b/esperclient/configuration.py index 0e83cce..06edf59 100644 --- a/esperclient/configuration.py +++ b/esperclient/configuration.py @@ -253,5 +253,5 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 1.0.0\n"\ - "SDK Package Version: 0.0.15".\ + "SDK Package Version: 0.1.0".\ format(env=sys.platform, pyversion=sys.version) diff --git a/esperclient/models/__init__.py b/esperclient/models/__init__.py index 917b5d5..6c88aa6 100644 --- a/esperclient/models/__init__.py +++ b/esperclient/models/__init__.py @@ -43,6 +43,7 @@ from esperclient.models.device_command import DeviceCommand from esperclient.models.device_command_enum import DeviceCommandEnum from esperclient.models.device_group import DeviceGroup +from esperclient.models.device_group_partial_update import DeviceGroupPartialUpdate from esperclient.models.device_group_update import DeviceGroupUpdate from esperclient.models.device_status import DeviceStatus from esperclient.models.emm_device import EmmDevice @@ -53,8 +54,11 @@ from esperclient.models.enterprise_policy_data_frp_googles import EnterprisePolicyDataFrpGoogles from esperclient.models.enterprise_policy_data_google_account_permission import EnterprisePolicyDataGoogleAccountPermission from esperclient.models.enterprise_policy_data_phone_policy import EnterprisePolicyDataPhonePolicy +from esperclient.models.enterprise_policy_partial_update import EnterprisePolicyPartialUpdate from esperclient.models.enterprise_update_v1 import EnterpriseUpdateV1 from esperclient.models.enterprise_v1 import EnterpriseV1 +from esperclient.models.event_subscription import EventSubscription +from esperclient.models.event_subscription_args import EventSubscriptionArgs from esperclient.models.geofence import Geofence from esperclient.models.geofence_update import GeofenceUpdate from esperclient.models.google_emm import GoogleEMM @@ -66,6 +70,7 @@ from esperclient.models.inline_response2001 import InlineResponse2001 from esperclient.models.inline_response20010 import InlineResponse20010 from esperclient.models.inline_response20011 import InlineResponse20011 +from esperclient.models.inline_response20012 import InlineResponse20012 from esperclient.models.inline_response2002 import InlineResponse2002 from esperclient.models.inline_response2003 import InlineResponse2003 from esperclient.models.inline_response2004 import InlineResponse2004 @@ -88,6 +93,4 @@ from esperclient.models.v0_command_schedule_args_time_type_enum import V0CommandScheduleArgsTimeTypeEnum from esperclient.models.v0_command_schedule_enum import V0CommandScheduleEnum from esperclient.models.v0_command_status import V0CommandStatus -from esperclient.models.v0_command_status_update import V0CommandStatusUpdate -from esperclient.models.v0_command_status_update_details import V0CommandStatusUpdateDetails from esperclient.models.v0_device_command_enum import V0DeviceCommandEnum diff --git a/esperclient/models/device_group.py b/esperclient/models/device_group.py index 759dc19..2080e75 100644 --- a/esperclient/models/device_group.py +++ b/esperclient/models/device_group.py @@ -45,44 +45,60 @@ class DeviceGroup(object): """ swagger_types = { 'id': 'str', - 'device_count': 'int', 'name': 'str', 'created_on': 'datetime', - 'enterprise': 'str' + 'enterprise': 'str', + 'parent': 'str', + 'device_count': 'int', + 'path': 'str', + 'children_count': 'int' } attribute_map = { 'id': 'id', - 'device_count': 'device_count', 'name': 'name', 'created_on': 'created_on', - 'enterprise': 'enterprise' + 'enterprise': 'enterprise', + 'parent': 'parent', + 'device_count': 'device_count', + 'path': 'path', + 'children_count': 'children_count' } - def __init__(self, id=None, device_count=None, name=None, created_on=None, enterprise=None): + def __init__(self, id=None, name=None, created_on=None, enterprise=None, parent=None, device_count=None, path=None, children_count=None): """DeviceGroup - a model defined in Swagger""" self._id = None - self._device_count = None self._name = None self._created_on = None self._enterprise = None + self._parent = None + self._device_count = None + self._path = None + self._children_count = None self.discriminator = None if id is not None: self.id = id - if device_count is not None: - self.device_count = device_count self.name = name if created_on is not None: self.created_on = created_on if enterprise is not None: self.enterprise = enterprise + if parent is not None: + self.parent = parent + if device_count is not None: + self.device_count = device_count + if path is not None: + self.path = path + if children_count is not None: + self.children_count = children_count @property def id(self): """Gets the id of this DeviceGroup. + Group id :return: The id of this DeviceGroup. :rtype: str @@ -93,6 +109,7 @@ def id(self): def id(self, id): """Sets the id of this DeviceGroup. + Group id :param id: The id of this DeviceGroup. :type: str @@ -100,31 +117,11 @@ def id(self, id): self._id = id - @property - def device_count(self): - """Gets the device_count of this DeviceGroup. - - - :return: The device_count of this DeviceGroup. - :rtype: int - """ - return self._device_count - - @device_count.setter - def device_count(self, device_count): - """Sets the device_count of this DeviceGroup. - - - :param device_count: The device_count of this DeviceGroup. - :type: int - """ - - self._device_count = device_count - @property def name(self): """Gets the name of this DeviceGroup. + Group name :return: The name of this DeviceGroup. :rtype: str @@ -135,16 +132,13 @@ def name(self): def name(self, name): """Sets the name of this DeviceGroup. + Group name :param name: The name of this DeviceGroup. :type: str """ if name is None: raise ValueError("Invalid value for `name`, must not be `None`") - if name is not None and len(name) > 255: - raise ValueError("Invalid value for `name`, length must be less than or equal to `255`") - if name is not None and len(name) < 1: - raise ValueError("Invalid value for `name`, length must be greater than or equal to `1`") self._name = name @@ -152,6 +146,7 @@ def name(self, name): def created_on(self): """Gets the created_on of this DeviceGroup. + Date and time of when the group was created :return: The created_on of this DeviceGroup. :rtype: datetime @@ -162,6 +157,7 @@ def created_on(self): def created_on(self, created_on): """Sets the created_on of this DeviceGroup. + Date and time of when the group was created :param created_on: The created_on of this DeviceGroup. :type: datetime @@ -173,6 +169,7 @@ def created_on(self, created_on): def enterprise(self): """Gets the enterprise of this DeviceGroup. + Enterprise url :return: The enterprise of this DeviceGroup. :rtype: str @@ -183,6 +180,7 @@ def enterprise(self): def enterprise(self, enterprise): """Sets the enterprise of this DeviceGroup. + Enterprise url :param enterprise: The enterprise of this DeviceGroup. :type: str @@ -190,6 +188,98 @@ def enterprise(self, enterprise): self._enterprise = enterprise + @property + def parent(self): + """Gets the parent of this DeviceGroup. + + Parent group url + + :return: The parent of this DeviceGroup. + :rtype: str + """ + return self._parent + + @parent.setter + def parent(self, parent): + """Sets the parent of this DeviceGroup. + + Parent group url + + :param parent: The parent of this DeviceGroup. + :type: str + """ + + self._parent = parent + + @property + def device_count(self): + """Gets the device_count of this DeviceGroup. + + Count of devices in the group + + :return: The device_count of this DeviceGroup. + :rtype: int + """ + return self._device_count + + @device_count.setter + def device_count(self, device_count): + """Sets the device_count of this DeviceGroup. + + Count of devices in the group + + :param device_count: The device_count of this DeviceGroup. + :type: int + """ + + self._device_count = device_count + + @property + def path(self): + """Gets the path of this DeviceGroup. + + Path of the group + + :return: The path of this DeviceGroup. + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """Sets the path of this DeviceGroup. + + Path of the group + + :param path: The path of this DeviceGroup. + :type: str + """ + + self._path = path + + @property + def children_count(self): + """Gets the children_count of this DeviceGroup. + + Count of child groups + + :return: The children_count of this DeviceGroup. + :rtype: int + """ + return self._children_count + + @children_count.setter + def children_count(self, children_count): + """Sets the children_count of this DeviceGroup. + + Count of child groups + + :param children_count: The children_count of this DeviceGroup. + :type: int + """ + + self._children_count = children_count + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/esperclient/models/device_group_partial_update.py b/esperclient/models/device_group_partial_update.py new file mode 100644 index 0000000..35cdf29 --- /dev/null +++ b/esperclient/models/device_group_partial_update.py @@ -0,0 +1,354 @@ +# coding: utf-8 + +""" +ESPER API REFERENCE + +OpenAPI spec version: 1.0.0 +Contact: developer@esper.io +--------------------------------------------------------- + +Copyright 2019 Shoonya Enterprises Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + + + +import pprint +import re + +import six + + +class DeviceGroupPartialUpdate(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'name': 'str', + 'created_on': 'datetime', + 'enterprise': 'str', + 'parent': 'str', + 'device_ids': 'list[str]', + 'device_count': 'int', + 'path': 'str', + 'children_count': 'int' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'created_on': 'created_on', + 'enterprise': 'enterprise', + 'parent': 'parent', + 'device_ids': 'device_ids', + 'device_count': 'device_count', + 'path': 'path', + 'children_count': 'children_count' + } + + def __init__(self, id=None, name=None, created_on=None, enterprise=None, parent=None, device_ids=None, device_count=None, path=None, children_count=None): + """DeviceGroupPartialUpdate - a model defined in Swagger""" + + self._id = None + self._name = None + self._created_on = None + self._enterprise = None + self._parent = None + self._device_ids = None + self._device_count = None + self._path = None + self._children_count = None + self.discriminator = None + + if id is not None: + self.id = id + if name is not None: + self.name = name + if created_on is not None: + self.created_on = created_on + if enterprise is not None: + self.enterprise = enterprise + if parent is not None: + self.parent = parent + if device_ids is not None: + self.device_ids = device_ids + if device_count is not None: + self.device_count = device_count + if path is not None: + self.path = path + if children_count is not None: + self.children_count = children_count + + @property + def id(self): + """Gets the id of this DeviceGroupPartialUpdate. + + Group id + + :return: The id of this DeviceGroupPartialUpdate. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this DeviceGroupPartialUpdate. + + Group id + + :param id: The id of this DeviceGroupPartialUpdate. + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this DeviceGroupPartialUpdate. + + Group name + + :return: The name of this DeviceGroupPartialUpdate. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this DeviceGroupPartialUpdate. + + Group name + + :param name: The name of this DeviceGroupPartialUpdate. + :type: str + """ + + self._name = name + + @property + def created_on(self): + """Gets the created_on of this DeviceGroupPartialUpdate. + + Date and time of when the group was created + + :return: The created_on of this DeviceGroupPartialUpdate. + :rtype: datetime + """ + return self._created_on + + @created_on.setter + def created_on(self, created_on): + """Sets the created_on of this DeviceGroupPartialUpdate. + + Date and time of when the group was created + + :param created_on: The created_on of this DeviceGroupPartialUpdate. + :type: datetime + """ + + self._created_on = created_on + + @property + def enterprise(self): + """Gets the enterprise of this DeviceGroupPartialUpdate. + + Enterprise url + + :return: The enterprise of this DeviceGroupPartialUpdate. + :rtype: str + """ + return self._enterprise + + @enterprise.setter + def enterprise(self, enterprise): + """Sets the enterprise of this DeviceGroupPartialUpdate. + + Enterprise url + + :param enterprise: The enterprise of this DeviceGroupPartialUpdate. + :type: str + """ + + self._enterprise = enterprise + + @property + def parent(self): + """Gets the parent of this DeviceGroupPartialUpdate. + + Parent group id + + :return: The parent of this DeviceGroupPartialUpdate. + :rtype: str + """ + return self._parent + + @parent.setter + def parent(self, parent): + """Sets the parent of this DeviceGroupPartialUpdate. + + Parent group id + + :param parent: The parent of this DeviceGroupPartialUpdate. + :type: str + """ + + self._parent = parent + + @property + def device_ids(self): + """Gets the device_ids of this DeviceGroupPartialUpdate. + + Device ids + + :return: The device_ids of this DeviceGroupPartialUpdate. + :rtype: list[str] + """ + return self._device_ids + + @device_ids.setter + def device_ids(self, device_ids): + """Sets the device_ids of this DeviceGroupPartialUpdate. + + Device ids + + :param device_ids: The device_ids of this DeviceGroupPartialUpdate. + :type: list[str] + """ + + self._device_ids = device_ids + + @property + def device_count(self): + """Gets the device_count of this DeviceGroupPartialUpdate. + + Count of devices in the group + + :return: The device_count of this DeviceGroupPartialUpdate. + :rtype: int + """ + return self._device_count + + @device_count.setter + def device_count(self, device_count): + """Sets the device_count of this DeviceGroupPartialUpdate. + + Count of devices in the group + + :param device_count: The device_count of this DeviceGroupPartialUpdate. + :type: int + """ + + self._device_count = device_count + + @property + def path(self): + """Gets the path of this DeviceGroupPartialUpdate. + + Path of the group + + :return: The path of this DeviceGroupPartialUpdate. + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """Sets the path of this DeviceGroupPartialUpdate. + + Path of the group + + :param path: The path of this DeviceGroupPartialUpdate. + :type: str + """ + + self._path = path + + @property + def children_count(self): + """Gets the children_count of this DeviceGroupPartialUpdate. + + Count of child groups + + :return: The children_count of this DeviceGroupPartialUpdate. + :rtype: int + """ + return self._children_count + + @children_count.setter + def children_count(self, children_count): + """Sets the children_count of this DeviceGroupPartialUpdate. + + Count of child groups + + :param children_count: The children_count of this DeviceGroupPartialUpdate. + :type: int + """ + + self._children_count = children_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DeviceGroupPartialUpdate, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DeviceGroupPartialUpdate): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/esperclient/models/device_group_update.py b/esperclient/models/device_group_update.py index 88a0300..7acd99a 100644 --- a/esperclient/models/device_group_update.py +++ b/esperclient/models/device_group_update.py @@ -45,50 +45,65 @@ class DeviceGroupUpdate(object): """ swagger_types = { 'id': 'str', - 'device_ids': 'list[str]', - 'device_count': 'int', 'name': 'str', 'created_on': 'datetime', - 'enterprise': 'str' + 'enterprise': 'str', + 'parent': 'str', + 'device_ids': 'list[str]', + 'device_count': 'int', + 'path': 'str', + 'children_count': 'int' } attribute_map = { 'id': 'id', - 'device_ids': 'device_ids', - 'device_count': 'device_count', 'name': 'name', 'created_on': 'created_on', - 'enterprise': 'enterprise' + 'enterprise': 'enterprise', + 'parent': 'parent', + 'device_ids': 'device_ids', + 'device_count': 'device_count', + 'path': 'path', + 'children_count': 'children_count' } - def __init__(self, id=None, device_ids=None, device_count=None, name=None, created_on=None, enterprise=None): + def __init__(self, id=None, name=None, created_on=None, enterprise=None, parent=None, device_ids=None, device_count=None, path=None, children_count=None): """DeviceGroupUpdate - a model defined in Swagger""" self._id = None - self._device_ids = None - self._device_count = None self._name = None self._created_on = None self._enterprise = None + self._parent = None + self._device_ids = None + self._device_count = None + self._path = None + self._children_count = None self.discriminator = None if id is not None: self.id = id - if device_ids is not None: - self.device_ids = device_ids - if device_count is not None: - self.device_count = device_count - if name is not None: - self.name = name + self.name = name if created_on is not None: self.created_on = created_on if enterprise is not None: self.enterprise = enterprise + if parent is not None: + self.parent = parent + if device_ids is not None: + self.device_ids = device_ids + if device_count is not None: + self.device_count = device_count + if path is not None: + self.path = path + if children_count is not None: + self.children_count = children_count @property def id(self): """Gets the id of this DeviceGroupUpdate. + Group id :return: The id of this DeviceGroupUpdate. :rtype: str @@ -99,6 +114,7 @@ def id(self): def id(self, id): """Sets the id of this DeviceGroupUpdate. + Group id :param id: The id of this DeviceGroupUpdate. :type: str @@ -106,10 +122,105 @@ def id(self, id): self._id = id + @property + def name(self): + """Gets the name of this DeviceGroupUpdate. + + Group name + + :return: The name of this DeviceGroupUpdate. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this DeviceGroupUpdate. + + Group name + + :param name: The name of this DeviceGroupUpdate. + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") + + self._name = name + + @property + def created_on(self): + """Gets the created_on of this DeviceGroupUpdate. + + Date and time of when the group was created + + :return: The created_on of this DeviceGroupUpdate. + :rtype: datetime + """ + return self._created_on + + @created_on.setter + def created_on(self, created_on): + """Sets the created_on of this DeviceGroupUpdate. + + Date and time of when the group was created + + :param created_on: The created_on of this DeviceGroupUpdate. + :type: datetime + """ + + self._created_on = created_on + + @property + def enterprise(self): + """Gets the enterprise of this DeviceGroupUpdate. + + Enterprise url + + :return: The enterprise of this DeviceGroupUpdate. + :rtype: str + """ + return self._enterprise + + @enterprise.setter + def enterprise(self, enterprise): + """Sets the enterprise of this DeviceGroupUpdate. + + Enterprise url + + :param enterprise: The enterprise of this DeviceGroupUpdate. + :type: str + """ + + self._enterprise = enterprise + + @property + def parent(self): + """Gets the parent of this DeviceGroupUpdate. + + Parent group id + + :return: The parent of this DeviceGroupUpdate. + :rtype: str + """ + return self._parent + + @parent.setter + def parent(self, parent): + """Sets the parent of this DeviceGroupUpdate. + + Parent group id + + :param parent: The parent of this DeviceGroupUpdate. + :type: str + """ + + self._parent = parent + @property def device_ids(self): """Gets the device_ids of this DeviceGroupUpdate. + Devices ids :return: The device_ids of this DeviceGroupUpdate. :rtype: list[str] @@ -120,6 +231,7 @@ def device_ids(self): def device_ids(self, device_ids): """Sets the device_ids of this DeviceGroupUpdate. + Devices ids :param device_ids: The device_ids of this DeviceGroupUpdate. :type: list[str] @@ -149,71 +261,50 @@ def device_count(self, device_count): self._device_count = device_count @property - def name(self): - """Gets the name of this DeviceGroupUpdate. + def path(self): + """Gets the path of this DeviceGroupUpdate. + Path of the group - :return: The name of this DeviceGroupUpdate. + :return: The path of this DeviceGroupUpdate. :rtype: str """ - return self._name + return self._path - @name.setter - def name(self, name): - """Sets the name of this DeviceGroupUpdate. + @path.setter + def path(self, path): + """Sets the path of this DeviceGroupUpdate. + Path of the group - :param name: The name of this DeviceGroupUpdate. + :param path: The path of this DeviceGroupUpdate. :type: str """ - if name is not None and len(name) > 255: - raise ValueError("Invalid value for `name`, length must be less than or equal to `255`") - if name is not None and len(name) < 1: - raise ValueError("Invalid value for `name`, length must be greater than or equal to `1`") - self._name = name + self._path = path @property - def created_on(self): - """Gets the created_on of this DeviceGroupUpdate. - - - :return: The created_on of this DeviceGroupUpdate. - :rtype: datetime - """ - return self._created_on - - @created_on.setter - def created_on(self, created_on): - """Sets the created_on of this DeviceGroupUpdate. - - - :param created_on: The created_on of this DeviceGroupUpdate. - :type: datetime - """ + def children_count(self): + """Gets the children_count of this DeviceGroupUpdate. - self._created_on = created_on - - @property - def enterprise(self): - """Gets the enterprise of this DeviceGroupUpdate. + Count of child groups - - :return: The enterprise of this DeviceGroupUpdate. - :rtype: str + :return: The children_count of this DeviceGroupUpdate. + :rtype: int """ - return self._enterprise + return self._children_count - @enterprise.setter - def enterprise(self, enterprise): - """Sets the enterprise of this DeviceGroupUpdate. + @children_count.setter + def children_count(self, children_count): + """Sets the children_count of this DeviceGroupUpdate. + Count of child groups - :param enterprise: The enterprise of this DeviceGroupUpdate. - :type: str + :param children_count: The children_count of this DeviceGroupUpdate. + :type: int """ - self._enterprise = enterprise + self._children_count = children_count def to_dict(self): """Returns the model properties as a dict""" diff --git a/esperclient/models/enterprise_policy.py b/esperclient/models/enterprise_policy.py index 8c9ced2..7752d06 100644 --- a/esperclient/models/enterprise_policy.py +++ b/esperclient/models/enterprise_policy.py @@ -46,12 +46,13 @@ class EnterprisePolicy(object): and the value is json key in definition. """ swagger_types = { - 'id': 'int', 'uuid': 'str', + 'enterprise': 'str', 'url': 'str', 'name': 'str', 'description': 'str', 'device_count': 'int', + 'google_policy_id': 'str', 'policy': 'EnterprisePolicyData', 'updated_on': 'datetime', 'created_on': 'datetime', @@ -59,47 +60,48 @@ class EnterprisePolicy(object): } attribute_map = { - 'id': 'id', 'uuid': 'uuid', + 'enterprise': 'enterprise', 'url': 'url', 'name': 'name', 'description': 'description', 'device_count': 'device_count', + 'google_policy_id': 'google_policy_id', 'policy': 'policy', 'updated_on': 'updated_on', 'created_on': 'created_on', 'is_active': 'is_active' } - def __init__(self, id=None, uuid=None, url=None, name=None, description=None, device_count=None, policy=None, updated_on=None, created_on=None, is_active=None): + def __init__(self, uuid=None, enterprise=None, url=None, name=None, description=None, device_count=None, google_policy_id=None, policy=None, updated_on=None, created_on=None, is_active=None): """EnterprisePolicy - a model defined in Swagger""" - self._id = None self._uuid = None + self._enterprise = None self._url = None self._name = None self._description = None self._device_count = None + self._google_policy_id = None self._policy = None self._updated_on = None self._created_on = None self._is_active = None self.discriminator = None - if id is not None: - self.id = id if uuid is not None: self.uuid = uuid + self.enterprise = enterprise if url is not None: self.url = url - if name is not None: - self.name = name + self.name = name if description is not None: self.description = description if device_count is not None: self.device_count = device_count - if policy is not None: - self.policy = policy + if google_policy_id is not None: + self.google_policy_id = google_policy_id + self.policy = policy if updated_on is not None: self.updated_on = updated_on if created_on is not None: @@ -108,50 +110,52 @@ def __init__(self, id=None, uuid=None, url=None, name=None, description=None, de self.is_active = is_active @property - def id(self): - """Gets the id of this EnterprisePolicy. + def uuid(self): + """Gets the uuid of this EnterprisePolicy. Unique Policy identifier - :return: The id of this EnterprisePolicy. - :rtype: int + :return: The uuid of this EnterprisePolicy. + :rtype: str """ - return self._id + return self._uuid - @id.setter - def id(self, id): - """Sets the id of this EnterprisePolicy. + @uuid.setter + def uuid(self, uuid): + """Sets the uuid of this EnterprisePolicy. Unique Policy identifier - :param id: The id of this EnterprisePolicy. - :type: int + :param uuid: The uuid of this EnterprisePolicy. + :type: str """ - self._id = id + self._uuid = uuid @property - def uuid(self): - """Gets the uuid of this EnterprisePolicy. + def enterprise(self): + """Gets the enterprise of this EnterprisePolicy. - Unique Policy identifier + Url of the enterprise resource - :return: The uuid of this EnterprisePolicy. + :return: The enterprise of this EnterprisePolicy. :rtype: str """ - return self._uuid + return self._enterprise - @uuid.setter - def uuid(self, uuid): - """Sets the uuid of this EnterprisePolicy. + @enterprise.setter + def enterprise(self, enterprise): + """Sets the enterprise of this EnterprisePolicy. - Unique Policy identifier + Url of the enterprise resource - :param uuid: The uuid of this EnterprisePolicy. + :param enterprise: The enterprise of this EnterprisePolicy. :type: str """ + if enterprise is None: + raise ValueError("Invalid value for `enterprise`, must not be `None`") - self._uuid = uuid + self._enterprise = enterprise @property def url(self): @@ -196,6 +200,8 @@ def name(self, name): :param name: The name of this EnterprisePolicy. :type: str """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") self._name = name @@ -245,6 +251,29 @@ def device_count(self, device_count): self._device_count = device_count + @property + def google_policy_id(self): + """Gets the google_policy_id of this EnterprisePolicy. + + Id of the Google policy + + :return: The google_policy_id of this EnterprisePolicy. + :rtype: str + """ + return self._google_policy_id + + @google_policy_id.setter + def google_policy_id(self, google_policy_id): + """Sets the google_policy_id of this EnterprisePolicy. + + Id of the Google policy + + :param google_policy_id: The google_policy_id of this EnterprisePolicy. + :type: str + """ + + self._google_policy_id = google_policy_id + @property def policy(self): """Gets the policy of this EnterprisePolicy. @@ -263,6 +292,8 @@ def policy(self, policy): :param policy: The policy of this EnterprisePolicy. :type: EnterprisePolicyData """ + if policy is None: + raise ValueError("Invalid value for `policy`, must not be `None`") self._policy = policy diff --git a/esperclient/models/enterprise_policy_data.py b/esperclient/models/enterprise_policy_data.py index e5ea459..f17e981 100644 --- a/esperclient/models/enterprise_policy_data.py +++ b/esperclient/models/enterprise_policy_data.py @@ -791,7 +791,7 @@ def settings_access_level(self, settings_access_level): :param settings_access_level: The settings_access_level of this EnterprisePolicyData. :type: str """ - allowed_values = ["SYSTEM", "SHOONYA"] + allowed_values = ["SYSTEM", "SHOONYA", "NONE"] if settings_access_level not in allowed_values: raise ValueError( "Invalid value for `settings_access_level` ({0}), must be one of {1}" diff --git a/esperclient/models/enterprise_policy_partial_update.py b/esperclient/models/enterprise_policy_partial_update.py new file mode 100644 index 0000000..dac797c --- /dev/null +++ b/esperclient/models/enterprise_policy_partial_update.py @@ -0,0 +1,410 @@ +# coding: utf-8 + +""" +ESPER API REFERENCE + +OpenAPI spec version: 1.0.0 +Contact: developer@esper.io +--------------------------------------------------------- + +Copyright 2019 Shoonya Enterprises Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + + + +import pprint +import re + +import six + +from esperclient.models.enterprise_policy_data import EnterprisePolicyData + + +class EnterprisePolicyPartialUpdate(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'uuid': 'str', + 'enterprise': 'str', + 'url': 'str', + 'name': 'str', + 'description': 'str', + 'device_count': 'int', + 'policy': 'EnterprisePolicyData', + 'updated_on': 'datetime', + 'created_on': 'datetime', + 'is_active': 'bool', + 'google_policy_id': 'str' + } + + attribute_map = { + 'uuid': 'uuid', + 'enterprise': 'enterprise', + 'url': 'url', + 'name': 'name', + 'description': 'description', + 'device_count': 'device_count', + 'policy': 'policy', + 'updated_on': 'updated_on', + 'created_on': 'created_on', + 'is_active': 'is_active', + 'google_policy_id': 'google_policy_id' + } + + def __init__(self, uuid=None, enterprise=None, url=None, name=None, description=None, device_count=None, policy=None, updated_on=None, created_on=None, is_active=None, google_policy_id=None): + """EnterprisePolicyPartialUpdate - a model defined in Swagger""" + + self._uuid = None + self._enterprise = None + self._url = None + self._name = None + self._description = None + self._device_count = None + self._policy = None + self._updated_on = None + self._created_on = None + self._is_active = None + self._google_policy_id = None + self.discriminator = None + + if uuid is not None: + self.uuid = uuid + if enterprise is not None: + self.enterprise = enterprise + if url is not None: + self.url = url + if name is not None: + self.name = name + if description is not None: + self.description = description + if device_count is not None: + self.device_count = device_count + if policy is not None: + self.policy = policy + if updated_on is not None: + self.updated_on = updated_on + if created_on is not None: + self.created_on = created_on + if is_active is not None: + self.is_active = is_active + if google_policy_id is not None: + self.google_policy_id = google_policy_id + + @property + def uuid(self): + """Gets the uuid of this EnterprisePolicyPartialUpdate. + + Unique Policy identifier + + :return: The uuid of this EnterprisePolicyPartialUpdate. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid): + """Sets the uuid of this EnterprisePolicyPartialUpdate. + + Unique Policy identifier + + :param uuid: The uuid of this EnterprisePolicyPartialUpdate. + :type: str + """ + + self._uuid = uuid + + @property + def enterprise(self): + """Gets the enterprise of this EnterprisePolicyPartialUpdate. + + Url of the enterprise resource + + :return: The enterprise of this EnterprisePolicyPartialUpdate. + :rtype: str + """ + return self._enterprise + + @enterprise.setter + def enterprise(self, enterprise): + """Sets the enterprise of this EnterprisePolicyPartialUpdate. + + Url of the enterprise resource + + :param enterprise: The enterprise of this EnterprisePolicyPartialUpdate. + :type: str + """ + + self._enterprise = enterprise + + @property + def url(self): + """Gets the url of this EnterprisePolicyPartialUpdate. + + URL link to policy + + :return: The url of this EnterprisePolicyPartialUpdate. + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this EnterprisePolicyPartialUpdate. + + URL link to policy + + :param url: The url of this EnterprisePolicyPartialUpdate. + :type: str + """ + + self._url = url + + @property + def name(self): + """Gets the name of this EnterprisePolicyPartialUpdate. + + Name of the Policy + + :return: The name of this EnterprisePolicyPartialUpdate. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this EnterprisePolicyPartialUpdate. + + Name of the Policy + + :param name: The name of this EnterprisePolicyPartialUpdate. + :type: str + """ + + self._name = name + + @property + def description(self): + """Gets the description of this EnterprisePolicyPartialUpdate. + + Details regarding the Policy + + :return: The description of this EnterprisePolicyPartialUpdate. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this EnterprisePolicyPartialUpdate. + + Details regarding the Policy + + :param description: The description of this EnterprisePolicyPartialUpdate. + :type: str + """ + + self._description = description + + @property + def device_count(self): + """Gets the device_count of this EnterprisePolicyPartialUpdate. + + Count of Devices with this policy applied + + :return: The device_count of this EnterprisePolicyPartialUpdate. + :rtype: int + """ + return self._device_count + + @device_count.setter + def device_count(self, device_count): + """Sets the device_count of this EnterprisePolicyPartialUpdate. + + Count of Devices with this policy applied + + :param device_count: The device_count of this EnterprisePolicyPartialUpdate. + :type: int + """ + + self._device_count = device_count + + @property + def policy(self): + """Gets the policy of this EnterprisePolicyPartialUpdate. + + + :return: The policy of this EnterprisePolicyPartialUpdate. + :rtype: EnterprisePolicyData + """ + return self._policy + + @policy.setter + def policy(self, policy): + """Sets the policy of this EnterprisePolicyPartialUpdate. + + + :param policy: The policy of this EnterprisePolicyPartialUpdate. + :type: EnterprisePolicyData + """ + + self._policy = policy + + @property + def updated_on(self): + """Gets the updated_on of this EnterprisePolicyPartialUpdate. + + Last-Updated Timestamp of Policy + + :return: The updated_on of this EnterprisePolicyPartialUpdate. + :rtype: datetime + """ + return self._updated_on + + @updated_on.setter + def updated_on(self, updated_on): + """Sets the updated_on of this EnterprisePolicyPartialUpdate. + + Last-Updated Timestamp of Policy + + :param updated_on: The updated_on of this EnterprisePolicyPartialUpdate. + :type: datetime + """ + + self._updated_on = updated_on + + @property + def created_on(self): + """Gets the created_on of this EnterprisePolicyPartialUpdate. + + Creation Timestamp of Policy + + :return: The created_on of this EnterprisePolicyPartialUpdate. + :rtype: datetime + """ + return self._created_on + + @created_on.setter + def created_on(self, created_on): + """Sets the created_on of this EnterprisePolicyPartialUpdate. + + Creation Timestamp of Policy + + :param created_on: The created_on of this EnterprisePolicyPartialUpdate. + :type: datetime + """ + + self._created_on = created_on + + @property + def is_active(self): + """Gets the is_active of this EnterprisePolicyPartialUpdate. + + Is this policy currently active + + :return: The is_active of this EnterprisePolicyPartialUpdate. + :rtype: bool + """ + return self._is_active + + @is_active.setter + def is_active(self, is_active): + """Sets the is_active of this EnterprisePolicyPartialUpdate. + + Is this policy currently active + + :param is_active: The is_active of this EnterprisePolicyPartialUpdate. + :type: bool + """ + + self._is_active = is_active + + @property + def google_policy_id(self): + """Gets the google_policy_id of this EnterprisePolicyPartialUpdate. + + Id of the Google policy + + :return: The google_policy_id of this EnterprisePolicyPartialUpdate. + :rtype: str + """ + return self._google_policy_id + + @google_policy_id.setter + def google_policy_id(self, google_policy_id): + """Sets the google_policy_id of this EnterprisePolicyPartialUpdate. + + Id of the Google policy + + :param google_policy_id: The google_policy_id of this EnterprisePolicyPartialUpdate. + :type: str + """ + + self._google_policy_id = google_policy_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EnterprisePolicyPartialUpdate, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnterprisePolicyPartialUpdate): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/esperclient/models/event_subscription.py b/esperclient/models/event_subscription.py new file mode 100644 index 0000000..88fccf9 --- /dev/null +++ b/esperclient/models/event_subscription.py @@ -0,0 +1,288 @@ +# coding: utf-8 + +""" +ESPER API REFERENCE + +OpenAPI spec version: 1.0.0 +Contact: developer@esper.io +--------------------------------------------------------- + +Copyright 2019 Shoonya Enterprises Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + + + +import pprint +import re + +import six + + +class EventSubscription(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'aws_account_id': 'str', + 'sns_topic_arn': 'str', + 'created_on': 'datetime', + 'updated_on': 'datetime', + 'is_subscribed': 'bool', + 'enterprise': 'str' + } + + attribute_map = { + 'id': 'id', + 'aws_account_id': 'aws_account_id', + 'sns_topic_arn': 'sns_topic_arn', + 'created_on': 'created_on', + 'updated_on': 'updated_on', + 'is_subscribed': 'is_subscribed', + 'enterprise': 'enterprise' + } + + def __init__(self, id=None, aws_account_id=None, sns_topic_arn=None, created_on=None, updated_on=None, is_subscribed=None, enterprise=None): + """EventSubscription - a model defined in Swagger""" + + self._id = None + self._aws_account_id = None + self._sns_topic_arn = None + self._created_on = None + self._updated_on = None + self._is_subscribed = None + self._enterprise = None + self.discriminator = None + + if id is not None: + self.id = id + self.aws_account_id = aws_account_id + if sns_topic_arn is not None: + self.sns_topic_arn = sns_topic_arn + if created_on is not None: + self.created_on = created_on + if updated_on is not None: + self.updated_on = updated_on + if is_subscribed is not None: + self.is_subscribed = is_subscribed + self.enterprise = enterprise + + @property + def id(self): + """Gets the id of this EventSubscription. + + + :return: The id of this EventSubscription. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this EventSubscription. + + + :param id: The id of this EventSubscription. + :type: str + """ + + self._id = id + + @property + def aws_account_id(self): + """Gets the aws_account_id of this EventSubscription. + + + :return: The aws_account_id of this EventSubscription. + :rtype: str + """ + return self._aws_account_id + + @aws_account_id.setter + def aws_account_id(self, aws_account_id): + """Sets the aws_account_id of this EventSubscription. + + + :param aws_account_id: The aws_account_id of this EventSubscription. + :type: str + """ + if aws_account_id is None: + raise ValueError("Invalid value for `aws_account_id`, must not be `None`") + if aws_account_id is not None and len(aws_account_id) < 1: + raise ValueError("Invalid value for `aws_account_id`, length must be greater than or equal to `1`") + + self._aws_account_id = aws_account_id + + @property + def sns_topic_arn(self): + """Gets the sns_topic_arn of this EventSubscription. + + + :return: The sns_topic_arn of this EventSubscription. + :rtype: str + """ + return self._sns_topic_arn + + @sns_topic_arn.setter + def sns_topic_arn(self, sns_topic_arn): + """Sets the sns_topic_arn of this EventSubscription. + + + :param sns_topic_arn: The sns_topic_arn of this EventSubscription. + :type: str + """ + + self._sns_topic_arn = sns_topic_arn + + @property + def created_on(self): + """Gets the created_on of this EventSubscription. + + + :return: The created_on of this EventSubscription. + :rtype: datetime + """ + return self._created_on + + @created_on.setter + def created_on(self, created_on): + """Sets the created_on of this EventSubscription. + + + :param created_on: The created_on of this EventSubscription. + :type: datetime + """ + + self._created_on = created_on + + @property + def updated_on(self): + """Gets the updated_on of this EventSubscription. + + + :return: The updated_on of this EventSubscription. + :rtype: datetime + """ + return self._updated_on + + @updated_on.setter + def updated_on(self, updated_on): + """Sets the updated_on of this EventSubscription. + + + :param updated_on: The updated_on of this EventSubscription. + :type: datetime + """ + + self._updated_on = updated_on + + @property + def is_subscribed(self): + """Gets the is_subscribed of this EventSubscription. + + + :return: The is_subscribed of this EventSubscription. + :rtype: bool + """ + return self._is_subscribed + + @is_subscribed.setter + def is_subscribed(self, is_subscribed): + """Sets the is_subscribed of this EventSubscription. + + + :param is_subscribed: The is_subscribed of this EventSubscription. + :type: bool + """ + + self._is_subscribed = is_subscribed + + @property + def enterprise(self): + """Gets the enterprise of this EventSubscription. + + + :return: The enterprise of this EventSubscription. + :rtype: str + """ + return self._enterprise + + @enterprise.setter + def enterprise(self, enterprise): + """Sets the enterprise of this EventSubscription. + + + :param enterprise: The enterprise of this EventSubscription. + :type: str + """ + if enterprise is None: + raise ValueError("Invalid value for `enterprise`, must not be `None`") + + self._enterprise = enterprise + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EventSubscription, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EventSubscription): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/esperclient/models/event_subscription_args.py b/esperclient/models/event_subscription_args.py new file mode 100644 index 0000000..6fabb13 --- /dev/null +++ b/esperclient/models/event_subscription_args.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" +ESPER API REFERENCE + +OpenAPI spec version: 1.0.0 +Contact: developer@esper.io +--------------------------------------------------------- + +Copyright 2019 Shoonya Enterprises Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + + + +import pprint +import re + +import six + + +class EventSubscriptionArgs(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'aws_account_id': 'str' + } + + attribute_map = { + 'aws_account_id': 'aws_account_id' + } + + def __init__(self, aws_account_id=None): + """EventSubscriptionArgs - a model defined in Swagger""" + + self._aws_account_id = None + self.discriminator = None + + self.aws_account_id = aws_account_id + + @property + def aws_account_id(self): + """Gets the aws_account_id of this EventSubscriptionArgs. + + + :return: The aws_account_id of this EventSubscriptionArgs. + :rtype: str + """ + return self._aws_account_id + + @aws_account_id.setter + def aws_account_id(self, aws_account_id): + """Sets the aws_account_id of this EventSubscriptionArgs. + + + :param aws_account_id: The aws_account_id of this EventSubscriptionArgs. + :type: str + """ + if aws_account_id is None: + raise ValueError("Invalid value for `aws_account_id`, must not be `None`") + if aws_account_id is not None and len(aws_account_id) < 1: + raise ValueError("Invalid value for `aws_account_id`, length must be greater than or equal to `1`") + + self._aws_account_id = aws_account_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EventSubscriptionArgs, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EventSubscriptionArgs): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/esperclient/models/inline_response20012.py b/esperclient/models/inline_response20012.py new file mode 100644 index 0000000..2fa7d80 --- /dev/null +++ b/esperclient/models/inline_response20012.py @@ -0,0 +1,210 @@ +# coding: utf-8 + +""" +ESPER API REFERENCE + +OpenAPI spec version: 1.0.0 +Contact: developer@esper.io +--------------------------------------------------------- + +Copyright 2019 Shoonya Enterprises Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + + + +import pprint +import re + +import six + +from esperclient.models.event_subscription import EventSubscription + + +class InlineResponse20012(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'count': 'int', + 'next': 'str', + 'previous': 'str', + 'results': 'list[EventSubscription]' + } + + attribute_map = { + 'count': 'count', + 'next': 'next', + 'previous': 'previous', + 'results': 'results' + } + + def __init__(self, count=None, next=None, previous=None, results=None): + """InlineResponse20012 - a model defined in Swagger""" + + self._count = None + self._next = None + self._previous = None + self._results = None + self.discriminator = None + + self.count = count + if next is not None: + self.next = next + if previous is not None: + self.previous = previous + self.results = results + + @property + def count(self): + """Gets the count of this InlineResponse20012. + + + :return: The count of this InlineResponse20012. + :rtype: int + """ + return self._count + + @count.setter + def count(self, count): + """Sets the count of this InlineResponse20012. + + + :param count: The count of this InlineResponse20012. + :type: int + """ + if count is None: + raise ValueError("Invalid value for `count`, must not be `None`") + + self._count = count + + @property + def next(self): + """Gets the next of this InlineResponse20012. + + + :return: The next of this InlineResponse20012. + :rtype: str + """ + return self._next + + @next.setter + def next(self, next): + """Sets the next of this InlineResponse20012. + + + :param next: The next of this InlineResponse20012. + :type: str + """ + + self._next = next + + @property + def previous(self): + """Gets the previous of this InlineResponse20012. + + + :return: The previous of this InlineResponse20012. + :rtype: str + """ + return self._previous + + @previous.setter + def previous(self, previous): + """Sets the previous of this InlineResponse20012. + + + :param previous: The previous of this InlineResponse20012. + :type: str + """ + + self._previous = previous + + @property + def results(self): + """Gets the results of this InlineResponse20012. + + + :return: The results of this InlineResponse20012. + :rtype: list[EventSubscription] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this InlineResponse20012. + + + :param results: The results of this InlineResponse20012. + :type: list[EventSubscription] + """ + if results is None: + raise ValueError("Invalid value for `results`, must not be `None`") + + self._results = results + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(InlineResponse20012, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineResponse20012): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/esperclient/models/v0_command_args.py b/esperclient/models/v0_command_args.py index a77e7d5..024d5b5 100644 --- a/esperclient/models/v0_command_args.py +++ b/esperclient/models/v0_command_args.py @@ -47,23 +47,38 @@ class V0CommandArgs(object): 'device_alias_name': 'str', 'custom_settings_config': 'object', 'app_version': 'str', - 'package_name': 'str' + 'package_name': 'str', + 'policy_url': 'str', + 'wifi_access_points': 'object', + 'state': 'str', + 'message': 'str', + 'app_state': 'str' } attribute_map = { 'device_alias_name': 'device_alias_name', 'custom_settings_config': 'custom_settings_config', 'app_version': 'app_version', - 'package_name': 'package_name' + 'package_name': 'package_name', + 'policy_url': 'policy_url', + 'wifi_access_points': 'wifi_access_points', + 'state': 'state', + 'message': 'message', + 'app_state': 'app_state' } - def __init__(self, device_alias_name=None, custom_settings_config=None, app_version=None, package_name=None): + def __init__(self, device_alias_name=None, custom_settings_config=None, app_version=None, package_name=None, policy_url=None, wifi_access_points=None, state=None, message=None, app_state=None): """V0CommandArgs - a model defined in Swagger""" self._device_alias_name = None self._custom_settings_config = None self._app_version = None self._package_name = None + self._policy_url = None + self._wifi_access_points = None + self._state = None + self._message = None + self._app_state = None self.discriminator = None if device_alias_name is not None: @@ -74,6 +89,16 @@ def __init__(self, device_alias_name=None, custom_settings_config=None, app_vers self.app_version = app_version if package_name is not None: self.package_name = package_name + if policy_url is not None: + self.policy_url = policy_url + if wifi_access_points is not None: + self.wifi_access_points = wifi_access_points + if state is not None: + self.state = state + if message is not None: + self.message = message + if app_state is not None: + self.app_state = app_state @property def device_alias_name(self): @@ -125,6 +150,7 @@ def custom_settings_config(self, custom_settings_config): def app_version(self): """Gets the app_version of this V0CommandArgs. + The version id of app uploaded on Esper :return: The app_version of this V0CommandArgs. :rtype: str @@ -135,6 +161,7 @@ def app_version(self): def app_version(self, app_version): """Sets the app_version of this V0CommandArgs. + The version id of app uploaded on Esper :param app_version: The app_version of this V0CommandArgs. :type: str @@ -146,6 +173,7 @@ def app_version(self, app_version): def package_name(self): """Gets the package_name of this V0CommandArgs. + The app package name uploaded on Esper :return: The package_name of this V0CommandArgs. :rtype: str @@ -156,6 +184,7 @@ def package_name(self): def package_name(self, package_name): """Sets the package_name of this V0CommandArgs. + The app package name uploaded on Esper :param package_name: The package_name of this V0CommandArgs. :type: str @@ -163,6 +192,121 @@ def package_name(self, package_name): self._package_name = package_name + @property + def policy_url(self): + """Gets the policy_url of this V0CommandArgs. + + The URL to the policy + + :return: The policy_url of this V0CommandArgs. + :rtype: str + """ + return self._policy_url + + @policy_url.setter + def policy_url(self, policy_url): + """Sets the policy_url of this V0CommandArgs. + + The URL to the policy + + :param policy_url: The policy_url of this V0CommandArgs. + :type: str + """ + + self._policy_url = policy_url + + @property + def wifi_access_points(self): + """Gets the wifi_access_points of this V0CommandArgs. + + Wifi access points for the device (passed as JSON object) + + :return: The wifi_access_points of this V0CommandArgs. + :rtype: object + """ + return self._wifi_access_points + + @wifi_access_points.setter + def wifi_access_points(self, wifi_access_points): + """Sets the wifi_access_points of this V0CommandArgs. + + Wifi access points for the device (passed as JSON object) + + :param wifi_access_points: The wifi_access_points of this V0CommandArgs. + :type: object + """ + + self._wifi_access_points = wifi_access_points + + @property + def state(self): + """Gets the state of this V0CommandArgs. + + LOCKED/UNLOCKED + + :return: The state of this V0CommandArgs. + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this V0CommandArgs. + + LOCKED/UNLOCKED + + :param state: The state of this V0CommandArgs. + :type: str + """ + + self._state = state + + @property + def message(self): + """Gets the message of this V0CommandArgs. + + Message to be added with command + + :return: The message of this V0CommandArgs. + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this V0CommandArgs. + + Message to be added with command + + :param message: The message of this V0CommandArgs. + :type: str + """ + + self._message = message + + @property + def app_state(self): + """Gets the app_state of this V0CommandArgs. + + The state of app - SHOW/HIDE/DISABLE + + :return: The app_state of this V0CommandArgs. + :rtype: str + """ + return self._app_state + + @app_state.setter + def app_state(self, app_state): + """Sets the app_state of this V0CommandArgs. + + The state of app - SHOW/HIDE/DISABLE + + :param app_state: The app_state of this V0CommandArgs. + :type: str + """ + + self._app_state = app_state + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/esperclient/models/v0_device_command_enum.py b/esperclient/models/v0_device_command_enum.py index 5c1940b..bce60cd 100644 --- a/esperclient/models/v0_device_command_enum.py +++ b/esperclient/models/v0_device_command_enum.py @@ -44,6 +44,14 @@ class V0DeviceCommandEnum(object): UPDATE_DEVICE_CONFIG = "UPDATE_DEVICE_CONFIG" INSTALL = "INSTALL" UNINSTALL = "UNINSTALL" + SET_NEW_POLICY = "SET_NEW_POLICY" + ADD_WIFI_AP = "ADD_WIFI_AP" + REMOVE_WIFI_AP = "REMOVE_WIFI_AP" + SET_KIOSK_APP = "SET_KIOSK_APP" + SET_DEVICE_LOCKDOWN_STATE = "SET_DEVICE_LOCKDOWN_STATE" + SET_APP_STATE = "SET_APP_STATE" + WIPE = "WIPE" + UPDATE_LATEST_DPC = "UPDATE_LATEST_DPC" """ Attributes: diff --git a/setup.py b/setup.py index dd5ecab..83bd850 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ from setuptools import setup, find_packages NAME = "esperclient" -VERSION = "0.0.15" +VERSION = "0.1.0" # To install the library, run the following # # python setup.py install @@ -59,7 +59,7 @@ Python client library for Esper Manage APIs. You can find out more about Esper at https://esper.io. - API version: 1.0.0 - - Package version: 0.0.15 + - Package version: 0.1.0 For usage instructions and API documentation please visit: https://github.com/esper-io/esper-client-py diff --git a/test/test_device_group_partial_update.py b/test/test_device_group_partial_update.py new file mode 100644 index 0000000..acf60d1 --- /dev/null +++ b/test/test_device_group_partial_update.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" +ESPER API REFERENCE + +OpenAPI spec version: 1.0.0 +Contact: developer@esper.io +--------------------------------------------------------- + +Copyright 2019 Shoonya Enterprises Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + + + +from __future__ import absolute_import + +import unittest + +import esperclient +from esperclient.models.device_group_partial_update import DeviceGroupPartialUpdate +from esperclient.rest import ApiException + + +class TestDeviceGroupPartialUpdate(unittest.TestCase): + """DeviceGroupPartialUpdate unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDeviceGroupPartialUpdate(self): + """Test DeviceGroupPartialUpdate""" + model = esperclient.models.device_group_partial_update.DeviceGroupPartialUpdate() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_enterprise_policy_partial_update.py b/test/test_enterprise_policy_partial_update.py new file mode 100644 index 0000000..ad96e16 --- /dev/null +++ b/test/test_enterprise_policy_partial_update.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" +ESPER API REFERENCE + +OpenAPI spec version: 1.0.0 +Contact: developer@esper.io +--------------------------------------------------------- + +Copyright 2019 Shoonya Enterprises Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + + + +from __future__ import absolute_import + +import unittest + +import esperclient +from esperclient.models.enterprise_policy_partial_update import EnterprisePolicyPartialUpdate +from esperclient.rest import ApiException + + +class TestEnterprisePolicyPartialUpdate(unittest.TestCase): + """EnterprisePolicyPartialUpdate unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnterprisePolicyPartialUpdate(self): + """Test EnterprisePolicyPartialUpdate""" + model = esperclient.models.enterprise_policy_partial_update.EnterprisePolicyPartialUpdate() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_event_subscription.py b/test/test_event_subscription.py new file mode 100644 index 0000000..a333e5e --- /dev/null +++ b/test/test_event_subscription.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" +ESPER API REFERENCE + +OpenAPI spec version: 1.0.0 +Contact: developer@esper.io +--------------------------------------------------------- + +Copyright 2019 Shoonya Enterprises Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + + + +from __future__ import absolute_import + +import unittest + +import esperclient +from esperclient.models.event_subscription import EventSubscription +from esperclient.rest import ApiException + + +class TestEventSubscription(unittest.TestCase): + """EventSubscription unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEventSubscription(self): + """Test EventSubscription""" + model = esperclient.models.event_subscription.EventSubscription() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_event_subscription_args.py b/test/test_event_subscription_args.py new file mode 100644 index 0000000..01eacf5 --- /dev/null +++ b/test/test_event_subscription_args.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" +ESPER API REFERENCE + +OpenAPI spec version: 1.0.0 +Contact: developer@esper.io +--------------------------------------------------------- + +Copyright 2019 Shoonya Enterprises Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + + + +from __future__ import absolute_import + +import unittest + +import esperclient +from esperclient.models.event_subscription_args import EventSubscriptionArgs +from esperclient.rest import ApiException + + +class TestEventSubscriptionArgs(unittest.TestCase): + """EventSubscriptionArgs unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEventSubscriptionArgs(self): + """Test EventSubscriptionArgs""" + model = esperclient.models.event_subscription_args.EventSubscriptionArgs() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_inline_response20012.py b/test/test_inline_response20012.py new file mode 100644 index 0000000..d7e48e4 --- /dev/null +++ b/test/test_inline_response20012.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" +ESPER API REFERENCE + +OpenAPI spec version: 1.0.0 +Contact: developer@esper.io +--------------------------------------------------------- + +Copyright 2019 Shoonya Enterprises Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + + + +from __future__ import absolute_import + +import unittest + +import esperclient +from esperclient.models.inline_response20012 import InlineResponse20012 +from esperclient.rest import ApiException + + +class TestInlineResponse20012(unittest.TestCase): + """InlineResponse20012 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponse20012(self): + """Test InlineResponse20012""" + model = esperclient.models.inline_response20012.InlineResponse20012() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_subscription_api.py b/test/test_subscription_api.py new file mode 100644 index 0000000..59d80b3 --- /dev/null +++ b/test/test_subscription_api.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" +ESPER API REFERENCE + +OpenAPI spec version: 1.0.0 +Contact: developer@esper.io +--------------------------------------------------------- + +Copyright 2019 Shoonya Enterprises Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + + + +from __future__ import absolute_import + +import unittest + +import esperclient +from esperclient.api.subscription_api import SubscriptionApi +from esperclient.rest import ApiException + + +class TestSubscriptionApi(unittest.TestCase): + """SubscriptionApi unit test stubs""" + + def setUp(self): + self.api = esperclient.api.subscription_api.SubscriptionApi() + + def tearDown(self): + pass + + def test_create_subscription(self): + """Test case for create_subscription + + Create a Subscription + """ + pass + + def test_delete_subscription(self): + """Test case for delete_subscription + + Delete a subscription + """ + pass + + def test_get_all_subscriptions(self): + """Test case for get_all_subscriptions + + List Subscriptions in Enterprise + """ + pass + + def test_get_subscription(self): + """Test case for get_subscription + + Get subscription information + """ + pass + + +if __name__ == '__main__': + unittest.main()