Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
steering
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
steering
Commits
dc35e3d8
Verified
Commit
dc35e3d8
authored
7 months ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
feat: add example requests & responses for create schedule view
parent
7d1d94a8
No related branches found
No related tags found
No related merge requests found
Pipeline
#8497
passed
7 months ago
Stage: check
Stage: test
Stage: build
Stage: deploy
Stage: release
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
program/views.py
+140
-0
140 additions, 0 deletions
program/views.py
with
140 additions
and
0 deletions
program/views.py
+
140
−
0
View file @
dc35e3d8
...
...
@@ -771,10 +771,74 @@ class APIRRuleViewSet(viewsets.ModelViewSet):
@extend_schema_view
(
create
=
extend_schema
(
examples
=
[
OpenApiExample
(
"
Request to create a new schedule
"
,
request_only
=
True
,
value
=
{
"
schedule
"
:
{
"
endTime
"
:
"
09:00:00
"
,
"
startTime
"
:
"
08:00:00
"
,
"
rruleId
"
:
1
,
"
showId
"
:
10
,
"
firstDate
"
:
"
2024-08-12
"
,
}
},
),
OpenApiExample
(
"
Request to simulate the creation of a new schedule
"
,
request_only
=
True
,
value
=
{
"
schedule
"
:
{
"
endTime
"
:
"
09:00:00
"
,
"
dryrun
"
:
True
,
"
startTime
"
:
"
08:00:00
"
,
"
rruleId
"
:
1
,
"
showId
"
:
10
,
"
firstDate
"
:
"
2024-08-12
"
,
}
},
),
OpenApiExample
(
"
Request to create a new schedule and solve a collision
"
,
request_only
=
True
,
value
=
{
"
schedule
"
:
{
"
endTime
"
:
"
09:00:00
"
,
"
dryrun
"
:
True
,
"
startTime
"
:
"
08:00:00
"
,
"
rruleId
"
:
1
,
"
showId
"
:
10
,
"
firstDate
"
:
"
2024-08-12
"
,
},
"
solutions
"
:
{
"
2024081211000004002024081212000004001
"
:
"
ours
"
},
},
),
],
summary
=
"
Create a new schedule.
"
,
request
=
ScheduleCreateUpdateRequestSerializer
,
responses
=
{
status
.
HTTP_201_CREATED
:
OpenApiResponse
(
examples
=
[
OpenApiExample
(
"
Successful creation if a new schedule
"
,
response_only
=
True
,
value
=
{
"
addBusinessDaysOnly
"
:
False
,
"
addDaysNo
"
:
None
,
"
byWeekday
"
:
None
,
"
defaultPlaylistId
"
:
None
,
"
endTime
"
:
"
09:00:00
"
,
"
firstDate
"
:
"
2024-08-12
"
,
"
id
"
:
11
,
"
isRepetition
"
:
False
,
"
lastDate
"
:
None
,
"
rruleId
"
:
1
,
"
showId
"
:
10
,
"
startTime
"
:
"
08:00:00
"
,
},
)
],
response
=
ScheduleResponseSerializer
,
description
=
(
"
Signals the successful creation of the schedule and of the projected
"
...
...
@@ -782,6 +846,29 @@ class APIRRuleViewSet(viewsets.ModelViewSet):
),
),
status
.
HTTP_202_ACCEPTED
:
OpenApiResponse
(
examples
=
[
OpenApiExample
(
"
Simulated creation of a new schedule
"
,
response_only
=
True
,
value
=
{
"
create
"
:
[
{
"
end
"
:
"
2024-08-12T09:00:00-04:00
"
,
"
id
"
:
None
,
"
memo
"
:
""
,
"
noteId
"
:
None
,
"
playlistId
"
:
None
,
"
repetitionOfId
"
:
None
,
"
scheduleId
"
:
None
,
"
showId
"
:
10
,
"
start
"
:
"
2024-08-12T08:00:00-04:00
"
,
}
],
"
delete
"
:
[],
"
update
"
:
[],
},
)
],
response
=
ScheduleDryRunResponseSerializer
,
description
=
(
"
Returns the list of timeslots that would be created, updated and deleted if
"
...
...
@@ -817,6 +904,59 @@ class APIRRuleViewSet(viewsets.ModelViewSet):
),
),
status
.
HTTP_409_CONFLICT
:
OpenApiResponse
(
examples
=
[
OpenApiExample
(
"
Creation of a new schedule would create in a collision
"
,
response_only
=
True
,
value
=
{
"
notes
"
:
{},
"
playlists
"
:
{},
"
projected
"
:
[
{
"
collisions
"
:
[
{
"
end
"
:
"
2024-08-12 17:00:00+00:00
"
,
"
memo
"
:
""
,
"
noteId
"
:
694
,
"
playlistId
"
:
None
,
"
scheduleId
"
:
7
,
"
showId
"
:
6
,
"
showName
"
:
"
EINS
"
,
"
start
"
:
"
2024-08-12 14:00:00+00:00
"
,
"
timeslotId
"
:
694
,
}
],
"
end
"
:
"
2024-08-12 12:00:00-04:00
"
,
"
error
"
:
None
,
"
hash
"
:
"
2024081211000004002024081212000004001
"
,
"
solutionChoices
"
:
[
"
ours-end
"
,
"
theirs
"
,
"
ours-start
"
,
"
ours
"
,
"
ours-both
"
,
],
"
start
"
:
"
2024-08-12 11:00:00-04:00
"
,
}
],
"
schedule
"
:
{
"
addBusinessDaysOnly
"
:
False
,
"
addDaysNo
"
:
None
,
"
byWeekday
"
:
None
,
"
defaultPlaylistId
"
:
None
,
"
endTime
"
:
"
12:00:00
"
,
"
firstDate
"
:
"
2024-08-12
"
,
"
id
"
:
None
,
"
isRepetition
"
:
False
,
"
lastDate
"
:
None
,
"
rruleId
"
:
1
,
"
showId
"
:
10
,
"
startTime
"
:
"
11:00:00
"
,
},
"
solutions
"
:
{
"
2024081211000004002024081212000004001
"
:
""
},
},
)
],
response
=
ScheduleConflictResponseSerializer
,
description
=
dedent
(
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment