Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 1 addition & 77 deletions koyeb/api/api/services_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated

from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator
from pydantic import Field, StrictBool, StrictStr, field_validator
from typing import Any, Dict, List, Optional
from typing_extensions import Annotated
from koyeb.api.models.autocomplete_reply import AutocompleteReply
Expand Down Expand Up @@ -2711,8 +2711,6 @@ def update_service(
description="If set, run validation and check that the service exists"
),
] = None,
life_cycle_delete_after_sleep: Optional[StrictInt] = None,
life_cycle_delete_after_create: Optional[StrictInt] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Expand All @@ -2734,10 +2732,6 @@ def update_service(
:type service: UpdateService
:param dry_run: If set, run validation and check that the service exists
:type dry_run: bool
:param life_cycle_delete_after_sleep:
:type life_cycle_delete_after_sleep: int
:param life_cycle_delete_after_create:
:type life_cycle_delete_after_create: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand All @@ -2764,8 +2758,6 @@ def update_service(
id=id,
service=service,
dry_run=dry_run,
life_cycle_delete_after_sleep=life_cycle_delete_after_sleep,
life_cycle_delete_after_create=life_cycle_delete_after_create,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
Expand Down Expand Up @@ -2801,8 +2793,6 @@ def update_service_with_http_info(
description="If set, run validation and check that the service exists"
),
] = None,
life_cycle_delete_after_sleep: Optional[StrictInt] = None,
life_cycle_delete_after_create: Optional[StrictInt] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Expand All @@ -2824,10 +2814,6 @@ def update_service_with_http_info(
:type service: UpdateService
:param dry_run: If set, run validation and check that the service exists
:type dry_run: bool
:param life_cycle_delete_after_sleep:
:type life_cycle_delete_after_sleep: int
:param life_cycle_delete_after_create:
:type life_cycle_delete_after_create: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand All @@ -2854,8 +2840,6 @@ def update_service_with_http_info(
id=id,
service=service,
dry_run=dry_run,
life_cycle_delete_after_sleep=life_cycle_delete_after_sleep,
life_cycle_delete_after_create=life_cycle_delete_after_create,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
Expand Down Expand Up @@ -2891,8 +2875,6 @@ def update_service_without_preload_content(
description="If set, run validation and check that the service exists"
),
] = None,
life_cycle_delete_after_sleep: Optional[StrictInt] = None,
life_cycle_delete_after_create: Optional[StrictInt] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Expand All @@ -2914,10 +2896,6 @@ def update_service_without_preload_content(
:type service: UpdateService
:param dry_run: If set, run validation and check that the service exists
:type dry_run: bool
:param life_cycle_delete_after_sleep:
:type life_cycle_delete_after_sleep: int
:param life_cycle_delete_after_create:
:type life_cycle_delete_after_create: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand All @@ -2944,8 +2922,6 @@ def update_service_without_preload_content(
id=id,
service=service,
dry_run=dry_run,
life_cycle_delete_after_sleep=life_cycle_delete_after_sleep,
life_cycle_delete_after_create=life_cycle_delete_after_create,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
Expand All @@ -2971,8 +2947,6 @@ def _update_service_serialize(
id,
service,
dry_run,
life_cycle_delete_after_sleep,
life_cycle_delete_after_create,
_request_auth,
_content_type,
_headers,
Expand Down Expand Up @@ -3000,18 +2974,6 @@ def _update_service_serialize(

_query_params.append(("dry_run", dry_run))

if life_cycle_delete_after_sleep is not None:

_query_params.append(
("life_cycle.delete_after_sleep", life_cycle_delete_after_sleep)
)

if life_cycle_delete_after_create is not None:

_query_params.append(
("life_cycle.delete_after_create", life_cycle_delete_after_create)
)

# process the header parameters
# process the form parameters
# process the body parameter
Expand Down Expand Up @@ -3051,8 +3013,6 @@ def update_service2(
description="If set, run validation and check that the service exists"
),
] = None,
life_cycle_delete_after_sleep: Optional[StrictInt] = None,
life_cycle_delete_after_create: Optional[StrictInt] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Expand All @@ -3074,10 +3034,6 @@ def update_service2(
:type service: UpdateService
:param dry_run: If set, run validation and check that the service exists
:type dry_run: bool
:param life_cycle_delete_after_sleep:
:type life_cycle_delete_after_sleep: int
:param life_cycle_delete_after_create:
:type life_cycle_delete_after_create: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand All @@ -3104,8 +3060,6 @@ def update_service2(
id=id,
service=service,
dry_run=dry_run,
life_cycle_delete_after_sleep=life_cycle_delete_after_sleep,
life_cycle_delete_after_create=life_cycle_delete_after_create,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
Expand Down Expand Up @@ -3141,8 +3095,6 @@ def update_service2_with_http_info(
description="If set, run validation and check that the service exists"
),
] = None,
life_cycle_delete_after_sleep: Optional[StrictInt] = None,
life_cycle_delete_after_create: Optional[StrictInt] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Expand All @@ -3164,10 +3116,6 @@ def update_service2_with_http_info(
:type service: UpdateService
:param dry_run: If set, run validation and check that the service exists
:type dry_run: bool
:param life_cycle_delete_after_sleep:
:type life_cycle_delete_after_sleep: int
:param life_cycle_delete_after_create:
:type life_cycle_delete_after_create: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand All @@ -3194,8 +3142,6 @@ def update_service2_with_http_info(
id=id,
service=service,
dry_run=dry_run,
life_cycle_delete_after_sleep=life_cycle_delete_after_sleep,
life_cycle_delete_after_create=life_cycle_delete_after_create,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
Expand Down Expand Up @@ -3231,8 +3177,6 @@ def update_service2_without_preload_content(
description="If set, run validation and check that the service exists"
),
] = None,
life_cycle_delete_after_sleep: Optional[StrictInt] = None,
life_cycle_delete_after_create: Optional[StrictInt] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Expand All @@ -3254,10 +3198,6 @@ def update_service2_without_preload_content(
:type service: UpdateService
:param dry_run: If set, run validation and check that the service exists
:type dry_run: bool
:param life_cycle_delete_after_sleep:
:type life_cycle_delete_after_sleep: int
:param life_cycle_delete_after_create:
:type life_cycle_delete_after_create: int
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand All @@ -3284,8 +3224,6 @@ def update_service2_without_preload_content(
id=id,
service=service,
dry_run=dry_run,
life_cycle_delete_after_sleep=life_cycle_delete_after_sleep,
life_cycle_delete_after_create=life_cycle_delete_after_create,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
Expand All @@ -3311,8 +3249,6 @@ def _update_service2_serialize(
id,
service,
dry_run,
life_cycle_delete_after_sleep,
life_cycle_delete_after_create,
_request_auth,
_content_type,
_headers,
Expand Down Expand Up @@ -3340,18 +3276,6 @@ def _update_service2_serialize(

_query_params.append(("dry_run", dry_run))

if life_cycle_delete_after_sleep is not None:

_query_params.append(
("life_cycle.delete_after_sleep", life_cycle_delete_after_sleep)
)

if life_cycle_delete_after_create is not None:

_query_params.append(
("life_cycle.delete_after_create", life_cycle_delete_after_create)
)

# process the header parameters
# process the form parameters
# process the body parameter
Expand Down
1 change: 1 addition & 0 deletions koyeb/api/docs/ServiceListItem.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Name | Type | Description | Notes
**state** | [**ServiceState**](ServiceState.md) | | [optional]
**active_deployment_id** | **str** | | [optional]
**latest_deployment_id** | **str** | | [optional]
**life_cycle** | [**ServiceLifeCycle**](ServiceLifeCycle.md) | | [optional]

## Example

Expand Down
16 changes: 4 additions & 12 deletions koyeb/api/docs/ServicesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,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_service**
> UpdateServiceReply update_service(id, service, dry_run=dry_run, life_cycle_delete_after_sleep=life_cycle_delete_after_sleep, life_cycle_delete_after_create=life_cycle_delete_after_create)
> UpdateServiceReply update_service(id, service, dry_run=dry_run)

Update Service

Expand Down Expand Up @@ -853,12 +853,10 @@ with koyeb.api.ApiClient(configuration) as api_client:
id = 'id_example' # str | The id of the entity to update
service = koyeb.api.UpdateService() # UpdateService |
dry_run = True # bool | If set, run validation and check that the service exists (optional)
life_cycle_delete_after_sleep = 56 # int | (optional)
life_cycle_delete_after_create = 56 # int | (optional)

try:
# Update Service
api_response = api_instance.update_service(id, service, dry_run=dry_run, life_cycle_delete_after_sleep=life_cycle_delete_after_sleep, life_cycle_delete_after_create=life_cycle_delete_after_create)
api_response = api_instance.update_service(id, service, dry_run=dry_run)
print("The response of ServicesApi->update_service:\n")
pprint(api_response)
except Exception as e:
Expand All @@ -875,8 +873,6 @@ Name | Type | Description | Notes
**id** | **str**| The id of the entity to update |
**service** | [**UpdateService**](UpdateService.md)| |
**dry_run** | **bool**| If set, run validation and check that the service exists | [optional]
**life_cycle_delete_after_sleep** | **int**| | [optional]
**life_cycle_delete_after_create** | **int**| | [optional]

### Return type

Expand Down Expand Up @@ -907,7 +903,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_service2**
> UpdateServiceReply update_service2(id, service, dry_run=dry_run, life_cycle_delete_after_sleep=life_cycle_delete_after_sleep, life_cycle_delete_after_create=life_cycle_delete_after_create)
> UpdateServiceReply update_service2(id, service, dry_run=dry_run)

Update Service

Expand Down Expand Up @@ -946,12 +942,10 @@ with koyeb.api.ApiClient(configuration) as api_client:
id = 'id_example' # str | The id of the entity to update
service = koyeb.api.UpdateService() # UpdateService |
dry_run = True # bool | If set, run validation and check that the service exists (optional)
life_cycle_delete_after_sleep = 56 # int | (optional)
life_cycle_delete_after_create = 56 # int | (optional)

try:
# Update Service
api_response = api_instance.update_service2(id, service, dry_run=dry_run, life_cycle_delete_after_sleep=life_cycle_delete_after_sleep, life_cycle_delete_after_create=life_cycle_delete_after_create)
api_response = api_instance.update_service2(id, service, dry_run=dry_run)
print("The response of ServicesApi->update_service2:\n")
pprint(api_response)
except Exception as e:
Expand All @@ -968,8 +962,6 @@ Name | Type | Description | Notes
**id** | **str**| The id of the entity to update |
**service** | [**UpdateService**](UpdateService.md)| |
**dry_run** | **bool**| If set, run validation and check that the service exists | [optional]
**life_cycle_delete_after_sleep** | **int**| | [optional]
**life_cycle_delete_after_create** | **int**| | [optional]

### Return type

Expand Down
11 changes: 11 additions & 0 deletions koyeb/api/models/service_list_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from datetime import datetime
from pydantic import BaseModel, ConfigDict, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from koyeb.api.models.service_life_cycle import ServiceLifeCycle
from koyeb.api.models.service_state import ServiceState
from koyeb.api.models.service_status import ServiceStatus
from koyeb.api.models.service_type import ServiceType
Expand All @@ -45,6 +46,7 @@ class ServiceListItem(BaseModel):
state: Optional[ServiceState] = None
active_deployment_id: Optional[StrictStr] = None
latest_deployment_id: Optional[StrictStr] = None
life_cycle: Optional[ServiceLifeCycle] = None
__properties: ClassVar[List[str]] = [
"id",
"name",
Expand All @@ -59,6 +61,7 @@ class ServiceListItem(BaseModel):
"state",
"active_deployment_id",
"latest_deployment_id",
"life_cycle",
]

model_config = ConfigDict(
Expand Down Expand Up @@ -101,6 +104,9 @@ def to_dict(self) -> Dict[str, Any]:
# override the default output from pydantic by calling `to_dict()` of state
if self.state:
_dict["state"] = self.state.to_dict()
# override the default output from pydantic by calling `to_dict()` of life_cycle
if self.life_cycle:
_dict["life_cycle"] = self.life_cycle.to_dict()
return _dict

@classmethod
Expand Down Expand Up @@ -139,6 +145,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
),
"active_deployment_id": obj.get("active_deployment_id"),
"latest_deployment_id": obj.get("latest_deployment_id"),
"life_cycle": (
ServiceLifeCycle.from_dict(obj["life_cycle"])
if obj.get("life_cycle") is not None
else None
),
}
)
return _obj
Loading