Skip to content

Add on-call schedules endpoint#2486

Merged
api-clients-generation-pipeline[bot] merged 15 commits into
masterfrom
datadog-api-spec/generated/3653
Apr 11, 2025
Merged

Add on-call schedules endpoint#2486
api-clients-generation-pipeline[bot] merged 15 commits into
masterfrom
datadog-api-spec/generated/3653

Conversation

@api-clients-generation-pipeline
Copy link
Copy Markdown
Contributor


def delete_on_call_schedule(
self,
schedule_uuid: Any,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 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

View in Datadog  Leave us feedback  Documentation

"data": "data",
}

def __init__(self_, data: Union[List[ScheduleDataRelationshipsTeamsDataItems], UnsetType] = unset, **kwargs):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Code Quality Violation

Suggested change
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

View in Datadog  Leave us feedback  Documentation

}

def __init__(
self_,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Code Quality Violation

Suggested change
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

View in Datadog  Leave us feedback  Documentation

}

def __init__(
self_,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Code Quality Violation

Suggested change
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

View in Datadog  Leave us feedback  Documentation

"name": "name",
}

def __init__(self_, email: Union[str, UnsetType] = unset, name: Union[str, UnsetType] = unset, **kwargs):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Code Quality Violation

Suggested change
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

View in Datadog  Leave us feedback  Documentation

}

def __init__(
self_,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Code Quality Violation

Suggested change
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

View in Datadog  Leave us feedback  Documentation

"teams": "teams",
}

def __init__(self_, teams: Union[ScheduleUpdateRequestDataRelationshipsTeams, UnsetType] = unset, **kwargs):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Code Quality Violation

Suggested change
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

View in Datadog  Leave us feedback  Documentation

}

def __init__(
self_, user: Union[ScheduleCreateRequestDataAttributesLayersItemsMembersItemsUser, UnsetType] = unset, **kwargs
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Code Quality Violation

Suggested change
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

View in Datadog  Leave us feedback  Documentation

}

def __init__(
self_,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Code Quality Violation

Suggested change
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

View in Datadog  Leave us feedback  Documentation

"data": "data",
}

def __init__(self_, data: Union[ScheduleUpdateRequestData, UnsetType] = unset, **kwargs):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Code Quality Violation

Suggested change
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

View in Datadog  Leave us feedback  Documentation

@api-clients-generation-pipeline api-clients-generation-pipeline Bot force-pushed the datadog-api-spec/generated/3653 branch 2 times, most recently from c965d05 to 71c23a2 Compare April 2, 2025 06:42

def get_on_call_schedule(
self,
schedule_uuid: Any,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 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

View in Datadog  Leave us feedback  Documentation

@api-clients-generation-pipeline api-clients-generation-pipeline Bot force-pushed the datadog-api-spec/generated/3653 branch from 71c23a2 to 918bb83 Compare April 2, 2025 06:53

def update_on_call_schedule(
self,
schedule_uuid: Any,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 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

View in Datadog  Leave us feedback  Documentation

@api-clients-generation-pipeline api-clients-generation-pipeline Bot force-pushed the datadog-api-spec/generated/3653 branch from 918bb83 to fa52bad Compare April 3, 2025 06:02
>>> class_name("On-Call")
'OnCallApi'
"""
value = re.sub(r'[^a-zA-Z0-9]', '', value)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 Code Quality Violation

variable name is the same as a function parameter (...read more)

A function parameter should only be read and not be modified. If your intent is to modify the value of the parameter, return the value in the function and handle the new value in the caller of the function.

View in Datadog  Leave us feedback  Documentation

@api-clients-generation-pipeline api-clients-generation-pipeline Bot force-pushed the datadog-api-spec/generated/3653 branch from fa52bad to 18724a1 Compare April 3, 2025 06:27
@api-clients-generation-pipeline api-clients-generation-pipeline Bot force-pushed the datadog-api-spec/generated/3653 branch from 18724a1 to c612793 Compare April 3, 2025 06:41
Comment thread tests/conftest.py


def _api_name(value):
value = re.sub(r"[^a-zA-Z0-9]", "", value)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 Code Quality Violation

variable name is the same as a function parameter (...read more)

A function parameter should only be read and not be modified. If your intent is to modify the value of the parameter, return the value in the function and handle the new value in the caller of the function.

View in Datadog  Leave us feedback  Documentation

@api-clients-generation-pipeline api-clients-generation-pipeline Bot force-pushed the datadog-api-spec/generated/3653 branch 5 times, most recently from 4adbf82 to b255e52 Compare April 4, 2025 03:06
@api-clients-generation-pipeline api-clients-generation-pipeline Bot force-pushed the datadog-api-spec/generated/3653 branch 3 times, most recently from 3eccff8 to 9adb06c Compare April 4, 2025 06:31
@api-clients-generation-pipeline api-clients-generation-pipeline Bot force-pushed the datadog-api-spec/generated/3653 branch 2 times, most recently from 8021ac8 to c2bb9e6 Compare April 4, 2025 07:40
@api-clients-generation-pipeline api-clients-generation-pipeline Bot force-pushed the datadog-api-spec/generated/3653 branch from c2bb9e6 to 5514e3a Compare April 7, 2025 01:57
@api-clients-generation-pipeline api-clients-generation-pipeline Bot force-pushed the datadog-api-spec/generated/3653 branch from 5514e3a to 54258bc Compare April 7, 2025 03:13
"data": "data",
}

def __init__(self_, data: ScheduleCreateRequestData, **kwargs):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Code Quality Violation

Suggested change
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

View in Datadog  Leave us feedback  Documentation

"data": "data",
}

def __init__(self_, data: ScheduleUpdateRequestData, **kwargs):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Code Quality Violation

Suggested change
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

View in Datadog  Leave us feedback  Documentation

@api-clients-generation-pipeline api-clients-generation-pipeline Bot force-pushed the datadog-api-spec/generated/3653 branch 2 times, most recently from dcc20fc to c6ff166 Compare April 7, 2025 04:35
@api-clients-generation-pipeline api-clients-generation-pipeline Bot force-pushed the datadog-api-spec/generated/3653 branch from c6ff166 to dbe8b9c Compare April 8, 2025 05:07
…:DataDog/datadog-api-client-python into datadog-api-spec/test/d.marin/oncall-api
@api-clients-generation-pipeline api-clients-generation-pipeline Bot force-pushed the datadog-api-spec/generated/3653 branch from dbe8b9c to be70c83 Compare April 8, 2025 05:48
@api-clients-generation-pipeline api-clients-generation-pipeline Bot force-pushed the datadog-api-spec/generated/3653 branch from be70c83 to bddbcb5 Compare April 8, 2025 06:51
Comment thread tests/conftest.py
Comment on lines +194 to +197
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'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Quality Violation

else is not necessary since the if clause has a return (...read more)

If the code in the if branch returns a value, do not have the else branch present.

View in Datadog  Leave us feedback  Documentation

Comment thread tests/conftest.py
Comment on lines +188 to +197
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'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 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

View in Datadog  Leave us feedback  Documentation

@api-clients-generation-pipeline api-clients-generation-pipeline Bot force-pushed the datadog-api-spec/generated/3653 branch from bddbcb5 to 30cd53c Compare April 8, 2025 17:25
@api-clients-generation-pipeline api-clients-generation-pipeline Bot force-pushed the datadog-api-spec/generated/3653 branch from 30cd53c to c40678f Compare April 8, 2025 19:21
@api-clients-generation-pipeline api-clients-generation-pipeline Bot force-pushed the datadog-api-spec/generated/3653 branch 2 times, most recently from ee77b95 to 7a810a8 Compare April 9, 2025 17:12
@api-clients-generation-pipeline api-clients-generation-pipeline Bot force-pushed the datadog-api-spec/generated/3653 branch from 7a810a8 to 57dd1de Compare April 11, 2025 12:59
@api-clients-generation-pipeline api-clients-generation-pipeline Bot merged commit 824cc24 into master Apr 11, 2025
12 checks passed
@api-clients-generation-pipeline api-clients-generation-pipeline Bot deleted the datadog-api-spec/generated/3653 branch April 11, 2025 14:59
github-actions Bot pushed a commit that referenced this pull request Apr 11, 2025
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants