Skip to content

Commit

Permalink
Merge pull request #61 from adzerk/vinodkurup/sc-49435/new-endpoint-v…
Browse files Browse the repository at this point in the history
…2-campaign

Prep spec for /v2/campaign
  • Loading branch information
vkurup authored Nov 13, 2023
2 parents 3019753 + 7584406 commit f1c0a8e
Show file tree
Hide file tree
Showing 11 changed files with 274 additions and 455 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ $ openapi-generator generate \

### Management SDK

Note to maintainers: The openapi-3.yaml file doesn't fully reference all of the
endpoints and schemas in the individual entity YAML files. For this reason, please make
sure to update both the individual entity YAML file AND the openapi-3.yaml file when
making changes. Bonus points for linking the 2 with `$ref` so that there is only one
place to make changes.

#### JavaScript

```sh
Expand All @@ -82,4 +88,4 @@ $ openapi-generator generate \
-i ./management/openapi-3.yaml \
-o ./build/mgmt-ruby/ \
-c ./management/codegen-config/ruby.json
```
```
74 changes: 22 additions & 52 deletions management/campaign.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,26 @@ tags:
- name: campaign
description: Manage Campaigns
paths:
/v2/campaign:
post:
tags:
- campaign
description: Create Nested Campaign
operationId: createNested
security:
- ApiKeyAuth: []
requestBody:
content:
application/json:
schema:
$ref: './schemas/campaign.yaml#/schemas/NestedCampaignInput'
responses:
200:
description: Nested Campaign Created
content:
application/json:
schema:
$ref: './schemas/campaign.yaml#/schemas/NestedCampaignOutput'
/v1/campaign:
post:
tags:
Expand All @@ -21,57 +41,7 @@ paths:
content:
application/json:
schema:
type: object
required:
- AdvertiserId
- Name
- StartDateISO
properties:
AdvertiserId:
type: integer
format: int32
Name:
type: string
IsActive:
type: boolean
nullable: true
IsDeleted:
type: boolean
default: false
nullable: true
IsArchived:
type: boolean
default: false
nullable: true
FreqCap:
type: integer
format: int32
nullable: true
FreqCapDuration:
type: integer
format: int32
nullable: true
FreqCapType:
type: integer
format: int32
enum: [1, 2, 3]
nullable: true
DontAffectParentFreqCap:
type: boolean
nullable: true
CapType:
type: integer
format: int32
nullable: true
default: 4
DailyCapAmount:
type: integer
format: int32
nullable: true
LifetimeCapAmount:
type: integer
format: int32
nullable: true
$ref: './schemas/campaign.yaml#/schemas/Campaign'
responses:
200:
description: Campaign Created
Expand Down Expand Up @@ -235,4 +205,4 @@ paths:
$ref: './schemas/campaign.yaml#/schemas/CampaignList'
components:
securitySchemes:
$ref: './components/security-schemes.yaml#/components/securitySchemes'
$ref: './components/security-schemes.yaml#/components/securitySchemes'
65 changes: 2 additions & 63 deletions management/creative.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,68 +21,7 @@ paths:
content:
application/json:
schema:
type: object
required:
- AdvertiserId
- AdTypeId
- IsActive
properties:
AdvertiserId:
type: integer
format: int32
AdTypeId:
type: integer
format: int32
IsActive:
type: boolean
default: false
Title:
type: string
nullable: true
ImageName:
type: string
nullable: true
Body:
type: string
nullable: true
Url:
type: string
nullable: true
format: url
Alt:
type: string
nullable: true
IsDeleted:
type: boolean
nullable: true
IsHTMLJS:
type: boolean
nullable: true
ScriptBody:
type: string
nullable: true
Metadata:
type: string
nullable: true
ImageLink:
type: string
nullable: true
SaveEmptyCreative:
type: boolean
nullable: true
IsNoTrack:
type: boolean
nullable: true
IsNetworkAd:
type: boolean
nullable: true
TemplateId:
type: integer
format: int32
nullable: true
TemplateValues:
type: string
nullable: true
$ref: './schemas/creative.yaml#/schemas/Creative'
responses:
200:
description: Creative Created
Expand Down Expand Up @@ -313,4 +252,4 @@ paths:
$ref: './schemas/creative.yaml#/schemas/CreativeList'
components:
securitySchemes:
$ref: './components/security-schemes.yaml#/components/securitySchemes'
$ref: './components/security-schemes.yaml#/components/securitySchemes'
Loading

0 comments on commit f1c0a8e

Please sign in to comment.