Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

[AutoPR eventgrid/data-plane] Add connection state events and update LifeCycleEvents #3206

Merged
merged 1 commit into from
Jul 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

'use strict';

/**
* Information about the device connection state event.
*
*/
class DeviceConnectionStateEventInfo {
/**
* Create a DeviceConnectionStateEventInfo.
* @member {string} [sequenceNumber] Sequence number is string representation
* of a hexadecimal number. string compare can be used to identify the larger
* number because both in ASCII and HEX numbers come after alphabets. If you
* are converting the string to hex, then the number is a 256 bit number.
*/
constructor() {
}

/**
* Defines the metadata of DeviceConnectionStateEventInfo
*
* @returns {object} metadata of DeviceConnectionStateEventInfo
*
*/
mapper() {
return {
required: false,
serializedName: 'DeviceConnectionStateEventInfo',
type: {
name: 'Composite',
className: 'DeviceConnectionStateEventInfo',
modelProperties: {
sequenceNumber: {
required: false,
serializedName: 'sequenceNumber',
type: {
name: 'String'
}
}
}
}
};
}
}

module.exports = DeviceConnectionStateEventInfo;
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

'use strict';

const models = require('./index');

/**
* Schema of the Data property of an EventGridEvent for a device connection
* state event (DeviceConnected, DeviceDisconnected).
*
*/
class DeviceConnectionStateEventProperties {
/**
* Create a DeviceConnectionStateEventProperties.
* @member {string} [deviceId] The unique identifier of the device. This
* case-sensitive string can be up to 128 characters long, and supports ASCII
* 7-bit alphanumeric characters plus the following special characters: - : .
* + % _ # * ? ! ( ) , = @ ; $ '.
* @member {string} [moduleId] The unique identifier of the module. This
* case-sensitive string can be up to 128 characters long, and supports ASCII
* 7-bit alphanumeric characters plus the following special characters: - : .
* + % _ # * ? ! ( ) , = @ ; $ '.
* @member {string} [hubName] Name of the IoT Hub where the device was
* created or deleted.
* @member {object} [deviceConnectionStateEventInfo] Information about the
* device connection state event.
* @member {string} [deviceConnectionStateEventInfo.sequenceNumber] Sequence
* number is string representation of a hexadecimal number. string compare
* can be used to identify the larger number because both in ASCII and HEX
* numbers come after alphabets. If you are converting the string to hex,
* then the number is a 256 bit number.
*/
constructor() {
}

/**
* Defines the metadata of DeviceConnectionStateEventProperties
*
* @returns {object} metadata of DeviceConnectionStateEventProperties
*
*/
mapper() {
return {
required: false,
serializedName: 'DeviceConnectionStateEventProperties',
type: {
name: 'Composite',
className: 'DeviceConnectionStateEventProperties',
modelProperties: {
deviceId: {
required: false,
serializedName: 'deviceId',
type: {
name: 'String'
}
},
moduleId: {
required: false,
serializedName: 'moduleId',
type: {
name: 'String'
}
},
hubName: {
required: false,
serializedName: 'hubName',
type: {
name: 'String'
}
},
deviceConnectionStateEventInfo: {
required: false,
serializedName: 'deviceConnectionStateEventInfo',
type: {
name: 'Composite',
className: 'DeviceConnectionStateEventInfo'
}
}
}
}
};
}
}

module.exports = DeviceConnectionStateEventProperties;
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,8 @@ class DeviceLifeCycleEventProperties {
* + % _ # * ? ! ( ) , = @ ; $ '.
* @member {string} [hubName] Name of the IoT Hub where the device was
* created or deleted.
* @member {string} [opType] The event type specified for this operation by
* the IoT Hub.
* @member {string} [operationTimestamp] The ISO8601 timestamp of the
* operation.
* @member {object} [twin] Information about the device twin, which is the
* cloud represenation of application device metadata.
* cloud representation of application device metadata.
* @member {string} [twin.authenticationType] Authentication type used for
* this device: either SAS, SelfSigned, or CertificateAuthority.
* @member {number} [twin.cloudToDeviceMessageCount] Count of cloud to device
Expand Down Expand Up @@ -109,20 +105,6 @@ class DeviceLifeCycleEventProperties {
name: 'String'
}
},
opType: {
required: false,
serializedName: 'opType',
type: {
name: 'String'
}
},
operationTimestamp: {
required: false,
serializedName: 'operationTimestamp',
type: {
name: 'String'
}
},
twin: {
required: false,
serializedName: 'twin',
Expand Down
2 changes: 1 addition & 1 deletion lib/services/eventgrid/lib/models/deviceTwinInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
const models = require('./index');

/**
* Information about the device twin, which is the cloud represenation of
* Information about the device twin, which is the cloud representation of
* application device metadata.
*
*/
Expand Down
77 changes: 69 additions & 8 deletions lib/services/eventgrid/lib/models/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,12 +434,8 @@ export interface SubscriptionDeletedEventData {
* % _ # * ? ! ( ) , = @ ; $ '.
* @member {string} [hubName] Name of the IoT Hub where the device was created
* or deleted.
* @member {string} [opType] The event type specified for this operation by the
* IoT Hub.
* @member {string} [operationTimestamp] The ISO8601 timestamp of the
* operation.
* @member {object} [twin] Information about the device twin, which is the
* cloud represenation of application device metadata.
* cloud representation of application device metadata.
* @member {string} [twin.authenticationType] Authentication type used for this
* device: either SAS, SelfSigned, or CertificateAuthority.
* @member {number} [twin.cloudToDeviceMessageCount] Count of cloud to device
Expand Down Expand Up @@ -487,8 +483,6 @@ export interface SubscriptionDeletedEventData {
export interface DeviceLifeCycleEventProperties {
deviceId?: string;
hubName?: string;
opType?: string;
operationTimestamp?: string;
twin?: DeviceTwinInfo;
}

Expand All @@ -512,6 +506,58 @@ export interface IotHubDeviceCreatedEventData extends DeviceLifeCycleEventProper
export interface IotHubDeviceDeletedEventData extends DeviceLifeCycleEventProperties {
}

/**
* @class
* Initializes a new instance of the DeviceConnectionStateEventProperties class.
* @constructor
* Schema of the Data property of an EventGridEvent for a device connection
* state event (DeviceConnected, DeviceDisconnected).
*
* @member {string} [deviceId] The unique identifier of the device. This
* case-sensitive string can be up to 128 characters long, and supports ASCII
* 7-bit alphanumeric characters plus the following special characters: - : . +
* % _ # * ? ! ( ) , = @ ; $ '.
* @member {string} [moduleId] The unique identifier of the module. This
* case-sensitive string can be up to 128 characters long, and supports ASCII
* 7-bit alphanumeric characters plus the following special characters: - : . +
* % _ # * ? ! ( ) , = @ ; $ '.
* @member {string} [hubName] Name of the IoT Hub where the device was created
* or deleted.
* @member {object} [deviceConnectionStateEventInfo] Information about the
* device connection state event.
* @member {string} [deviceConnectionStateEventInfo.sequenceNumber] Sequence
* number is string representation of a hexadecimal number. string compare can
* be used to identify the larger number because both in ASCII and HEX numbers
* come after alphabets. If you are converting the string to hex, then the
* number is a 256 bit number.
*/
export interface DeviceConnectionStateEventProperties {
deviceId?: string;
moduleId?: string;
hubName?: string;
deviceConnectionStateEventInfo?: DeviceConnectionStateEventInfo;
}

/**
* @class
* Initializes a new instance of the IotHubDeviceConnectedEventData class.
* @constructor
* Event data for Microsoft.Devices.DeviceConnected event.
*
*/
export interface IotHubDeviceConnectedEventData extends DeviceConnectionStateEventProperties {
}

/**
* @class
* Initializes a new instance of the IotHubDeviceDisconnectedEventData class.
* @constructor
* Event data for Microsoft.Devices.DeviceDisconnected event.
*
*/
export interface IotHubDeviceDisconnectedEventData extends DeviceConnectionStateEventProperties {
}

/**
* @class
* Initializes a new instance of the DeviceTwinMetadata class.
Expand Down Expand Up @@ -592,7 +638,7 @@ export interface DeviceTwinInfoX509Thumbprint {
* @class
* Initializes a new instance of the DeviceTwinInfo class.
* @constructor
* Information about the device twin, which is the cloud represenation of
* Information about the device twin, which is the cloud representation of
* application device metadata.
*
* @member {string} [authenticationType] Authentication type used for this
Expand Down Expand Up @@ -651,6 +697,21 @@ export interface DeviceTwinInfo {
x509Thumbprint?: DeviceTwinInfoX509Thumbprint;
}

/**
* @class
* Initializes a new instance of the DeviceConnectionStateEventInfo class.
* @constructor
* Information about the device connection state event.
*
* @member {string} [sequenceNumber] Sequence number is string representation
* of a hexadecimal number. string compare can be used to identify the larger
* number because both in ASCII and HEX numbers come after alphabets. If you
* are converting the string to hex, then the number is a 256 bit number.
*/
export interface DeviceConnectionStateEventInfo {
sequenceNumber?: string;
}

/**
* @class
* Initializes a new instance of the ContainerRegistryEventData class.
Expand Down
4 changes: 4 additions & 0 deletions lib/services/eventgrid/lib/models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,15 @@ exports.SubscriptionDeletedEventData = require('./subscriptionDeletedEventData')
exports.DeviceLifeCycleEventProperties = require('./deviceLifeCycleEventProperties');
exports.IotHubDeviceCreatedEventData = require('./iotHubDeviceCreatedEventData');
exports.IotHubDeviceDeletedEventData = require('./iotHubDeviceDeletedEventData');
exports.DeviceConnectionStateEventProperties = require('./deviceConnectionStateEventProperties');
exports.IotHubDeviceConnectedEventData = require('./iotHubDeviceConnectedEventData');
exports.IotHubDeviceDisconnectedEventData = require('./iotHubDeviceDisconnectedEventData');
exports.DeviceTwinMetadata = require('./deviceTwinMetadata');
exports.DeviceTwinProperties = require('./deviceTwinProperties');
exports.DeviceTwinInfoProperties = require('./deviceTwinInfoProperties');
exports.DeviceTwinInfoX509Thumbprint = require('./deviceTwinInfoX509Thumbprint');
exports.DeviceTwinInfo = require('./deviceTwinInfo');
exports.DeviceConnectionStateEventInfo = require('./deviceConnectionStateEventInfo');
exports.ContainerRegistryEventData = require('./containerRegistryEventData');
exports.ContainerRegistryImagePushedEventData = require('./containerRegistryImagePushedEventData');
exports.ContainerRegistryImageDeletedEventData = require('./containerRegistryImageDeletedEventData');
Expand Down
Loading