From 7132b59a7650f197e4d862beb2668a25c04e713c Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Thu, 4 Jun 2020 16:32:16 -0400 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20add=20host=20catalog=20?= =?UTF-8?q?model=20and=20adapter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/api/addon/adapters/host-catalog.js | 6 +++ .../addon/generated/models/host-catalog.js | 41 +++++++++++++++++++ addons/api/addon/models/host-catalog.js | 3 ++ addons/api/app/adapters/host-catalog.js | 1 + addons/api/app/models/host-catalog.js | 1 + .../tests/unit/adapters/host-catalog-test.js | 11 +++++ .../tests/unit/models/host-catalog-test.js | 12 ++++++ 7 files changed, 75 insertions(+) create mode 100644 addons/api/addon/adapters/host-catalog.js create mode 100644 addons/api/addon/generated/models/host-catalog.js create mode 100644 addons/api/addon/models/host-catalog.js create mode 100644 addons/api/app/adapters/host-catalog.js create mode 100644 addons/api/app/models/host-catalog.js create mode 100644 addons/api/tests/unit/adapters/host-catalog-test.js create mode 100644 addons/api/tests/unit/models/host-catalog-test.js diff --git a/addons/api/addon/adapters/host-catalog.js b/addons/api/addon/adapters/host-catalog.js new file mode 100644 index 000000000..79d4b9444 --- /dev/null +++ b/addons/api/addon/adapters/host-catalog.js @@ -0,0 +1,6 @@ +import ApplicationAdapter from './application'; +import ScopeAdapterMixin from '../mixins/scope-adapter'; + +export default class HostCatalogAdapter extends ApplicationAdapter.extend( + ScopeAdapterMixin +) { } diff --git a/addons/api/addon/generated/models/host-catalog.js b/addons/api/addon/generated/models/host-catalog.js new file mode 100644 index 000000000..4a8166e3c --- /dev/null +++ b/addons/api/addon/generated/models/host-catalog.js @@ -0,0 +1,41 @@ +import BaseModel from '../../models/base'; +import { attr } from '@ember-data/model'; + +/** + * HostCatalog manages Hosts and HostSets + */ +export default class GeneratedHostCatalogModel extends BaseModel { + + // =attributes + + @attr('string', { + description: 'The type of the resource, to help differentiate schemas' + }) type; + + @attr('string', { + description: 'Optional name for identification purposes' + }) name; + + @attr('string', { + description: 'Optional user-set description for identification purposes' + }) description; + + @attr('date', { + description: 'The time this resource was created\nOutput only.', + readOnly: true + }) created_time; + + @attr('date', { + description: 'The time this resource was last updated\nOutput only.', + readOnly: true + }) updated_time; + + @attr('boolean', { + description: 'Whether the catalog is disabled' + }) disabled; + + @attr({ + description: 'Attributes specific to the catalog type' + }) attributes; + +} diff --git a/addons/api/addon/models/host-catalog.js b/addons/api/addon/models/host-catalog.js new file mode 100644 index 000000000..a0162bfeb --- /dev/null +++ b/addons/api/addon/models/host-catalog.js @@ -0,0 +1,3 @@ +import GeneratedHostCatalogModel from '../generated/models/host-catalog'; + +export default class HostCatalogModel extends GeneratedHostCatalogModel { } diff --git a/addons/api/app/adapters/host-catalog.js b/addons/api/app/adapters/host-catalog.js new file mode 100644 index 000000000..00197a624 --- /dev/null +++ b/addons/api/app/adapters/host-catalog.js @@ -0,0 +1 @@ +export { default } from 'api/adapters/host-catalog'; diff --git a/addons/api/app/models/host-catalog.js b/addons/api/app/models/host-catalog.js new file mode 100644 index 000000000..7125cd050 --- /dev/null +++ b/addons/api/app/models/host-catalog.js @@ -0,0 +1 @@ +export { default } from 'api/models/host-catalog'; diff --git a/addons/api/tests/unit/adapters/host-catalog-test.js b/addons/api/tests/unit/adapters/host-catalog-test.js new file mode 100644 index 000000000..6250cc547 --- /dev/null +++ b/addons/api/tests/unit/adapters/host-catalog-test.js @@ -0,0 +1,11 @@ +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; + +module('Unit | Adapter | host catalog', function(hooks) { + setupTest(hooks); + + test('it exists', function(assert) { + let adapter = this.owner.lookup('adapter:host-catalog'); + assert.ok(adapter); + }); +}); diff --git a/addons/api/tests/unit/models/host-catalog-test.js b/addons/api/tests/unit/models/host-catalog-test.js new file mode 100644 index 000000000..b653f00a5 --- /dev/null +++ b/addons/api/tests/unit/models/host-catalog-test.js @@ -0,0 +1,12 @@ +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; + +module('Unit | Model | host catalog', function(hooks) { + setupTest(hooks); + + test('it exists', function(assert) { + let store = this.owner.lookup('service:store'); + let model = store.createRecord('host-catalog', {}); + assert.ok(model); + }); +});