declare module "wix-online-programs" {
  const __debug: {
      verboseLogging: {
          on: () => boolean;
          off: () => boolean;
      };
  };
  interface Program {
      /**
       * Program ID.
       * @readonly
       */
      _id?: string | null;
      /** @readonly */
      revision?: number | null;
      /** @readonly */
      _createdDate?: Date;
      /** @readonly */
      _updatedDate?: Date;
      /**
       * current program state / does participant need it?
       * @readonly
       */
      state?: State;
      /**
       * assigned categories
       * @readonly
       */
      categoryIds?: string[];
      /** general program info. */
      description?: Description;
      /** timeline type -> Self-paced, time-restricted. */
      timeline?: Timeline;
      /** participant limitation, step-completion pace and etc. */
      restrictions?: Restrictions;
      /** single-payment price. */
      pricing?: Money;
      /** seo settings. */
      seo?: Seo;
      /** rewards to be assigned after reaching some of the program milestones. */
      rewards?: Reward[];
      /** connected social group. */
      socialGroupId?: string | null;
      /** join flow options. */
      accessType?: AccessType;
  }
  enum State {
      /** not published program, visible only on BM */
      DRAFT = "DRAFT",
      /** program visible regarding to restrictions */
      PUBLISHED = "PUBLISHED",
      /** program isn't available to join. */
      FINISHED = "FINISHED",
      /** closed program. Joins and sections/steps are not available for participants. */
      ARCHIVED = "ARCHIVED"
  }
  interface Description extends DescriptionMediaOneOf {
      /** WixMedia image */
      image?: string;
      /** WixMedia video */
      video?: string;
      /** step title */
      title?: string;
      /** step additional details */
      details?: string | null;
  }
  /** @oneof */
  interface DescriptionMediaOneOf {
      /** WixMedia image */
      image?: string;
      /** WixMedia video */
      video?: string;
  }
  interface VideoResolution {
      /** Video URL. */
      url?: string;
      /** Video height. */
      height?: number;
      /** Video width. */
      width?: number;
      /**
       * Deprecated. Use the `posters` property in the parent entity instead.
       * @internal
       */
      poster?: string;
      /** Video format for example, mp4, hls. */
      format?: string;
      /**
       * Deprecated. Use the `urlExpirationDate` property in the parent entity instead.
       * @internal
       */
      urlExpirationDate?: Date;
      /**
       * Deprecated. Use the `sizeInBytes` property in the parent entity instead. Size cannot be provided per resolution.
       * @internal
       */
      sizeInBytes?: string | null;
      /**
       * Video quality. For example: 480p, 720p.
       * @internal
       */
      quality?: string | null;
      /**
       * Video filename.
       * @internal
       */
      filename?: string | null;
      /**
       * Video duration in seconds.
       * @internal
       * @readonly
       */
      durationInSeconds?: number | null;
      /**
       * When true, this is a protected asset, and calling the URL will return a 403 error.
       * In order to access private assets, make a request to:
       * `GenerateFileDownloadUrl` with the WixMedia id and specify the asset_key in the request
       * @internal
       * @readonly
       */
      private?: boolean | null;
      /**
       * Key to identify the video resolution's relationship to the original media in WixMedia.
       * Can be used to request a download for the specific video resolution.
       * For example: 480p.mp4, 720p.mp4, 1080p.mp4, trailer-720p.mp4, clip-720p.mp4
       * @internal
       * @readonly
       */
      assetKey?: string | null;
  }
  interface Timeline extends TimelineFinishConditionOneOf {
      /** finish participation after some time. */
      timeEvaluation?: TimeEvaluation;
      /** finish participation when all steps are resolved. */
      allStepsCompleted?: AllStepsCompleted;
      /** are sections/steps evaluated every day? Or can UoU participate in a self paced mode? */
      selfPaced?: boolean;
      /** everyone starts on this day */
      startDate?: string | null;
  }
  /** @oneof */
  interface TimelineFinishConditionOneOf {
      /** finish participation after some time. */
      timeEvaluation?: TimeEvaluation;
      /** finish participation when all steps are resolved. */
      allStepsCompleted?: AllStepsCompleted;
  }
  interface TimeEvaluation {
      /** evaluate after some period of time in days. */
      durationInDays?: number;
  }
  interface AllStepsCompleted {
  }
  interface Restrictions {
      /** limit of active participants in the program. */
      maxParticipants?: number | null;
      /** hide steps in the Pending state. */
      hideFutureSteps?: boolean;
      /** allow participants complete steps in the certain order. */
      resolveStepsInOrder?: boolean;
      /** allow program participants to share their progress in group */
      shareProgress?: boolean;
  }
  /**
   * Money.
   * Default format to use. Sufficiently compliant with majority of standards: w3c, ISO 4217, ISO 20022, ISO 8583:2003.
   */
  interface Money {
      /** Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). Optionally, a single (-), to indicate that the amount is negative. */
      value?: string;
      /** Currency code. Must be valid ISO 4217 currency code (e.g., USD). */
      currency?: string;
      /** Monetary amount. Decimal string in local format (e.g., 1 000,30). Optionally, a single (-), to indicate that the amount is negative. */
      formattedValue?: string | null;
  }
  interface Seo {
      /** challenge slug expression. */
      slug?: string;
      /** schema used by Seo team */
      seoData?: SeoSchema;
      /** program url */
      url?: string;
      /** image url from description media */
      imageUrl?: string | null;
  }
  /**
   * The SEO schema object contains data about different types of meta tags. It makes sure that the information about your page is presented properly to search engines.
   * The search engines use this information for ranking purposes, or to display snippets in the search results.
   * This data will override other sources of tags (for example patterns) and will be included in the <head> section of the HTML document, while not being displayed on the page itself.
   */
  interface SeoSchema {
      /** SEO tag information. */
      tags?: Tag[];
      /** SEO general settings. */
      settings?: Settings;
  }
  interface Keyword {
      /** Keyword value. */
      term?: string;
      /** Whether the keyword is the main focus keyword. */
      isMain?: boolean;
  }
  interface Tag {
      /**
       * SEO tag type.
       *
       *
       * Supported values: `title`, `meta`, `script`, `link`.
       */
      type?: string;
      /**
       * A `{'key':'value'}` pair object where each SEO tag property (`'name'`, `'content'`, `'rel'`, `'href'`) contains a value.
       * For example: `{'name': 'description', 'content': 'the description itself'}`.
       */
      props?: Record<string, any> | null;
      /** SEO tag meta data. For example, `{height: 300, width: 240}`. */
      meta?: Record<string, any> | null;
      /** SEO tag inner content. For example, `<title> inner content </title>`. */
      children?: string;
      /** Whether the tag is a custom tag. */
      custom?: boolean;
      /** Whether the tag is disabled. */
      disabled?: boolean;
  }
  interface Settings {
      /**
       * Whether the Auto Redirect feature, which creates `301 redirects` on a slug change, is enabled.
       *
       *
       * Default: `false` (Auto Redirect is enabled.)
       */
      preventAutoRedirect?: boolean;
      /** User-selected keyword terms for a specific page. */
      keywords?: Keyword[];
  }
  interface Reward {
      /** on which action rewards must be assigned. */
      trigger?: Trigger;
      /** badges participant will get on program complete */
      badgeIds?: string[];
      /** certificate for program. Currently is program GUID */
      certificate?: Certificate;
  }
  enum Trigger {
      /** member joins the program */
      JOINED_TO_PROGRAM = "JOINED_TO_PROGRAM",
      /** at least one step completed */
      STEP_COMPLETED = "STEP_COMPLETED",
      /** all steps are completed. */
      ALL_STEPS_COMPLETED = "ALL_STEPS_COMPLETED"
  }
  interface Certificate {
      /** Certificate for program completion. Currently is program GUID */
      _id?: string | null;
      /** date it was connected to program */
      connectedDate?: Date;
  }
  enum AccessType {
      /** join without approvals */
      PUBLIC = "PUBLIC",
      /** send a join request to the owner and get an approval from him. */
      PRIVATE = "PRIVATE",
      /** join possible only after owner invite. */
      SECRET = "SECRET"
  }
  interface CreateProgramRequest {
      /** Program to be created. */
      program: Program;
  }
  interface CreateProgramResponse {
      /** The created Program. */
      program?: Program;
  }
  interface CloneProgramRequest {
      /** Program to be created. */
      programId: string;
  }
  interface CloneProgramResponse {
      /** The created Program. */
      program?: Program;
  }
  interface GetProgramRequest {
      /** ID of the Program to retrieve. */
      programId: string;
  }
  interface GetProgramResponse {
      /** The requested Program. */
      program?: Program;
  }
  interface UpdateProgramRequest {
      /** Program to be updated, may be partial. */
      program: Program;
      /**
       * Set of fields to update.
       *
       * Fields that aren't included in `fieldMask.paths` are ignored.
       * @internal
       */
      fieldMask?: string[];
  }
  interface UpdateProgramResponse {
      /** Updated Program. */
      program?: Program;
  }
  interface DeleteProgramRequest {
      /** Id of the Program to delete. */
      programId: string;
  }
  interface DeleteProgramResponse {
  }
  interface QueryProgramsRequest {
      query?: CursorQuery;
  }
  interface CursorQuery extends CursorQueryPagingMethodOneOf {
      /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
      cursorPaging?: CursorPaging;
      /**
       * Filter object in the following format:
       * `"filter" : {
       * "fieldName1": "value1",
       * "fieldName2":{"$operator":"value2"}
       * }`
       * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
       */
      filter?: Record<string, any> | null;
      /**
       * Sort object in the following format:
       * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
       */
      sort?: Sorting[];
  }
  /** @oneof */
  interface CursorQueryPagingMethodOneOf {
      /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
      cursorPaging?: CursorPaging;
  }
  interface Sorting {
      /** Name of the field to sort by. */
      fieldName?: string;
      /** Sort order. */
      order?: SortOrder;
  }
  enum SortOrder {
      ASC = "ASC",
      DESC = "DESC"
  }
  interface CursorPaging {
      /** Number of items to load. */
      limit?: number | null;
      /**
       * Pointer to the next or previous page in the list of results.
       *
       * You can get the relevant cursor token
       * from the `pagingMetadata` object in the previous call's response.
       * Not relevant for the first request.
       */
      cursor?: string | null;
  }
  interface QueryProgramsResponse {
      programs?: Program[];
      pagingMetadata?: CursorPagingMetadata;
  }
  interface CursorPagingMetadata {
      /** Number of items returned in the response. */
      count?: number | null;
      /** Offset that was requested. */
      cursors?: Cursors;
      /**
       * Indicates if there are more results after the current page.
       * If `true`, another page of results can be retrieved.
       * If `false`, this is the last page.
       */
      hasNext?: boolean | null;
  }
  interface Cursors {
      /** Cursor pointing to next page in the list of results. */
      next?: string | null;
      /** Cursor pointing to previous page in the list of results. */
      prev?: string | null;
  }
  interface PublishProgramRequest {
      programId: string;
  }
  interface PublishProgramResponse {
      program?: Program;
  }
  interface ChangedProgramState {
      programId?: string;
      newState?: State;
  }
  interface FinishProgramRequest {
      programId: string;
  }
  interface FinishProgramResponse {
      program?: Program;
  }
  interface ArchiveProgramRequest {
      programId: string;
  }
  interface ArchiveProgramResponse {
      program?: Program;
  }
  interface ListSampleProgramsRequest {
  }
  interface ListSampleProgramsResponse {
      programs?: Program[];
  }
  interface GetProgramStatisticsRequest {
      programId: string;
  }
  interface GetProgramStatisticsResponse {
      /** number of active and finished participants. */
      totalJoined?: number;
      /** number of pending join requests */
      totalCompleted?: number;
      /** number of invited members. */
      totalFailed?: number;
      /** number of participants waiting for the owner payment confirmation. */
      totalApprovalWaiting?: number;
      totalWithoutProgress?: number;
      totalWithProgress?: number;
  }
  interface ListProgramMembershipsRequest {
      paging?: CursorPaging;
  }
  interface ListProgramMembershipsResponse {
      programMemberships?: ProgramMembership[];
      pagingMetadata?: CursorPagingMetadata;
  }
  interface ProgramMembership {
      program?: Program;
      membership?: Membership;
  }
  interface Membership {
      participantId?: string;
      participantState?: ParticipantState;
  }
  enum ParticipantState {
      JOINED = "JOINED",
      COMPLETED = "COMPLETED",
      FAILED = "FAILED",
      INVITED = "INVITED",
      JOIN_REQUESTED = "JOIN_REQUESTED"
  }
  interface GetProgramMembershipRequest {
      programId: string;
  }
  interface GetProgramMembershipResponse {
      program?: ProgramMembership;
  }
  /**
   * Creates a Program.
   *
   * This function is not a universal function and runs only on the backend.
   * @param program - Program to be created.
   * @internal
   * @documentationMaturity preview
   * @requiredField program
   * @adminMethod
   * @returns The created Program.
   */
  function createProgram(program: Program): Promise<Program>;
  /**
   * Clones a Program.
   *
   * This function is not a universal function and runs only on the backend.
   * @param programId - Program to be created.
   * @internal
   * @documentationMaturity preview
   * @requiredField programId
   * @adminMethod
   */
  function cloneProgram(programId: string): Promise<CloneProgramResponse>;
  /**
   * Retrieves a Program.
   *
   * This function is not a universal function and runs only on the backend.
   * @param programId - ID of the Program to retrieve.
   * @internal
   * @documentationMaturity preview
   * @requiredField programId
   * @adminMethod
   * @returns The requested Program.
   */
  function getProgram(programId: string): Promise<Program>;
  /**
   * Updates a Program.
   *
   * This function is not a universal function and runs only on the backend.
   * @param _id - Program ID.
   * @internal
   * @documentationMaturity preview
   * @requiredField _id
   * @requiredField program
   * @requiredField program.revision
   * @adminMethod
   * @returns Updated Program.
   */
  function updateProgram(_id: string | null, program: UpdateProgram, options?: UpdateProgramOptions): Promise<Program>;
  interface UpdateProgram {
      /**
       * Program ID.
       * @readonly
       */
      _id?: string | null;
      /** @readonly */
      revision?: number | null;
      /** @readonly */
      _createdDate?: Date;
      /** @readonly */
      _updatedDate?: Date;
      /**
       * current program state / does participant need it?
       * @readonly
       */
      state?: State;
      /**
       * assigned categories
       * @readonly
       */
      categoryIds?: string[];
      /** general program info. */
      description?: Description;
      /** timeline type -> Self-paced, time-restricted. */
      timeline?: Timeline;
      /** participant limitation, step-completion pace and etc. */
      restrictions?: Restrictions;
      /** single-payment price. */
      pricing?: Money;
      /** seo settings. */
      seo?: Seo;
      /** rewards to be assigned after reaching some of the program milestones. */
      rewards?: Reward[];
      /** connected social group. */
      socialGroupId?: string | null;
      /** join flow options. */
      accessType?: AccessType;
  }
  interface UpdateProgramOptions {
      /**
       * Set of fields to update.
       *
       * Fields that aren't included in `fieldMask.paths` are ignored.
       * @internal
       */
      fieldMask?: string[];
  }
  /**
   * Deletes a Program.
   * Deleting a Program permanently removes them from the Program List.
   *
   * This function is not a universal function and runs only on the backend.
   * @param programId - Id of the Program to delete.
   * @internal
   * @documentationMaturity preview
   * @requiredField programId
   * @adminMethod
   */
  function deleteProgram(programId: string): Promise<void>;
  /**
   * Retrieves a list of Programs
   *
   * This function is not a universal function and runs only on the backend.
   * @internal
   * @documentationMaturity preview
   * @adminMethod
   */
  function queryPrograms(): ProgramsQueryBuilder;
  interface QueryCursorResult {
      cursors: Cursors;
      hasNext: () => boolean;
      hasPrev: () => boolean;
      length: number;
      pageSize: number;
  }
  interface ProgramsQueryResult extends QueryCursorResult {
      items: Program[];
      query: ProgramsQueryBuilder;
      next: () => Promise<ProgramsQueryResult>;
      prev: () => Promise<ProgramsQueryResult>;
  }
  interface ProgramsQueryBuilder {
      /** @param propertyName - Property whose value is compared with `value`.
       * @param value - Value to compare against.
       * @documentationMaturity preview
       */
      eq: (propertyName: 'state', value: any) => ProgramsQueryBuilder;
      /** @documentationMaturity preview */
      in: (propertyName: 'state' | 'categoryIds', value: any) => ProgramsQueryBuilder;
      /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
       * @documentationMaturity preview
       */
      ascending: (...propertyNames: Array<'state'>) => ProgramsQueryBuilder;
      /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
       * @documentationMaturity preview
       */
      descending: (...propertyNames: Array<'state'>) => ProgramsQueryBuilder;
      /** @param limit - Number of items to return, which is also the `pageSize` of the results object.
       * @documentationMaturity preview
       */
      limit: (limit: number) => ProgramsQueryBuilder;
      /** @param cursor - A pointer to specific record
       * @documentationMaturity preview
       */
      skipTo: (cursor: string) => ProgramsQueryBuilder;
      /** @documentationMaturity preview */
      find: () => Promise<ProgramsQueryResult>;
  }
  /**
   * This function is not a universal function and runs only on the backend.
   * @internal
   * @documentationMaturity preview
   * @requiredField programId
   * @adminMethod
   */
  function publishProgram(programId: string): Promise<PublishProgramResponse>;
  /**
   * This function is not a universal function and runs only on the backend.
   * @internal
   * @documentationMaturity preview
   * @requiredField programId
   * @adminMethod
   */
  function finishProgram(programId: string): Promise<FinishProgramResponse>;
  /**
   * This function is not a universal function and runs only on the backend.
   * @internal
   * @documentationMaturity preview
   * @requiredField programId
   * @adminMethod
   */
  function archiveProgram(programId: string): Promise<ArchiveProgramResponse>;
  /**
   * This function is not a universal function and runs only on the backend.
   * @internal
   * @documentationMaturity preview
   * @adminMethod
   */
  function listSamplePrograms(): Promise<ListSampleProgramsResponse>;
  /**
   * This function is not a universal function and runs only on the backend.
   * @internal
   * @documentationMaturity preview
   * @requiredField programId
   * @adminMethod
   */
  function getProgramStatistics(programId: string): Promise<GetProgramStatisticsResponse>;
  /**
   * This function is not a universal function and runs only on the backend.
   * @internal
   * @documentationMaturity preview
   * @adminMethod
   */
  function listProgramMemberships(options?: ListProgramMembershipsOptions): Promise<ListProgramMembershipsResponse>;
  interface ListProgramMembershipsOptions {
      paging?: CursorPaging;
  }
  /**
   * This function is not a universal function and runs only on the backend.
   * @internal
   * @documentationMaturity preview
   * @requiredField programId
   * @adminMethod
   */
  function getProgramMembership(programId: string): Promise<GetProgramMembershipResponse>;
  
  export { AccessType, AllStepsCompleted, ArchiveProgramRequest, ArchiveProgramResponse, Certificate, ChangedProgramState, CloneProgramRequest, CloneProgramResponse, CreateProgramRequest, CreateProgramResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DeleteProgramRequest, DeleteProgramResponse, Description, DescriptionMediaOneOf, FinishProgramRequest, FinishProgramResponse, GetProgramMembershipRequest, GetProgramMembershipResponse, GetProgramRequest, GetProgramResponse, GetProgramStatisticsRequest, GetProgramStatisticsResponse, Keyword, ListProgramMembershipsOptions, ListProgramMembershipsRequest, ListProgramMembershipsResponse, ListSampleProgramsRequest, ListSampleProgramsResponse, Membership, Money, ParticipantState, Program, ProgramMembership, ProgramsQueryBuilder, ProgramsQueryResult, PublishProgramRequest, PublishProgramResponse, QueryProgramsRequest, QueryProgramsResponse, Restrictions, Reward, Seo, SeoSchema, Settings, SortOrder, Sorting, State, Tag, TimeEvaluation, Timeline, TimelineFinishConditionOneOf, Trigger, UpdateProgram, UpdateProgramOptions, UpdateProgramRequest, UpdateProgramResponse, VideoResolution, __debug, archiveProgram, cloneProgram, createProgram, deleteProgram, finishProgram, getProgram, getProgramMembership, getProgramStatistics, listProgramMemberships, listSamplePrograms, publishProgram, queryPrograms, updateProgram };
}
