Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ interface AssetEndpointProfiles {

createOrReplace is ArmResourceCreateOrReplaceAsync<AssetEndpointProfile>;

update is ArmResourcePatchAsync<
@parameterVisibility
update is ArmCustomPatchAsync<
AssetEndpointProfile,
AssetEndpointProfileProperties
>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ model AssetProperties {

@doc("A reference to the asset endpoint profile (connection information) used by brokers to connect to an endpoint that provides data points for this asset. Must have the format <ModuleCR.metadata.namespace>/<ModuleCR.metadata.name>.")
@visibility("read", "create")
assetEndpointProfileUri: string;
assetEndpointProfileUri: url;

@doc("An integer that is incremented each time the resource is modified.")
@visibility("read")
Expand All @@ -66,7 +66,7 @@ model AssetProperties {
manufacturer?: string;

@doc("Asset manufacturer URI.")
manufacturerUri?: string;
manufacturerUri?: url;

@doc("Asset model name.")
// `model` is a reserved keyname. Wrap in double quotes
Expand All @@ -82,7 +82,7 @@ model AssetProperties {
softwareRevision?: string;

@doc("Reference to the documentation.")
documentationUri?: string;
documentationUri?: url;

@doc("Asset serial number.")
serialNumber?: string;
Expand Down Expand Up @@ -207,7 +207,8 @@ interface Assets {

createOrReplace is ArmResourceCreateOrReplaceAsync<Asset>;

update is ArmResourcePatchAsync<Asset, AssetProperties>;
@parameterVisibility
update is ArmCustomPatchAsync<Asset, AssetProperties>;

delete is ArmResourceDeleteWithoutOkAsync<Asset>;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import "./main.tsp";
import "@azure-tools/typespec-client-generator-core";

using Azure.ClientGenerator.Core;

namespace Microsoft.DeviceRegistry;

@@clientName(Asset, "DeviceRegistryAsset", "csharp");
@@clientName(AssetEndpointProfile, "DeviceRegistryAssetEndpointProfile", "csharp");
@@clientName(ExtendedLocation, "DeviceRegistryExtendedLocation", "csharp");
@@clientName(Event, "AssetEvent", "csharp");
@@clientName(ProvisioningState, "DeviceRegistryProvisioningState", "csharp");
@@clientName(ExtendedLocation.type, "ExtendedLocationType", "csharp");
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ options:
namespace: "com.azure.resourcemanager.deviceregistry"
service-name: "Device Registry"
examples-directory: "examples"
"@azure-tools/typespec-csharp":
namespace: "Azure.ResourceManager.DeviceRegistry"
service-name: "Device Registry"
examples-directory: "examples"
linter:
extends:
- "@azure-tools/typespec-azure-rulesets/resource-manager"
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@
"description": "The resource properties to be updated.",
"required": true,
"schema": {
"$ref": "#/definitions/AssetEndpointProfileUpdate"
"$ref": "#/definitions/AssetEndpointProfileProperties"
}
}
],
Expand Down Expand Up @@ -713,7 +713,7 @@
"description": "The resource properties to be updated.",
"required": true,
"schema": {
"$ref": "#/definitions/AssetUpdate"
"$ref": "#/definitions/AssetProperties"
}
}
],
Expand Down Expand Up @@ -939,46 +939,6 @@
"targetAddress"
]
},
"AssetEndpointProfileUpdate": {
"type": "object",
"description": "The type used for update operations of the AssetEndpointProfile.",
"properties": {
"tags": {
"type": "object",
"description": "Resource tags.",
"additionalProperties": {
"type": "string"
}
},
"properties": {
"$ref": "#/definitions/AssetEndpointProfileUpdateProperties",
"x-ms-client-flatten": true
}
}
},
"AssetEndpointProfileUpdateProperties": {
"type": "object",
"description": "The updatable properties of the AssetEndpointProfile.",
"properties": {
"targetAddress": {
"type": "string",
"format": "uri",
"description": "The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration."
},
"userAuthentication": {
"$ref": "#/definitions/UserAuthenticationUpdate",
"description": "Defines the client authentication mechanism to the server."
},
"transportAuthentication": {
"$ref": "#/definitions/TransportAuthenticationUpdate",
"description": "Defines the authentication mechanism for the southbound connector connecting to the shop floor/OT device."
},
"additionalConfiguration": {
"type": "string",
"description": "Contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF)."
}
}
},
"AssetListResult": {
"type": "object",
"description": "The response of a Asset list operation.",
Expand Down Expand Up @@ -1035,6 +995,7 @@
},
"assetEndpointProfileUri": {
"type": "string",
"format": "uri",
"description": "A reference to the asset endpoint profile (connection information) used by brokers to connect to an endpoint that provides data points for this asset. Must have the format <ModuleCR.metadata.namespace>/<ModuleCR.metadata.name>.",
"x-ms-mutability": [
"read",
Expand All @@ -1053,6 +1014,7 @@
},
"manufacturerUri": {
"type": "string",
"format": "uri",
"description": "Asset manufacturer URI."
},
"model": {
Expand All @@ -1073,6 +1035,7 @@
},
"documentationUri": {
"type": "string",
"format": "uri",
"description": "Reference to the documentation."
},
"serialNumber": {
Expand Down Expand Up @@ -1157,106 +1120,6 @@
}
}
},
"AssetUpdate": {
"type": "object",
"description": "The type used for update operations of the Asset.",
"properties": {
"tags": {
"type": "object",
"description": "Resource tags.",
"additionalProperties": {
"type": "string"
}
},
"properties": {
"$ref": "#/definitions/AssetUpdateProperties",
"x-ms-client-flatten": true
}
}
},
"AssetUpdateProperties": {
"type": "object",
"description": "The updatable properties of the Asset.",
"properties": {
"assetType": {
"type": "string",
"description": "Resource path to asset type (model) definition."
},
"enabled": {
"type": "boolean",
"description": "Enabled/Disabled status of the asset."
},
"displayName": {
"type": "string",
"description": "Human-readable display name."
},
"description": {
"type": "string",
"description": "Human-readable description of the asset."
},
"manufacturer": {
"type": "string",
"description": "Asset manufacturer name."
},
"manufacturerUri": {
"type": "string",
"description": "Asset manufacturer URI."
},
"model": {
"type": "string",
"description": "Asset model name."
},
"productCode": {
"type": "string",
"description": "Asset product code."
},
"hardwareRevision": {
"type": "string",
"description": "Revision number of the hardware."
},
"softwareRevision": {
"type": "string",
"description": "Revision number of the software."
},
"documentationUri": {
"type": "string",
"description": "Reference to the documentation."
},
"serialNumber": {
"type": "string",
"description": "Asset serial number."
},
"attributes": {
"type": "object",
"description": "A set of key-value pairs that contain custom attributes set by the customer.",
"additionalProperties": {}
},
"defaultDataPointsConfiguration": {
"type": "string",
"description": "Protocol-specific default configuration for all data points. Each data point can have its own configuration that overrides the default settings here. This assumes that each asset instance has one protocol."
},
"defaultEventsConfiguration": {
"type": "string",
"description": "Protocol-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. This assumes that each asset instance has one protocol."
},
"dataPoints": {
"type": "array",
"description": "Array of data points that are part of the asset. Each data point can reference an asset type capability and have per-data point configuration. See below for more details for the definition of the dataPoints element.",
"items": {
"$ref": "#/definitions/DataPoint"
},
"x-ms-identifiers": []
},
"events": {
"type": "array",
"description": "Array of events that are part of the asset. Each event can reference an asset type capability and have per-event configuration. See below for more details about the definition of the events element.",
"items": {
"$ref": "#/definitions/Event"
},
"x-ms-identifiers": []
}
}
},
"DataPoint": {
"type": "object",
"description": "Defines the data point properties.",
Expand Down Expand Up @@ -1465,20 +1328,6 @@
"ownCertificates"
]
},
"TransportAuthenticationUpdate": {
"type": "object",
"description": "Definition of the authentication mechanism for the southbound connector.",
"properties": {
"ownCertificates": {
"type": "array",
"description": "Defines a reference to a secret which contains all certificates and private keys that can be used by the southbound connector connecting to the shop floor/OT device. The accepted extensions are .der for certificates and .pfx/.pem for private keys.",
"items": {
"$ref": "#/definitions/OwnCertificate"
},
"x-ms-identifiers": []
}
}
},
"UserAuthentication": {
"type": "object",
"description": "Definition of the client authentication mechanism to the server.",
Expand Down Expand Up @@ -1527,51 +1376,6 @@
"mode"
]
},
"UserAuthenticationUpdate": {
"type": "object",
"description": "Definition of the client authentication mechanism to the server.",
"properties": {
"mode": {
"type": "string",
"description": "Defines the mode to authenticate the user of the client at the server.",
"default": "Certificate",
"enum": [
"Anonymous",
"Certificate",
"UsernamePassword"
],
"x-ms-enum": {
"name": "UserAuthenticationMode",
"modelAsString": true,
"values": [
{
"name": "Anonymous",
"value": "Anonymous",
"description": "The user authentication mode is anonymous."
},
{
"name": "Certificate",
"value": "Certificate",
"description": "The user authentication mode is an x509 certificate."
},
{
"name": "UsernamePassword",
"value": "UsernamePassword",
"description": "The user authentication mode is a username and password."
}
]
}
},
"usernamePasswordCredentials": {
"$ref": "#/definitions/UsernamePasswordCredentialsUpdate",
"description": "Defines the username and password references when UsernamePassword user authentication mode is selected."
},
"x509Credentials": {
"$ref": "#/definitions/X509CredentialsUpdate",
"description": "Defines the certificate reference when Certificate user authentication mode is selected."
}
}
},
"UsernamePasswordCredentials": {
"type": "object",
"description": "The credentials for authentication mode UsernamePassword.",
Expand All @@ -1590,20 +1394,6 @@
"passwordReference"
]
},
"UsernamePasswordCredentialsUpdate": {
"type": "object",
"description": "The credentials for authentication mode UsernamePassword.",
"properties": {
"usernameReference": {
"type": "string",
"description": "A reference to secret containing the username."
},
"passwordReference": {
"type": "string",
"description": "A reference to secret containing the password."
}
}
},
"X509Credentials": {
"type": "object",
"description": "The x509 certificate for authentication mode Certificate.",
Expand All @@ -1616,16 +1406,6 @@
"required": [
"certificateReference"
]
},
"X509CredentialsUpdate": {
"type": "object",
"description": "The x509 certificate for authentication mode Certificate.",
"properties": {
"certificateReference": {
"type": "string",
"description": "A reference to secret containing the certificate and private key (e.g. stored as .der/.pem or .der/.pfx)."
}
}
}
},
"parameters": {}
Expand Down