Skip to content

Latest commit

 

History

History
53 lines (38 loc) · 1.19 KB

NETWORKCONNECTABLE.md

File metadata and controls

53 lines (38 loc) · 1.19 KB

NetworkConnectable Module

NetworkConeectable is a parent class, for more information, check its children documentation.

Models

NetworkConnectable

Defines the structure for NetworkConnectable entities.

type NetworkConnectable = {
  _id?: string | ObjectId;
  id: string | ObjectId;
  createdAt: Date | string;
  updatedAt: Date | string;
  deletedAt?: Date;
  kind: 'Fiber' | 'Cord';
  connectors: (string | ObjectId | NetworkConnector)[];
  parent: string | ObjectId;
  project: string | ObjectId | Project;
  name: string;
};

Example Usage

Fetching NetworkConnectables

import OZMapSDK from 'ozmapsdk';

const sdk = new OZMapSDK('ozmapURL', { apiKey: 'yourApiKey' });

sdk.networkConnectable.find({ page: 1, limit: 10 }).then((pagination) => {
  console.log('NetworkConnectables:', pagination);
});

Fetching a NetworkConnectable by ID

import OZMapSDK from 'ozmapsdk';

const sdk = new OZMapSDK('ozmapURL', { apiKey: 'yourApiKey' });

sdk.networkConnectable.findById('networkConnectableId').then((networkConnectable) => {
  console.log('NetworkConnectable:', networkConnectable);
});