Add on-call schedules endpoint#2486
Conversation
|
|
||
| def delete_on_call_schedule( | ||
| self, | ||
| schedule_uuid: Any, |
There was a problem hiding this comment.
🟠 Code Quality Violation
do not use Any, use a concrete type (...read more)
Use the Any type very carefully. Most of the time, the Any type is used because we do not know exactly what type is being used. If you want to specify that a value can be of any type, use object instead of Any.
Learn More
| "data": "data", | ||
| } | ||
|
|
||
| def __init__(self_, data: Union[List[ScheduleDataRelationshipsTeamsDataItems], UnsetType] = unset, **kwargs): |
There was a problem hiding this comment.
🔴 Code Quality Violation
| def __init__(self_, data: Union[List[ScheduleDataRelationshipsTeamsDataItems], UnsetType] = unset, **kwargs): | |
| def __init__(self, data: Union[List[ScheduleDataRelationshipsTeamsDataItems], UnsetType] = unset, **kwargs): |
first parameter of a class function should be self (...read more)
In a class method (that is not a class method nor a static method), the first argument must be self by convention.
Learn More
| } | ||
|
|
||
| def __init__( | ||
| self_, |
There was a problem hiding this comment.
🔴 Code Quality Violation
| self_, | |
| self, |
first parameter of a class function should be self (...read more)
In a class method (that is not a class method nor a static method), the first argument must be self by convention.
Learn More
| } | ||
|
|
||
| def __init__( | ||
| self_, |
There was a problem hiding this comment.
🔴 Code Quality Violation
| self_, | |
| self, |
first parameter of a class function should be self (...read more)
In a class method (that is not a class method nor a static method), the first argument must be self by convention.
Learn More
| "name": "name", | ||
| } | ||
|
|
||
| def __init__(self_, email: Union[str, UnsetType] = unset, name: Union[str, UnsetType] = unset, **kwargs): |
There was a problem hiding this comment.
🔴 Code Quality Violation
| def __init__(self_, email: Union[str, UnsetType] = unset, name: Union[str, UnsetType] = unset, **kwargs): | |
| def __init__(self, email: Union[str, UnsetType] = unset, name: Union[str, UnsetType] = unset, **kwargs): |
first parameter of a class function should be self (...read more)
In a class method (that is not a class method nor a static method), the first argument must be self by convention.
Learn More
| } | ||
|
|
||
| def __init__( | ||
| self_, |
There was a problem hiding this comment.
🔴 Code Quality Violation
| self_, | |
| self, |
first parameter of a class function should be self (...read more)
In a class method (that is not a class method nor a static method), the first argument must be self by convention.
Learn More
| "teams": "teams", | ||
| } | ||
|
|
||
| def __init__(self_, teams: Union[ScheduleUpdateRequestDataRelationshipsTeams, UnsetType] = unset, **kwargs): |
There was a problem hiding this comment.
🔴 Code Quality Violation
| def __init__(self_, teams: Union[ScheduleUpdateRequestDataRelationshipsTeams, UnsetType] = unset, **kwargs): | |
| def __init__(self, teams: Union[ScheduleUpdateRequestDataRelationshipsTeams, UnsetType] = unset, **kwargs): |
first parameter of a class function should be self (...read more)
In a class method (that is not a class method nor a static method), the first argument must be self by convention.
Learn More
| } | ||
|
|
||
| def __init__( | ||
| self_, user: Union[ScheduleCreateRequestDataAttributesLayersItemsMembersItemsUser, UnsetType] = unset, **kwargs |
There was a problem hiding this comment.
🔴 Code Quality Violation
| self_, user: Union[ScheduleCreateRequestDataAttributesLayersItemsMembersItemsUser, UnsetType] = unset, **kwargs | |
| self, user: Union[ScheduleCreateRequestDataAttributesLayersItemsMembersItemsUser, UnsetType] = unset, **kwargs |
first parameter of a class function should be self (...read more)
In a class method (that is not a class method nor a static method), the first argument must be self by convention.
Learn More
| } | ||
|
|
||
| def __init__( | ||
| self_, |
There was a problem hiding this comment.
🔴 Code Quality Violation
| self_, | |
| self, |
first parameter of a class function should be self (...read more)
In a class method (that is not a class method nor a static method), the first argument must be self by convention.
Learn More
| "data": "data", | ||
| } | ||
|
|
||
| def __init__(self_, data: Union[ScheduleUpdateRequestData, UnsetType] = unset, **kwargs): |
There was a problem hiding this comment.
🔴 Code Quality Violation
| def __init__(self_, data: Union[ScheduleUpdateRequestData, UnsetType] = unset, **kwargs): | |
| def __init__(self, data: Union[ScheduleUpdateRequestData, UnsetType] = unset, **kwargs): |
first parameter of a class function should be self (...read more)
In a class method (that is not a class method nor a static method), the first argument must be self by convention.
Learn More
c965d05 to
71c23a2
Compare
|
|
||
| def get_on_call_schedule( | ||
| self, | ||
| schedule_uuid: Any, |
There was a problem hiding this comment.
🟠 Code Quality Violation
do not use Any, use a concrete type (...read more)
Use the Any type very carefully. Most of the time, the Any type is used because we do not know exactly what type is being used. If you want to specify that a value can be of any type, use object instead of Any.
Learn More
71c23a2 to
918bb83
Compare
|
|
||
| def update_on_call_schedule( | ||
| self, | ||
| schedule_uuid: Any, |
There was a problem hiding this comment.
🟠 Code Quality Violation
do not use Any, use a concrete type (...read more)
Use the Any type very carefully. Most of the time, the Any type is used because we do not know exactly what type is being used. If you want to specify that a value can be of any type, use object instead of Any.
Learn More
918bb83 to
fa52bad
Compare
| >>> class_name("On-Call") | ||
| 'OnCallApi' | ||
| """ | ||
| value = re.sub(r'[^a-zA-Z0-9]', '', value) |
There was a problem hiding this comment.
fa52bad to
18724a1
Compare
18724a1 to
c612793
Compare
|
|
||
|
|
||
| def _api_name(value): | ||
| value = re.sub(r"[^a-zA-Z0-9]", "", value) |
There was a problem hiding this comment.
4adbf82 to
b255e52
Compare
3eccff8 to
9adb06c
Compare
8021ac8 to
c2bb9e6
Compare
c2bb9e6 to
5514e3a
Compare
5514e3a to
54258bc
Compare
| "data": "data", | ||
| } | ||
|
|
||
| def __init__(self_, data: ScheduleCreateRequestData, **kwargs): |
There was a problem hiding this comment.
🔴 Code Quality Violation
| def __init__(self_, data: ScheduleCreateRequestData, **kwargs): | |
| def __init__(self, data: ScheduleCreateRequestData, **kwargs): |
first parameter of a class function should be self (...read more)
In a class method (that is not a class method nor a static method), the first argument must be self by convention.
Learn More
| "data": "data", | ||
| } | ||
|
|
||
| def __init__(self_, data: ScheduleUpdateRequestData, **kwargs): |
There was a problem hiding this comment.
🔴 Code Quality Violation
| def __init__(self_, data: ScheduleUpdateRequestData, **kwargs): | |
| def __init__(self, data: ScheduleUpdateRequestData, **kwargs): |
first parameter of a class function should be self (...read more)
In a class method (that is not a class method nor a static method), the first argument must be self by convention.
Learn More
dcc20fc to
c6ff166
Compare
c6ff166 to
dbe8b9c
Compare
…:DataDog/datadog-api-client-python into datadog-api-spec/test/d.marin/oncall-api
dbe8b9c to
be70c83
Compare
be70c83 to
bddbcb5
Compare
| else: | ||
| return ret.replace(tzinfo=None) # return datetime object and not string | ||
| # NOTE this is not a full ISO 8601 format, but it's enough for our needs | ||
| # return ret.strftime('%Y-%m-%dT%H:%M:%S') + ret.strftime('.%f')[:4] + 'Z' |
| if is_iso_with_timezone_indicator: | ||
| # Return ISO 8601 formatted string with Z timezone indicator | ||
| # Example: 2025-04-17T03:17:07.923Z | ||
| from datetime import timezone | ||
|
|
||
| return ret.astimezone(timezone.utc).isoformat(timespec="milliseconds").replace("+00:00", "Z") | ||
| else: | ||
| return ret.replace(tzinfo=None) # return datetime object and not string | ||
| # NOTE this is not a full ISO 8601 format, but it's enough for our needs | ||
| # return ret.strftime('%Y-%m-%dT%H:%M:%S') + ret.strftime('.%f')[:4] + 'Z' |
There was a problem hiding this comment.
🔴 Code Quality Violation
too many nesting levels (...read more)
Avoid to nest too many loops together. Having too many loops make your code harder to understand.
Prefer to organize your code in functions and unit of code you can clearly understand.
Learn More
bddbcb5 to
30cd53c
Compare
30cd53c to
c40678f
Compare
ee77b95 to
7a810a8
Compare
7a810a8 to
57dd1de
Compare
* Sanitize api names * Remove hyphen * Fix hyphen * Fix iso time * Fix iso time * Fix iso time * Fix iso time * Regenerate client from commit 7307da21 of spec repo --------- Co-authored-by: Daniel Marin <daniel.marin@datadoghq.com> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com> 824cc24
See DataDog/datadog-api-spec#3653
Test branch datadog-api-spec/test/d.marin/oncall-api