Skip to content

Commit

Permalink
Merge pull request #74 from adzerk/tomascasas/sc-65908/create-a-schem…
Browse files Browse the repository at this point in the history
…a-helper

[sc-65908] Work around some schema improvements
  • Loading branch information
tomascasas authored Dec 4, 2024
2 parents 2b17eec + b78b722 commit 69eaead
Show file tree
Hide file tree
Showing 11 changed files with 852 additions and 163 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ build
.env
node_modules
.secrets
.vscode
119 changes: 1 addition & 118 deletions management/ad.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,124 +29,7 @@ paths:
content:
application/json:
schema:
type: object
required:
- Creative
- FlightId
- IsActive
properties:
Creative:
type: object
properties:
Id:
type: integer
format: int32
FlightId:
type: integer
format: int32
IsActive:
type: boolean
RtbCustomFields:
type: string
nullable: true
ActiveKeywords:
nullable: true
type: array
items:
type: string
CustomTargeting:
type: string
nullable: true
DistributionType:
type: integer
format: int32
enum: [1, 2, 3]
nullable: true
Percentage:
type: integer
format: int32
nullable: true
Impressions:
type: integer
format: int32
nullable: true
SiteId:
type: integer
format: int32
nullable: true
ZoneId:
type: integer
format: int32
nullable: true
IsDeleted:
type: boolean
nullable: true
Iframe:
type: boolean
nullable: true
SizeOverride:
type: boolean
nullable: true
IsStartEndDateOverride:
type: boolean
nullable: true
StartDateIso:
type: string
format: date
nullable: true
EndDateIso:
type: string
format: date
nullable: true
IsGoalOverride:
type: boolean
nullable: true
GoalType:
type: integer
format: int32
nullable: true
enum: [1, 2, 3, 7, 8, 9, 10]
Goal:
type: integer
format: int32
nullable: true
IsNetworkAd:
type: boolean
nullable: true
IsNoTrack:
type: boolean
nullable: true
DontAffectParentFreqCap:
type: boolean
nullable: true
FreqCap:
type: integer
format: int32
nullable: true
FreqCapDuration:
type: integer
format: int32
nullable: true
FreqCapType:
type: integer
format: int32
nullable: true
enum: [1, 2, 3]
Price:
type: number
format: float
nullable: true
ExternalMetadata:
type: string
nullable: true
CustomRelevancyScore:
type: integer
format: int32
nullable: true
ProductId:
type: integer
format: int32
nullable: true
$ref: './schemas/ad.yaml#/schemas/AdInput'
responses:
200:
description: The newly created Ad
Expand Down
192 changes: 192 additions & 0 deletions management/asset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
openapi: 3.0.1
info:
title: Adzerk Management API - Entity Counts
description: Entity Counts related Adzerk Management API
version: '1.0'
servers:
- url: 'https://api.adzerk.net'
tags:
- name: entity-counts
description: Entity Counts
paths:
/v1/asset:
get:
tags:
- assets
description: list Assets
operationId: listAssets
security:
- ApiKeyAuth: []
parameters:
- name: pageSize
in: query
description: The size of the page to be returned
required: false
schema:
type: integer
format: int32
nullable: true
- name: page
in: query
description: The page number to be returned
required: false
schema:
type: integer
format: int32
nullable: true
responses:
200:
description: Paged list of Assets
content:
application/json:
schema:
$ref: './schemas/asset.yaml#/schemas/AssetList'
'/v1/asset/{assetId}':
parameters:
- name: assetId
in: path
description: Id of the Asset
required: true
schema:
type: integer
format: int32
get:
tags:
- assets
description: Get an existing Asset
operationId: getAsset
security:
- ApiKeyAuth: []
responses:
200:
description: The existing Asset
content:
application/json:
schema:
$ref: './schemas/asset.yaml#/schemas/AssetDetails'
'/v1/advertiser/{advertiserId}/asset':
parameters:
- name: advertiserId
in: path
description: Id of the Advertiser
required: true
schema:
type: integer
format: int32
get:
tags:
- assets
description: List Assets for Advertiser
operationId: listAdvertiserAssets
security:
- ApiKeyAuth: []
parameters:
- name: pageSize
in: query
description: The size of the page to be returned
required: false
schema:
type: integer
format: int32
nullable: true
- name: page
in: query
description: The page number to be returned
required: false
schema:
type: integer
format: int32
nullable: true
responses:
200:
description: Paged list of Assets for Advertiser
content:
application/json:
schema:
$ref: './schemas/asset.yaml#/schemas/AssetList'
post:
tags:
- assets
description: Create Asset
operationId: createAsset
security:
- ApiKeyAuth: []
requestBody:
content:
application/json:
schema:
$ref: './schemas/asset.yaml#/schemas/AssetInput'
responses:
200:
description: Asset Created
content:
application/json:
schema:
$ref: './schemas/asset.yaml#/schemas/Asset'
'/v1/asset/{assetId}/delete':
parameters:
- name: assetId
in: path
description: Id of the Asset
required: true
schema:
type: integer
format: int32
post:
tags:
- assets
description: Delete an existing Asset
operationId: deleteAsset
security:
- ApiKeyAuth: []
responses:
200:
description: Successfully Deleted
'/v1/asset/{assetId}/upload':
parameters:
- name: assetId
in: path
description: Id of the Asset
required: true
schema:
type: integer
format: int32
post:
tags:
- assets
description: Upload content to an existing Asset
operationId: uploadAssetContent
security:
- ApiKeyAuth: []
parameters:
- name: timestamp
in: query
description: Milliseconds since epoch from asset creation
required: true
schema:
type: integer
format: int32
- name: signature
in: query
description: Signing hash from asset creation
required: true
schema:
type: string
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
file:
type: string
format: binary
description: This must be an image file
responses:
200:
description: Successfully Uploaded

components:
securitySchemes:
$ref: './components/security-schemes.yaml#/components/securitySchemes'
2 changes: 1 addition & 1 deletion management/campaign.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ paths:
content:
application/json:
schema:
$ref: './schemas/campaign.yaml#/schemas/Campaign'
$ref: './schemas/campaign.yaml#/schemas/CampaignInput'
responses:
200:
description: Campaign Created
Expand Down
Loading

0 comments on commit 69eaead

Please sign in to comment.