text: // @link http://acme-schemas.triniti.io/json-schema/acme/boost/node/sponsor/1-0-0.json#
  import Fb from '@gdbots/pbj/FieldBuilder';
  import Format from '@gdbots/pbj/enums/Format';
  import GdbotsNcrNodeV1Mixin from '@gdbots/schemas/gdbots/ncr/mixin/node/NodeV1Mixin';
  import Message from '@gdbots/pbj/Message';
  import NodeStatus from '@gdbots/schemas/gdbots/ncr/enums/NodeStatus';
  import Schema from '@gdbots/pbj/Schema';
  import SponsorType from '@triniti/schemas/triniti/boost/enums/SponsorType';
  import T from '@gdbots/pbj/types';
  import TrinitiBoostSponsorV1Mixin from '@triniti/schemas/triniti/boost/mixin/sponsor/SponsorV1Mixin';
  import UuidIdentifier from '@gdbots/pbj/well-known/UuidIdentifier';
  
  export default class SponsorV1 extends Message {
    /**
     * @private
     *
     * @returns {Schema}
     */
    static defineSchema() {
      return new Schema(this.SCHEMA_ID, this,
        [
          /*
           * The "_id" value:
           * - MUST NOT change for the life of the node.
           * - SHOULD be globally unique
           * - SHOULD be generated by the app (ideally in default value closure... e.g. UuidIdentifier::generate())
           */
          Fb.create('_id', T.IdentifierType.create())
            .required()
            .withDefault(() => UuidIdentifier.generate())
            .classProto(UuidIdentifier)
            .overridable(true)
            .build(),
          Fb.create('status', T.StringEnumType.create())
            .withDefault("draft")
            .classProto(NodeStatus)
            .build(),
          Fb.create('etag', T.StringType.create())
            .maxLength(100)
            .pattern('^[\\w\\.:-]+$')
            .build(),
          Fb.create('created_at', T.MicrotimeType.create())
            .build(),
          /*
           * A fully qualified reference to what created this node. This is intentionally a message-ref
           * and not a user id because it is often a program that creates nodes, not a user.
           */
          Fb.create('creator_ref', T.MessageRefType.create())
            .build(),
          Fb.create('updated_at', T.MicrotimeType.create())
            .useTypeDefault(false)
            .build(),
          /*
           * A fully qualified reference to what updated this node. This is intentionally a message-ref
           * and not a user id because it is often a program that updates nodes, not a user.
           * E.g. "acme:iam:node:app:cli-scheduler" or "acme:iam:node:user:60c71df0-fda8-11e5-bfb9-30342d363854"
           */
          Fb.create('updater_ref', T.MessageRefType.create())
            .build(),
          /*
           * A reference to the last event that changed the state of this node.
           * E.g. "acme:blog:event:article-published:60c71df0-fda8-11e5-bfb9-30342d363854"
           */
          Fb.create('last_event_ref', T.MessageRefType.create())
            .build(),
          Fb.create('title', T.StringType.create())
            .build(),
          Fb.create('type', T.StringEnumType.create())
            .withDefault("external")
            .classProto(SponsorType)
            .build(),
          /*
           * A string containing code that is injected into the application's html head tag.
           */
          Fb.create('permalink_html_head', T.TextType.create())
            .build(),
          /*
           * A string containing code that is injected into the application typically
           * next to/near the title of the content. It will be wrapped in a div with
           * the id and slug of the sponsor.
           */
          Fb.create('permalink_badge', T.TextType.create())
            .build(),
          /*
           * See description for "permalink_badge". This is very similar but in this
           * case the page is rendering many pieces of content, e.g. blogroll.
           */
          Fb.create('timeline_badge', T.TextType.create())
            .build(),
          /*
           * Tags is a map that categorizes data or tracks references in
           * external systems. The tags names should be consistent and descriptive,
           * e.g. fb_user_id:123, salesforce_customer_id:456.
           */
          Fb.create('tags', T.StringType.create())
            .asAMap()
            .pattern('^[\\w\\/\\.:-]+$')
            .build(),
          Fb.create('expires_at', T.DateTimeType.create())
            .build(),
          Fb.create('published_at', T.DateTimeType.create())
            .build(),
          /*
           * The "slug" is a secondary identifier, typically used in a url:
           * - MUST be url friendly
           * - SHOULD NOT be case sensitive
           * - SHOULD be unique within the message curie namespace
           * - CAN be changed, but in practice once nodes are published you should avoid it if possible
           */
          Fb.create('slug', T.StringType.create())
            .format(Format.SLUG)
            .build(),
        ],
        this.MIXINS,
      );
    }
  }
  
  const M = SponsorV1;
  M.prototype.SCHEMA_ID = M.SCHEMA_ID = 'pbj:acme:boost:node:sponsor:1-0-0';
  M.prototype.SCHEMA_CURIE = M.SCHEMA_CURIE = 'acme:boost:node:sponsor';
  M.prototype.SCHEMA_CURIE_MAJOR = M.SCHEMA_CURIE_MAJOR = 'acme:boost:node:sponsor:v1';
  M.prototype.MIXINS = M.MIXINS = [
    'gdbots:ncr:mixin:node:v1',
    'gdbots:ncr:mixin:node',
    'triniti:boost:mixin:sponsor:v1',
    'triniti:boost:mixin:sponsor',
    'gdbots:common:mixin:taggable:v1',
    'gdbots:common:mixin:taggable',
    'gdbots:ncr:mixin:expirable:v1',
    'gdbots:ncr:mixin:expirable',
    'gdbots:ncr:mixin:publishable:v1',
    'gdbots:ncr:mixin:publishable',
    'gdbots:ncr:mixin:sluggable:v1',
    'gdbots:ncr:mixin:sluggable',
  ];
  
  GdbotsNcrNodeV1Mixin(M);
  
  TrinitiBoostSponsorV1Mixin(M);
  
  Object.freeze(M);
  Object.freeze(M.prototype);
  