Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import Model from 'ember-data/model';
import attr from 'ember-data/attr';
import { belongsTo, hasMany } from 'ember-data/relationships';
import {array, fragment, fragmentArray} from 'ember-data-model-fragments/attributes';
export default Model.extend({
changeTracker: {trackHasMany: true, auto: true, enableIsDirty: true},
name: attr('string'),
style: attr('string'),
// object type
info: attr('object'),
blob: attr('json'),
// fragments
list: array('number'),
location: fragment('location'),
things: fragmentArray('things'),
// associations
company: belongsTo('company', { async: true, polymorphic: true }),
profile: belongsTo('profile', { async: false }),
projects: hasMany('project', { async: true }),
pets: hasMany('pet', { async: false, polymorphic: true })
});
allowedValues: ['serf', 'script', 'http', 'tcp', 'ttl', 'docker', 'grpc', 'alias'],
},
};
export default class HealthCheck extends Fragment {
@attr('string') Name;
@attr('string') CheckID;
// an empty Type means its the Consul serf Check
@replace('', 'serf') @attr('string') Type;
@attr('string') Status;
@attr('string') Notes;
@attr('string') Output;
@attr('string') ServiceName;
@attr('string') ServiceID;
@attr('string') Node;
@nullValue([]) @array('string') ServiceTags;
@attr() Definition; // {}
// Exposed is only set correct if this Check is accessed via instance.MeshChecks
// essentially this is a lazy MeshHealthCheckModel
@attr('boolean') Exposed;
@computed('ServiceID')
get Kind() {
return this.ServiceID === '' ? 'node' : 'service';
}
@computed('Type')
get Exposable() {
return ['http', 'grpc'].includes(this.Type);
}
}
import Model from 'ember-data/model';
import attr from 'ember-data/attr';
import { array, fragment, fragmentArray } from 'ember-data-model-fragments/attributes';
export default Model.extend({
designation: fragment('name'),
name: fragment('name'),
titles: array('string'),
gender: attr('string'),
birthDate: attr('date'),
position: attr(),
departmentEmployments: fragmentArray('department-employment')
});
import Model from 'ember-data/model';
import attr from 'ember-data/attr';
import { array } from 'ember-data-model-fragments/attributes';
export default Model.extend({
income: attr('number'),
benefits: array('string')
});
export const schema = {
PathType: {
allowedValues: ['PathPrefix', 'PathExact', 'PathRegex'],
},
Methods: {
allowedValues: ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH'],
},
};
export default class IntentionPermissionHttp extends Fragment {
@attr('string') PathExact;
@attr('string') PathPrefix;
@attr('string') PathRegex;
@fragmentArray('intention-permission-http-header') Header;
@array('string') Methods;
@or(...schema.PathType.allowedValues) Path;
@computed(...schema.PathType.allowedValues)
get PathType() {
return schema.PathType.allowedValues.find(prop => typeof this[prop] === 'string');
}
}
import attr from "ember-data/attr";
import Fragment from "ember-data-model-fragments/fragment";
import { array } from "ember-data-model-fragments/attributes";
export default class TwitchTicketProductFeatures extends Fragment {
@attr( "number" )
base_emoticon_set_id;
@array( "number" )
emoticon_set_ids;
@attr( "string" )
tier;
}
export const schema = {
PathType: {
allowedValues: ['PathPrefix', 'PathExact', 'PathRegex'],
},
Methods: {
allowedValues: ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH'],
},
};
export default Fragment.extend({
PathExact: attr('string'),
PathPrefix: attr('string'),
PathRegex: attr('string'),
Header: fragmentArray('intention-permission-http-header'),
Methods: array('string'),
Path: or(...schema.PathType.allowedValues),
PathType: computed(...schema.PathType.allowedValues, function() {
return schema.PathType.allowedValues.find(prop => typeof this[prop] === 'string');
}),
});