Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added separate campaign model to avoid recursion and clean up creative #377

Merged
merged 5 commits into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 58 additions & 84 deletions dist/lob-api-bundled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5810,7 +5810,6 @@ components:
- type: object
required:
- id
- account_id
- name
- description
- schedule_type
Expand All @@ -5824,9 +5823,6 @@ components:
properties:
id:
$ref: '#/components/schemas/cmp_id'
account_id:
description: Account ID that this campaign is associated with.
type: string
is_draft:
description: Whether or not the campaign is still a draft.
type: boolean
Expand Down Expand Up @@ -6975,7 +6971,6 @@ components:
required:
- front
- back
- campaign_id
- resource_type
- details
properties:
Expand All @@ -6984,15 +6979,12 @@ components:
- $ref: '#/components/schemas/supported_resource_type'
enum:
- postcard
campaign_id:
$ref: '#/components/schemas/cmp_id'
- $ref: '#/components/schemas/postcardsCreative'
- allOf:
- title: Letter Creative
required:
- file
- from
- campaign_id
- resource_type
- details
properties:
Expand All @@ -7001,8 +6993,6 @@ components:
- $ref: '#/components/schemas/supported_resource_type'
enum:
- letter
campaign_id:
$ref: '#/components/schemas/cmp_id'
details:
$ref: '#/components/schemas/letter_details_returned'
- $ref: '#/components/schemas/lettersCreative'
Expand All @@ -7011,14 +7001,70 @@ components:
description: Unique identifier prefixed with `crv_`.
pattern: ^crv_[a-zA-Z0-9]+$
example: crv_2a3b096c409b32c
campaign_item:
allOf:
- $ref: '#/components/schemas/lob_base'
- $ref: '#/components/schemas/campaign_writable'
- type: object
required:
- id
- name
- description
- schedule_type
- use_type
- is_draft
- creatives
- auto_cancel_if_ncoa
- date_created
- date_modified
- object
properties:
id:
$ref: '#/components/schemas/cmp_id'
is_draft:
description: Whether or not the campaign is still a draft.
type: boolean
default: true
creatives:
description: >-
An array of creatives that have been associated with this
campaign.
type: array
object:
type: string
description: Value is resource type.
enum:
- campaign
default: campaign
campaign_list:
type: array
description: Array of campaigns associated with the creative ID
items:
$ref: '#/components/schemas/campaign_item'
example:
- id: cmp_ed76e33e7ac4d0bd
name: My postman Campaign 2
description: Created via postman again
schedule_type: immediate
send_date: null
target_delivery_date: null
cancel_window_campaign_minutes: null
metadata: {}
use_type: null
is_draft: true
deleted: false
creatives: []
auto_cancel_if_ncoa: false
date_created: '2022-07-26T20:20:25.016Z'
date_modified: '2022-07-26T20:20:25.016Z'
object: campaign
creative:
allOf:
- $ref: '#/components/schemas/lob_base'
- $ref: '#/components/schemas/returned_resource'
- type: object
required:
- id
- account_id
- description
- from
- resource_type
Expand All @@ -7033,11 +7079,6 @@ components:
properties:
id:
$ref: '#/components/schemas/crv_id'
account_id:
title: Account ID
type: string
example: fa9ea650fc7b31a89f92
description: Account ID that made the request
template_preview_urls:
title: Template Preview URLs
type: object
Expand All @@ -7055,67 +7096,7 @@ components:
template(s) as artwork asset(s). An empty array will be returned
if no `template_preview`s have been generated for the creative.
campaigns:
title: Campaigns
type: array
description: Array of campaigns associated with the creative ID
items:
allOf:
- $ref: '#/components/schemas/campaign_writable'
- type: object
required:
- id
- name
- description
- schedule_type
- is_draft
- auto_cancel_if_ncoa
- date_created
- date_modified
- object
properties:
id:
$ref: '#/components/schemas/cmp_id'
account_id:
description: Account ID that this campaign is associated with.
type: string
is_draft:
description: Whether or not the campaign is still a draft.
type: boolean
default: true
creatives:
description: >-
An array of creatives that have been associated with
this campaign.
type: array
date_created:
$ref: '#/components/schemas/date_created'
date_modified:
$ref: '#/components/schemas/date_modified'
deleted:
$ref: '#/components/schemas/deleted'
object:
allOf:
- $ref: '#/components/schemas/object'
- enum:
- campaign
default: campaign
example:
- id: cmp_ed76e33e7ac4d0bd
name: My postman Campaign 2
description: Created via postman again
schedule_type: immediate
send_date: null
target_delivery_date: null
cancel_window_campaign_minutes: null
metadata: {}
use_type: null
is_draft: true
deleted: false
creatives: []
auto_cancel_if_ncoa: false
date_created: '2022-07-26T20:20:25.016Z'
date_modified: '2022-07-26T20:20:25.016Z'
object: campaign
$ref: '#/components/schemas/campaign_list'
object:
type: string
description: Value is resource type.
Expand Down Expand Up @@ -9392,7 +9373,6 @@ components:
example:
data:
- id: cmp_e05ee61ff80764b
account_id: fa9ea650fc7b31a89f92
billing_group_id: bg_fe3079dcdd80e5ae
name: My Campaign
description: My Campaign's description
Expand Down Expand Up @@ -13229,7 +13209,6 @@ paths:
$ref: '#/components/schemas/campaign'
example:
id: cmp_e05ee61ff80764b
account_id: fa9ea650fc7b31a89f92
billing_group_id: bg_fe3079dcdd80e5ae
name: My Campaign
description: My Campaign's description
Expand Down Expand Up @@ -13279,7 +13258,6 @@ paths:
$ref: '#/components/schemas/campaign'
example:
id: cmp_e05ee61ff80764b
account_id: fa9ea650fc7b31a89f92
billing_group_id: bg_fe3079dcdd80e5ae
name: My Campaign
description: My Campaign's description
Expand Down Expand Up @@ -13337,7 +13315,6 @@ paths:
$ref: '#/components/schemas/campaign'
example:
id: cmp_e05ee61ff80764b
account_id: fa9ea650fc7b31a89f92
billing_group_id: bg_fe3079dcdd80e5ae
name: My Campaign
description: My Campaign's description
Expand Down Expand Up @@ -14751,7 +14728,6 @@ paths:
$ref: '#/components/schemas/creative'
example:
id: crv_2a3b096c409b32c
account_id: fa9ea650fc7b31a89f92
description: Our 4x6 postcard creative
from: adr_210a8d4b0b76d77b
resource_type: postcard
Expand Down Expand Up @@ -14798,7 +14774,6 @@ paths:
$ref: '#/components/schemas/creative'
example:
id: crv_2a3b096c409b32c
account_id: fa9ea650fc7b31a89f92
description: Our 4x6 postcard creative
from: adr_210a8d4b0b76d77b
resource_type: postcard
Expand Down Expand Up @@ -14853,7 +14828,6 @@ paths:
$ref: '#/components/schemas/creative'
example:
id: crv_2a3b096c409b32c
account_id: fa9ea650fc7b31a89f92
description: Our 4x6 postcard creative
from: adr_210a8d4b0b76d77b
resource_type: postcard
Expand Down
Loading