<commit_before>import stampit from 'stampit';
import {Meta, Model} from './base';

const APNSMessageMeta = Meta({
  name: 'apnsmessage',
  pluralName: 'apnsmessages',
  endpoints: {
    'detail': {
      'methods': ['delete', 'get'],
      'path': '/v1/instances/{instanceName}/push_notifications/apns/messages/{id}'
    },
    'list': {
      'methods': ['get'],
      'path': '/v1/instances/{instanceName}/push_notifications/apns/messages/'
    }
  }
});

const APNSMessage = stampit()
  .compose(Model)
  .setMeta(APNSMessageMeta);

export default APNSMessage;
<commit_msg>[LIB-464] APNSMessage custom Queryset + Constraints<commit_after>import stampit from 'stampit';
import {Meta, Model} from './base';
import {BaseQuerySet, Create, Get, GetOrCreate, List} from '../querySet';

const APNSMessageQuerySet = stampit().compose(
  BaseQuerySet,
  Create,
  Get,
  List,
  GetOrCreate
);

const APNSMessageMeta = Meta({
  name: 'apnsmessage',
  pluralName: 'apnsmessages',
  endpoints: {
    'detail': {
      'methods': ['delete', 'get'],
      'path': '/v1/instances/{instanceName}/push_notifications/apns/messages/{id}'
    },
    'list': {
      'methods': ['get'],
      'path': '/v1/instances/{instanceName}/push_notifications/apns/messages/'
    }
  }
});

const APNSMessageConstraints = {
  instanceName: {
    presence: true,
    length: {
      minimum: 5
    }
  }
};

const APNSMessage = stampit()
  .compose(Model)
  .setQuerySet(APNSMessageQuerySet)
  .setConstraints(APNSMessageConstraints)
  .setMeta(APNSMessageMeta);

export default APNSMessage;

{'fraction_non_alphanumeric': 0.159846547314578, 'fraction_numerical': 0.005115089514066497, 'mean_word_length': 3.860248447204969, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1328663', 'n_tokens_mistral': 534, 'n_tokens_neox': 537, 'n_words': 102}