Skip to content

Commit

Permalink
Merge pull request #474 from openedx/sameen/update-allocate-endpoint-…
Browse files Browse the repository at this point in the history
…schema

fix: update allocate endpoint schema
  • Loading branch information
sameenfatima78 committed May 22, 2024
2 parents eeab72f + dea04ae commit 7b79f45
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 35 deletions.
42 changes: 25 additions & 17 deletions api-compact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,24 @@ definitions:
items:
type: "string"
description: "assignment uuid"
PolicyAllocationRequestBody:
type: "object"
properties:
learner_emails:
type: "array"
description: "Learner emails to whom LearnerContentAssignments should be allocated."
required: true
items:
type: "string"
description: "email of a learner"
content_key:
type: "string"
description: "Course content_key to which these learners are assigned."
required: true
content_price_cents:
type: "integer"
description: "The price, in USD cents, of this content at the time of allocation. Must be >= 0."
required: true

endpoints:
v1:
Expand All @@ -104,24 +122,14 @@ endpoints:
type: string
description: The uuid that uniquely identifies this policy record.
required: true
- in: query
name: content_key
type: string
description: Course content_key to which these learners are assigned.
required: true
- in: query
name: content_price_cents
type: integer
description: The price, in USD cents, of this content at the time of allocation.
Must be >= 0.
required: true
- in: query
name: learner_emails
type: array
items:
type: string
description: Learner emails to whom LearnerContentAssignments should be allocated.
- name: "PolicyAllocationRequestBody"
in: "body"
description: "Contains learner emails, content keys and price"
required: true
schema:
type: "array"
items:
$ref: "#/definitions/PolicyAllocationRequestBody"
responses: *learner_content_assignment_allocate_responses
x-amazon-apigateway-integration:
responses: *apigateway_responses
Expand Down
44 changes: 26 additions & 18 deletions api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,25 @@ definitions:
items:
type: string
description: assignment uuid
PolicyAllocationRequestBody:
type: object
properties:
learner_emails:
type: array
description: Learner emails to whom LearnerContentAssignments should be allocated.
required: true
items:
type: string
description: email of a learner
content_key:
type: string
description: Course content_key to which these learners are assigned.
required: true
content_price_cents:
type: integer
description: The price, in USD cents, of this content at the time of allocation.
Must be >= 0.
required: true
endpoints:
v1:
subsidyAccessPolicyAllocation:
Expand All @@ -88,25 +107,14 @@ endpoints:
type: string
description: The uuid that uniquely identifies this policy record.
required: true
- in: query
name: content_key
type: string
description: Course content_key to which these learners are assigned.
required: true
- in: query
name: content_price_cents
type: integer
description: The price, in USD cents, of this content at the time of allocation.
Must be >= 0.
required: true
- in: query
name: learner_emails
type: array
items:
type: string
description: Learner emails to whom LearnerContentAssignments should be
allocated.
- name: PolicyAllocationRequestBody
in: body
description: Contains learner emails, content keys and price
required: true
schema:
type: array
items:
$ref: "#/definitions/PolicyAllocationRequestBody"
responses:
"202":
description: Accepted
Expand Down

0 comments on commit 7b79f45

Please sign in to comment.