// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../core/resource'; import { APIPromise } from '../../../core/api-promise'; import { RequestOptions } from '../../../internal/request-options'; import { path } from '../../../internal/utils/path'; export class Deliverables extends APIResource { /** * Retrieve all deliverables submitted for a specific campaign. Includes content * URLs, performance metrics, review status, and feedback from admin reviews. * * @example * ```ts * const deliverables = * await client.admin.campaigns.deliverables.list( * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * ); * ``` */ list(id: string, options?: RequestOptions): APIPromise { return this._client.get(path`/admin/campaigns/${id}/deliverables`, options); } /** * Approve multiple deliverables in batch. This marks the content as meeting * campaign requirements and triggers any associated payments or next steps. * * @example * ```ts * const response = * await client.admin.campaigns.deliverables.approve( * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { * deliverableIds: [ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * ], * }, * ); * ``` */ approve( id: string, body: DeliverableApproveParams, options?: RequestOptions, ): APIPromise { return this._client.post(path`/admin/campaigns/${id}/deliverables/approve`, { body, ...options }); } /** * Reject multiple deliverables in batch with specified reason and feedback. This * requests the influencer to revise or resubmit the content. * * @example * ```ts * const response = * await client.admin.campaigns.deliverables.reject( * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { * deliverableIds: [ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * ], * reason: 'x', * }, * ); * ``` */ reject( id: string, body: DeliverableRejectParams, options?: RequestOptions, ): APIPromise { return this._client.post(path`/admin/campaigns/${id}/deliverables/reject`, { body, ...options }); } } export interface DeliverableListResponse { data: DeliverableListResponse.Data; /** * When the response was generated */ generatedAt: string; /** * Whether the request was successful */ success: boolean; } export namespace DeliverableListResponse { export interface Data { /** * Campaign identifier */ campaignId: string; /** * Campaign name */ campaignName: string; /** * Array of deliverables */ deliverables: Array; /** * Breakdown by status */ statusBreakdown: Data.StatusBreakdown; /** * Total number of deliverables */ totalDeliverables: number; } export namespace Data { export interface Deliverable { /** * Unique identifier for the deliverable */ id: string; /** * Campaign identifier */ campaignId: string; /** * URL to the content */ contentUrl: string | null; /** * When the deliverable was created */ createdAt: string; /** * Admin feedback */ feedback: string | null; /** * Influencer profile picture URL */ influencerAvatar: string | null; /** * Influencer social media handle */ influencerHandle: string; /** * Influencer identifier */ influencerId: string; /** * Influencer name */ influencerName: string; /** * Social media platform */ platform: string; /** * When the deliverable was reviewed */ reviewedAt: string | null; /** * Deliverable status */ status: 'pending' | 'submitted' | 'approved' | 'rejected' | 'revision'; /** * When the deliverable was submitted */ submittedAt: string | null; /** * Deliverable type */ type: 'post' | 'story' | 'video' | 'reel' | 'live'; /** * When the deliverable was last updated */ updatedAt: string; } /** * Breakdown by status */ export interface StatusBreakdown { approved: number; pending: number; rejected: number; revision: number; submitted: number; } } } export interface DeliverableApproveResponse { data: DeliverableApproveResponse.Data; /** * Whether the approval was successful */ success: boolean; } export namespace DeliverableApproveResponse { export interface Data { /** * When the approval was processed */ approvedAt: string; /** * Admin user who approved */ approvedBy: string; /** * Number of deliverables approved */ approvedCount: number; /** * IDs of approved deliverables */ approvedDeliverableIds: Array; /** * Campaign identifier */ campaignId: string; /** * Approval feedback */ feedback?: string; } } export interface DeliverableRejectResponse { data: DeliverableRejectResponse.Data; /** * Whether the rejection was successful */ success: boolean; } export namespace DeliverableRejectResponse { export interface Data { /** * Campaign identifier */ campaignId: string; /** * Rejection reason */ reason: string; /** * When the rejection was processed */ rejectedAt: string; /** * Admin user who rejected */ rejectedBy: string; /** * Number of deliverables rejected */ rejectedCount: number; /** * IDs of rejected deliverables */ rejectedDeliverableIds: Array; /** * Detailed feedback */ feedback?: string; } } export interface DeliverableApproveParams { /** * Array of deliverable IDs to approve */ deliverableIds: Array; /** * Optional feedback for the approval */ feedback?: string; } export interface DeliverableRejectParams { /** * Array of deliverable IDs to reject */ deliverableIds: Array; /** * Reason for rejection */ reason: string; /** * Optional detailed feedback */ feedback?: string; } export declare namespace Deliverables { export { type DeliverableListResponse as DeliverableListResponse, type DeliverableApproveResponse as DeliverableApproveResponse, type DeliverableRejectResponse as DeliverableRejectResponse, type DeliverableApproveParams as DeliverableApproveParams, type DeliverableRejectParams as DeliverableRejectParams, }; }