declare module "wix-badges-backend.v2" {
  const __debug: {
      verboseLogging: {
          on: () => boolean;
          off: () => boolean;
      };
  };
  interface Badge {
      /** Badge id */
      _id?: string;
      /** Badge title */
      title?: string;
      /** Badge description */
      description?: string;
      /** Badge background color in 6-digit color hex in upper case (e.g. #FFFFFF) */
      backgroundColor?: string;
      /** Badge text color in 6-digit color hex in upper case (e.g. #FFFFFF) */
      textColor?: string;
      /** Badge icon SVG as 'https://...' */
      icon?: string;
      /** Id of role/group in groups service that badge assignee belongs to */
      roleId?: string;
      /**
       * Indicates whether badge has permissions.
       *
       * Badges can have special permissions to access specific members-only pages.
       *
       * When the value is set to **true**, badge permissions can be managed in
       * [permissions table](https://www.wix.com/my-account/site-selector/?buttonText=Manage%20Permissions&amp;title=Select%20a%20Site&amp;autoSelectOnSingleSite=true&amp;actionUrl=https://www.wix.com/dashboard/{{metaSiteId}}/member-permissions/roles/manage-permissions).
       * Site members will receive relevant permissions once assigned such badge.
       *
       * When the value is set to **false**, badge has no associated permissions
       * and is not visible in permissions table.
       * Site member will not receive any permissions once assigned such badge.
       */
      hasPermissions?: boolean;
      /** Badge url keyword operator */
      slug?: string;
      /** Date when badge was created */
      createDate?: Date;
      /** Date when badge was last updated */
      updateDate?: Date;
  }
  interface CreateRequest {
      /** Badge title */
      title: string;
      /** Badge description */
      description?: string;
      /** Badge background color in 6-digit upper-cased color hex (e.g. #FFFFFF) */
      backgroundColor: string;
      /** Badge text color in 6-digit upper-cased color hex (e.g. #FFFFFF) */
      textColor: string;
      /** Badge icon SVG as 'https://...' */
      icon?: string;
      /** Indicates whether badge has permissions */
      hasPermissions?: boolean;
  }
  interface CreateResponse {
      /** Created badge */
      badge?: Badge;
  }
  interface UpdateRequest {
      /** Badge id */
      _id: string;
      /** Badge title */
      title?: string | null;
      /** Badge description */
      description?: string | null;
      /** Badge background color in 6-digit upper-cased color hex (e.g. #FFFFFF) */
      backgroundColor?: string | null;
      /** Badge text color in 6-digit upper-cased color hex (e.g. #FFFFFF) */
      textColor?: string | null;
      /** Badge icon SVG as 'https://...' */
      icon?: string | null;
      /** Indicates whether badge has permissions */
      hasPermissions?: boolean | null;
  }
  interface UpdateResponse {
      /** Updated badge */
      badge?: Badge;
  }
  interface ListRequest {
      /** Limit the number of badges to return */
      limit?: number | null;
      /** Default offset is 0. */
      offset?: number | null;
  }
  interface ListResponse {
      /** List of badges in a site */
      badges?: Badge[];
  }
  interface QueryRequest {
      /** Filter criteria */
      filter?: Record<string, any> | null;
      /** Sorting criteria */
      sort?: Sorting[];
      /** Result paging data */
      paging?: Paging;
  }
  interface Sorting {
      /** Name of the field to sort by. */
      fieldName?: string;
      /** Sort order. */
      order?: SortOrder;
  }
  enum SortOrder {
      ASC = "ASC",
      DESC = "DESC"
  }
  interface Paging {
      /** Limit the number of badges to return */
      limit?: number | null;
      /** Default offset is 0. */
      offset?: number | null;
  }
  interface QueryResponse {
      /** List of sorted badges in a site that satisfy filter and paging */
      badges?: Badge[];
      /** Total count of badges in a site that satisfy given filter */
      count?: string;
  }
  interface GetRequest {
      /** Badge id */
      _id: string;
  }
  interface GetResponse {
      /** Badge */
      badge?: Badge;
  }
  interface DeleteRequest {
      /** Badge id */
      _id: string;
  }
  interface DeleteResponse {
  }
  interface CountRequest {
      /** Filter criteria used for counting */
      filter?: Record<string, any> | null;
  }
  interface CountResponse {
      /** Badges count */
      count?: string;
  }
  interface AssignBadgeRequest {
      /** Badge id */
      _id: string;
      /** Ids of members this badge should be assigned to */
      memberIds: string[];
  }
  interface AssignBadgeResponse {
      /** Ids of members given badge has been assigned to */
      memberIds?: string[];
  }
  interface BadgeAssigned {
      /** Member ids who have the given badge assigned */
      memberId?: string;
  }
  interface UnassignBadgeRequest {
      /** Badge id */
      _id: string;
      /** Ids of members given badge will be removed from */
      memberIds: string[];
  }
  interface UnassignBadgeResponse {
  }
  interface BadgeUnassigned {
      /** Member id who had the badge unassigned */
      memberId?: string;
  }
  interface ListMembersRequest {
      /** Badge id */
      _id: string;
  }
  interface ListMembersResponse {
      /** Member ids who have the given badge assigned */
      memberIds?: string[];
  }
  interface ListMembersBadgeIdsRequest {
      /** Ids of members whose badge ids should be listed */
      memberIds: string[];
  }
  interface ListMembersBadgeIdsResponse {
      /** List of members with Ids of badges assigned to them */
      memberBadgeIds?: MemberBadgeIds[];
  }
  interface MemberBadgeIds {
      /** Member id */
      memberId?: string;
      /** Badge ids assigned to a given member */
      badgeIds?: string[];
  }
  interface GetBadgeCountersRequest {
  }
  interface GetBadgeCountersResponse {
      /** Ids of badges with a member count with this assigned badge */
      badgeMemberCounts?: BadgeMemberCount[];
  }
  interface BadgeMemberCount {
      /** Badge id */
      badgeId?: string;
      /** Number of members with assigned badge */
      memberCount?: number;
  }
  interface UpdateBadgesOrderRequest {
      /** Ordered badges ids */
      badgeIds?: string[];
  }
  interface UpdateBadgesOrderResponse {
      /** Reordered badges */
      badges?: Badge[];
  }
  /**
   * Create badge
   * @param title - Badge title
   * @internal
   * @documentationMaturity preview
   * @requiredField options
   * @requiredField options.backgroundColor
   * @requiredField options.textColor
   * @requiredField title
   */
  function create(title: string, options: CreateOptions): Promise<CreateResponse>;
  interface CreateOptions {
      /** Badge description */
      description?: string;
      /** Badge background color in 6-digit upper-cased color hex (e.g. #FFFFFF) */
      backgroundColor: string;
      /** Badge text color in 6-digit upper-cased color hex (e.g. #FFFFFF) */
      textColor: string;
      /** Badge icon SVG as 'https://...' */
      icon?: string;
      /** Indicates whether badge has permissions */
      hasPermissions?: boolean;
  }
  /**
   * Update badge
   * @param _id - Badge id
   * @internal
   * @documentationMaturity preview
   * @requiredField _id
   */
  function update(_id: string, options?: UpdateOptions): Promise<UpdateResponse>;
  interface UpdateOptions {
      /** Badge title */
      title?: string | null;
      /** Badge description */
      description?: string | null;
      /** Badge background color in 6-digit upper-cased color hex (e.g. #FFFFFF) */
      backgroundColor?: string | null;
      /** Badge text color in 6-digit upper-cased color hex (e.g. #FFFFFF) */
      textColor?: string | null;
      /** Badge icon SVG as 'https://...' */
      icon?: string | null;
      /** Indicates whether badge has permissions */
      hasPermissions?: boolean | null;
  }
  /**
   * List all badges in a site
   * @internal
   * @documentationMaturity preview
   */
  function list(options?: ListOptions): Promise<ListResponse>;
  interface ListOptions {
      /** Limit the number of badges to return */
      limit?: number | null;
      /** Default offset is 0. */
      offset?: number | null;
  }
  /**
   * Query badges in a site
   * @internal
   * @documentationMaturity preview
   */
  function query(options?: QueryOptions): Promise<QueryResponse>;
  interface QueryOptions {
      /** Filter criteria */
      filter?: Record<string, any> | null;
      /** Sorting criteria */
      sort?: Sorting[];
      /** Result paging data */
      paging?: Paging;
  }
  /**
   * Get a badge
   * @param _id - Badge id
   * @internal
   * @documentationMaturity preview
   * @requiredField _id
   */
  function get(_id: string): Promise<GetResponse>;
  /**
   * Delete a badge
   * @param _id - Badge id
   * @internal
   * @documentationMaturity preview
   * @requiredField _id
   */
  function _delete(_id: string): Promise<void>;
  /**
   * Count badges in a site
   * @internal
   * @documentationMaturity preview
   */
  function count(options?: CountOptions): Promise<CountResponse>;
  interface CountOptions {
      /** Filter criteria used for counting */
      filter?: Record<string, any> | null;
  }
  /**
   * Assign a badge to the given members
   * @param _id - Badge id
   * @param memberIds - Ids of members this badge should be assigned to
   * @internal
   * @documentationMaturity preview
   * @requiredField _id
   * @requiredField memberIds
   */
  function assignBadge(_id: string, memberIds: string[]): Promise<AssignBadgeResponse>;
  /**
   * Remove badge from given members
   * @param _id - Badge id
   * @param memberIds - Ids of members given badge will be removed from
   * @internal
   * @documentationMaturity preview
   * @requiredField _id
   * @requiredField memberIds
   */
  function unassignBadge(_id: string, memberIds: string[]): Promise<void>;
  /**
   * Return list of members that have the given badge
   * @param _id - Badge id
   * @internal
   * @documentationMaturity preview
   * @requiredField _id
   */
  function listMembers(_id: string): Promise<ListMembersResponse>;
  /**
   * Return list of badge ids assigned to a given members
   * @param memberIds - Ids of members whose badge ids should be listed
   * @internal
   * @documentationMaturity preview
   * @requiredField memberIds
   */
  function listMembersBadgeIds(memberIds: string[]): Promise<ListMembersBadgeIdsResponse>;
  /**
   * Return badge ids with a count of members they are assigned to
   * @internal
   * @documentationMaturity preview
   */
  function getBadgeCounters(): Promise<GetBadgeCountersResponse>;
  /**
   * Update badges order
   * @internal
   * @documentationMaturity preview
   */
  function updateBadgesOrder(options?: UpdateBadgesOrderOptions): Promise<UpdateBadgesOrderResponse>;
  interface UpdateBadgesOrderOptions {
      /** Ordered badges ids */
      badgeIds?: string[];
  }
  
  export { AssignBadgeRequest, AssignBadgeResponse, Badge, BadgeAssigned, BadgeMemberCount, BadgeUnassigned, CountOptions, CountRequest, CountResponse, CreateOptions, CreateRequest, CreateResponse, DeleteRequest, DeleteResponse, GetBadgeCountersRequest, GetBadgeCountersResponse, GetRequest, GetResponse, ListMembersBadgeIdsRequest, ListMembersBadgeIdsResponse, ListMembersRequest, ListMembersResponse, ListOptions, ListRequest, ListResponse, MemberBadgeIds, Paging, QueryOptions, QueryRequest, QueryResponse, SortOrder, Sorting, UnassignBadgeRequest, UnassignBadgeResponse, UpdateBadgesOrderOptions, UpdateBadgesOrderRequest, UpdateBadgesOrderResponse, UpdateOptions, UpdateRequest, UpdateResponse, __debug, _delete, assignBadge, count, create, get, getBadgeCounters, list, listMembers, listMembersBadgeIds, query, unassignBadge, update, updateBadgesOrder };
}
