diff --git a/pom.xml b/pom.xml index 4a9f6231f888..20033aaea1af 100644 --- a/pom.xml +++ b/pom.xml @@ -18,6 +18,7 @@ sdk/core sdk/cosmos sdk/cognitiveservices + sdk/digitaltwins sdk/eventgrid sdk/eventhubs sdk/formrecognizer diff --git a/sdk/digitaltwins/azure-digitaltwins-core/Readme.md b/sdk/digitaltwins/azure-digitaltwins-core/Readme.md new file mode 100644 index 000000000000..7f13603e0ec2 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/Readme.md @@ -0,0 +1,94 @@ +# Azure IoT Digital Twins client library for Java + +This library provides access to the Azure Digital Twins service for managing twins, models, relationships, etc. + + [Source code][source] | Package (maven) (TODO: Add package info) + +## Getting started + +The complete Microsoft Azure SDK can be downloaded from the [Microsoft Azure downloads][microsoft_sdk_download] page, and it ships with support for building deployment packages, integrating with tooling, rich command line tooling, and more. + +For the best development experience, developers should use the official Microsoft Maven packages for libraries. Maven packages are regularly updated with new functionality and hotfixes. + +### Install the package + +Install the Azure Digital Twins client library for java +TODO: Fill in details after first publish + +### Prerequisites + +- A Microsoft Azure Subscription + - To call Microsoft Azure services, create an [Azure subscription][azure_sub]. +- An Azure Digital Twins instance + - In order to use the Azure Digital Twins SDK, first create a Digital Twins instance using one of options: + - Using [Azure portal][azure_portal] + - Using [Azure Management APIs][azure_rest_api] + - Using [Azure CLI][azure_cli] + - You will need to install azure cli and the [Azure IoT extension][iot_cli_extension] for Azure CLI. + - Refer to [IoT CLI documentation][iot_cli_doc] for more information on how to create and interact with your Digital Twins instance. + +### Authenticate the Client + +In order to interact with the Azure Digital Twins service, you will need to create an instance of a [TokenCredential class][token_credential] and pass it to the constructor of your DigitalTwinsClientBuilder (TODO: Reference the file once checked in). + +## Key concepts + +Azure Digital Twins Preview is an Azure IoT service that creates comprehensive models of the physical environment. +It can create spatial intelligence graphs to model the relationships and interactions between people, spaces, and devices. + +You can learn more about Azure Digital Twins by visiting [Azure Digital Twins Documentation][digital_twins_documentation] + +## Examples + +You can familiarize yourself with different APIs using [samples for Digital Twins](TODO: Point to sampels once available). + +## Source code folder structure + +### /src + +TODO: Describe source and link to the path. + +### /src/swagger + +A local copy of the swagger file that defines the structure of the REST APIs supported by the Azure Digital Twins service. + +To regenerate the code, run the powershell script [generate.ps1](./generate.ps1). + +Any time the client library code is updated, the following scripts need to be run: + +TODO: Add extra information here. + +## Troubleshooting + +TODO: Add troubleshoooting guide + +## Next steps + +## Contributing + +This project welcomes contributions and suggestions. +Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. +For details, visit + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). +Simply follow the instructions provided by the bot. +You will only need to do this once across all repos using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. +For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments. + + +[microsoft_sdk_download]: https://azure.microsoft.com/en-us/downloads/?sdk=java +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[source]: https://github.com/Azure/azure-sdk-for-java/tree/feature/adt-dp/sdk/digitaltwins/azure-digitaltwins-core +[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ +[nuget]: https://www.nuget.org/ +[azure_portal]: https://portal.azure.com/ +[azure_rest_api]: https://docs.microsoft.com/en-us/rest/api/azure/ +[azure_core_library]: https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/core/azure-core +[token_credential]: https://docs.microsoft.com/en-us/java/api/com.azure.core.credential.tokencredential?view=azure-java-stable +[digital_twins_documentation]: https://docs.microsoft.com/en-us/azure/digital-twins/ +[azure_cli]: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest +[iot_cli_extension]: https://docs.microsoft.com/en-us/azure/iot-pnp/howto-use-iot-pnp-cli +[iot_cli_doc]: https://docs.microsoft.com/en-us/cli/azure/ext/azure-iot/dt?view=azure-cli-latest diff --git a/sdk/digitaltwins/azure-digitaltwins-core/autorest.md b/sdk/digitaltwins/azure-digitaltwins-core/autorest.md new file mode 100644 index 000000000000..0b8b4ae4d297 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/autorest.md @@ -0,0 +1,21 @@ +# Azure.DigitalTwins.Core + +Run `generate.ps1` in this directory to generate the code. + +## AutoRest Configuration + +> see + +### Code generation settings + +``` yaml +input-file: swagger/digitaltwins.json +output-folder: "./" +license-header: MICROSOFT_MIT_SMALL +use: '@autorest/java@4.0.1' +java: + add-context-parameter: true + namespace: com.azure.digitaltwins.core + add-credentials: true + sync-methods: none +``` diff --git a/sdk/digitaltwins/azure-digitaltwins-core/code-model-v1 b/sdk/digitaltwins/azure-digitaltwins-core/code-model-v1 new file mode 100644 index 000000000000..9104dfffc85e --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/code-model-v1 @@ -0,0 +1,9000 @@ +{ + "modelTypes": [ + { + "$id": "1", + "$type": "CompositeType", + "properties": [ + { + "$id": "2", + "isReadOnly": true, + "realPath": [ + "id" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id of the event route." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "id" + }, + "serializedName": "id", + "modelType": { + "$id": "3", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "4", + "isReadOnly": false, + "realPath": [ + "endpointName" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The name of the endpoint this event route is bound to." + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "endpointName" + }, + "serializedName": "endpointName", + "modelType": { + "$id": "5", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "6", + "isReadOnly": false, + "realPath": [ + "filter" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "An expression which describes the events which are routed to the endpoint." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "filter" + }, + "serializedName": "filter", + "modelType": { + "$id": "7", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "serializedName": "EventRoute", + "documentation": "A route which directs notification and telemetry events to an endpoint. Endpoints are a destination outside of Azure Digital Twins such as an EventHub.", + "containsConstantProperties": false, + "name": { + "fixed": false, + "raw": "EventRoute" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "EventRoute", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/schemas/EventRoute" + ] + } + } + }, + { + "$id": "8", + "$type": "CompositeType", + "properties": [ + { + "$id": "9", + "isReadOnly": false, + "realPath": [ + "value" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The EventRoute objects." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "value" + }, + "serializedName": "value", + "modelType": { + "$id": "10", + "$type": "SequenceType", + "elementType": { + "$ref": "1" + }, + "name": { + "fixed": false + } + } + }, + { + "$id": "11", + "isReadOnly": false, + "realPath": [ + "nextLink" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "A URI to retrieve the next page of results." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "nextLink" + }, + "serializedName": "nextLink", + "modelType": { + "$id": "12", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "serializedName": "EventRouteCollection", + "documentation": "A collection of EventRoute objects.", + "containsConstantProperties": false, + "name": { + "fixed": false, + "raw": "EventRouteCollection" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "EventRouteCollection", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/schemas/EventRouteCollection" + ] + } + } + }, + { + "$id": "13", + "$type": "CompositeType", + "properties": [ + { + "$id": "14", + "isReadOnly": false, + "realPath": [ + "displayName" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "A language map that contains the localized display names as specified in the model definition." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "displayName" + }, + "serializedName": "displayName", + "modelType": { + "$id": "15", + "$type": "DictionaryType", + "valueType": { + "$id": "16", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + }, + "supportsAdditionalProperties": false, + "name": { + "fixed": false + } + } + }, + { + "$id": "17", + "isReadOnly": false, + "realPath": [ + "description" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "A language map that contains the localized descriptions as specified in the model definition." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "description" + }, + "serializedName": "description", + "modelType": { + "$id": "18", + "$type": "DictionaryType", + "valueType": { + "$id": "19", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + }, + "supportsAdditionalProperties": false, + "name": { + "fixed": false + } + } + }, + { + "$id": "20", + "isReadOnly": false, + "realPath": [ + "id" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id of the model as specified in the model definition." + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "id" + }, + "serializedName": "id", + "modelType": { + "$id": "21", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "22", + "isReadOnly": false, + "realPath": [ + "uploadTime" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The time the model was uploaded to the service." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "uploadTime" + }, + "serializedName": "uploadTime", + "modelType": { + "$id": "23", + "$type": "PrimaryType", + "format": "date-time", + "knownPrimaryType": "dateTime", + "name": { + "fixed": false, + "raw": "DateTime" + } + } + }, + { + "$id": "24", + "isReadOnly": false, + "realPath": [ + "decommissioned" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "false" + }, + "documentation": { + "fixed": false, + "raw": "Indicates if the model is decommissioned. Decommissioned models cannot be referenced by newly created digital twins." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "decommissioned" + }, + "serializedName": "decommissioned", + "modelType": { + "$id": "25", + "$type": "PrimaryType", + "knownPrimaryType": "boolean", + "name": { + "fixed": false, + "raw": "Boolean" + } + } + }, + { + "$id": "26", + "isReadOnly": false, + "realPath": [ + "model" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The model definition." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "model" + }, + "serializedName": "model", + "modelType": { + "$id": "27", + "$type": "PrimaryType", + "knownPrimaryType": "object", + "name": { + "fixed": false, + "raw": "Object" + } + } + } + ], + "serializedName": "ModelData", + "documentation": "A model definition and metadata for that model.", + "containsConstantProperties": false, + "name": { + "fixed": false, + "raw": "ModelData" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "ModelData", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/schemas/ModelData" + ] + } + } + }, + { + "$id": "28", + "$type": "CompositeType", + "properties": [ + { + "$id": "29", + "isReadOnly": false, + "realPath": [ + "value" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The ModelData objects." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "value" + }, + "serializedName": "value", + "modelType": { + "$id": "30", + "$type": "SequenceType", + "elementType": { + "$ref": "13" + }, + "name": { + "fixed": false + } + } + }, + { + "$id": "31", + "isReadOnly": false, + "realPath": [ + "nextLink" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "A URI to retrieve the next page of objects." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "nextLink" + }, + "serializedName": "nextLink", + "modelType": { + "$id": "32", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "serializedName": "PagedModelDataCollection", + "documentation": "A collection of ModelData objects.", + "containsConstantProperties": false, + "name": { + "fixed": false, + "raw": "PagedModelDataCollection" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "PagedModelDataCollection", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/schemas/PagedModelDataCollection" + ] + } + } + }, + { + "$id": "33", + "$type": "CompositeType", + "properties": [ + { + "$id": "34", + "isReadOnly": false, + "realPath": [ + "value" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The relationship objects." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "value" + }, + "serializedName": "value", + "modelType": { + "$id": "35", + "$type": "SequenceType", + "elementType": { + "$id": "36", + "$type": "PrimaryType", + "knownPrimaryType": "object", + "name": { + "fixed": false, + "raw": "Object" + } + }, + "name": { + "fixed": false + } + } + }, + { + "$id": "37", + "isReadOnly": false, + "realPath": [ + "nextLink" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "A URI to retrieve the next page of objects." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "nextLink" + }, + "serializedName": "nextLink", + "modelType": { + "$id": "38", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "serializedName": "RelationshipCollection", + "documentation": "A collection of relationships which relate digital twins together.", + "containsConstantProperties": false, + "name": { + "fixed": false, + "raw": "RelationshipCollection" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "RelationshipCollection", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/schemas/RelationshipCollection" + ] + } + } + }, + { + "$id": "39", + "$type": "CompositeType", + "properties": [ + { + "$id": "40", + "isReadOnly": false, + "realPath": [ + "$relationshipId" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "A user-provided string representing the id of this relationship, unique in the context of the source digital twin, i.e. sourceId + relationshipId is unique in the context of the service." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "$relationshipId" + }, + "serializedName": "$relationshipId", + "modelType": { + "$id": "41", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "42", + "isReadOnly": false, + "realPath": [ + "$sourceId" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id of the source digital twin." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "$sourceId" + }, + "serializedName": "$sourceId", + "modelType": { + "$id": "43", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "44", + "isReadOnly": false, + "realPath": [ + "$relationshipName" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The name of the relationship." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "$relationshipName" + }, + "serializedName": "$relationshipName", + "modelType": { + "$id": "45", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "46", + "isReadOnly": false, + "realPath": [ + "$relationshipLink" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "Link to the relationship, to be used for deletion." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "$relationshipLink" + }, + "serializedName": "$relationshipLink", + "modelType": { + "$id": "47", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "serializedName": "IncomingRelationship", + "documentation": "An incoming relationship.", + "containsConstantProperties": false, + "name": { + "fixed": false, + "raw": "IncomingRelationship" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "IncomingRelationship", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/schemas/IncomingRelationship" + ] + } + } + }, + { + "$id": "48", + "$type": "CompositeType", + "properties": [ + { + "$id": "49", + "isReadOnly": false, + "realPath": [ + "value" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "value" + }, + "serializedName": "value", + "modelType": { + "$id": "50", + "$type": "SequenceType", + "elementType": { + "$ref": "39" + }, + "name": { + "fixed": false + } + } + }, + { + "$id": "51", + "isReadOnly": false, + "realPath": [ + "nextLink" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "A URI to retrieve the next page of objects." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "nextLink" + }, + "serializedName": "nextLink", + "modelType": { + "$id": "52", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "serializedName": "IncomingRelationshipCollection", + "documentation": "A collection of incoming relationships which relate digital twins together.", + "containsConstantProperties": false, + "name": { + "fixed": false, + "raw": "IncomingRelationshipCollection" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "IncomingRelationshipCollection", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/schemas/IncomingRelationshipCollection" + ] + } + } + }, + { + "$id": "53", + "$type": "CompositeType", + "properties": [ + { + "$id": "54", + "isReadOnly": false, + "realPath": [ + "query" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The query to execute. This value is ignored if a continuation token is provided." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "query" + }, + "serializedName": "query", + "modelType": { + "$id": "55", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "56", + "isReadOnly": false, + "realPath": [ + "continuationToken" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "A token which is used to retrieve the next set of results from a previous query." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "continuationToken" + }, + "serializedName": "continuationToken", + "modelType": { + "$id": "57", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "serializedName": "QuerySpecification", + "documentation": "A query specification containing either a query statement or a continuation token from a previous query result.", + "containsConstantProperties": false, + "name": { + "fixed": false, + "raw": "QuerySpecification" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "QuerySpecification", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/schemas/QuerySpecification" + ] + } + } + }, + { + "$id": "58", + "$type": "CompositeType", + "properties": [ + { + "$id": "59", + "isReadOnly": false, + "realPath": [ + "items" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The query results." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "items" + }, + "serializedName": "items", + "modelType": { + "$id": "60", + "$type": "SequenceType", + "elementType": { + "$id": "61", + "$type": "PrimaryType", + "knownPrimaryType": "object", + "name": { + "fixed": false, + "raw": "Object" + } + }, + "name": { + "fixed": false + } + } + }, + { + "$id": "62", + "isReadOnly": false, + "realPath": [ + "continuationToken" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "A token which can be used to construct a new QuerySpecification to retrieve the next set of results." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "continuationToken" + }, + "serializedName": "continuationToken", + "modelType": { + "$id": "63", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "serializedName": "QueryResult", + "documentation": "The results of a query operation and an optional continuation token.", + "containsConstantProperties": false, + "name": { + "fixed": false, + "raw": "QueryResult" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "QueryResult", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/schemas/QueryResult" + ] + } + } + }, + { + "$id": "64", + "$type": "CompositeType", + "properties": [ + { + "$id": "65", + "isReadOnly": false, + "realPath": [ + "code" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "A more specific error code than was provided by the containing error." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "code" + }, + "serializedName": "code", + "modelType": { + "$id": "66", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "67", + "isReadOnly": false, + "realPath": [ + "innererror" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "An object containing more specific information than the current object about the error." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "innererror" + }, + "serializedName": "innererror", + "modelType": { + "$ref": "64" + } + } + ], + "serializedName": "InnerError", + "documentation": "A more specific error description than was provided by the containing error.", + "containsConstantProperties": false, + "name": { + "fixed": false, + "raw": "InnerError" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "InnerError", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/schemas/InnerError" + ] + } + } + }, + { + "$id": "68", + "$type": "CompositeType", + "properties": [ + { + "$id": "69", + "isReadOnly": true, + "realPath": [ + "code" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "Service specific error code which serves as the substatus for the HTTP error code." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "code" + }, + "serializedName": "code", + "modelType": { + "$id": "70", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "71", + "isReadOnly": true, + "realPath": [ + "message" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "A human-readable representation of the error." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "message" + }, + "serializedName": "message", + "modelType": { + "$id": "72", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "73", + "isReadOnly": true, + "realPath": [ + "details" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "Internal error details." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "details" + }, + "serializedName": "details", + "modelType": { + "$id": "74", + "$type": "SequenceType", + "elementType": { + "$ref": "68" + }, + "name": { + "fixed": false + } + } + }, + { + "$id": "75", + "isReadOnly": false, + "realPath": [ + "innererror" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "An object containing more specific information than the current object about the error." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "innererror" + }, + "serializedName": "innererror", + "modelType": { + "$ref": "64" + } + } + ], + "serializedName": "Error", + "documentation": "Error definition.", + "containsConstantProperties": false, + "name": { + "fixed": false, + "raw": "Error" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "Error", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/schemas/Error" + ] + } + } + }, + { + "$id": "76", + "$type": "CompositeType", + "properties": [ + { + "$id": "77", + "isReadOnly": false, + "realPath": [ + "error" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The error details." + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "error" + }, + "serializedName": "error", + "modelType": { + "$ref": "68" + } + } + ], + "serializedName": "ErrorResponse", + "documentation": "Error response.", + "containsConstantProperties": false, + "name": { + "fixed": false, + "raw": "ErrorResponse" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "ErrorResponse", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/schemas/ErrorResponse" + ] + } + } + } + ], + "errorTypes": [ + { + "$ref": "76" + } + ], + "headerTypes": [ + { + "$id": "78", + "$type": "CompositeType", + "properties": [ + { + "$id": "79", + "isReadOnly": false, + "realPath": [ + "query-charge" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The query charge." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1pwps45·query·post·responses·200·headers·query_charge", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/headers/paths·1pwps45·query·post·responses·200·headers·query_charge" + ] + } + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "query-charge" + }, + "serializedName": "query-charge", + "modelType": { + "$id": "80", + "$type": "PrimaryType", + "knownPrimaryType": "double", + "name": { + "fixed": false, + "raw": "Double" + } + } + } + ], + "serializedName": "Query-QueryTwins-Headers", + "documentation": "Defines headers for QueryTwins operation.", + "containsConstantProperties": false, + "name": { + "fixed": false, + "raw": "Query-QueryTwins-Headers" + } + }, + { + "$id": "81", + "$type": "CompositeType", + "properties": [ + { + "$id": "82", + "isReadOnly": false, + "realPath": [ + "ETag" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "Weak Etag." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1xm88z2·digitaltwins-id·get·responses·200·headers·etag", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/headers/paths·1xm88z2·digitaltwins-id·get·responses·200·headers·etag" + ] + } + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "ETag" + }, + "serializedName": "ETag", + "modelType": { + "$id": "83", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "serializedName": "DigitalTwins-GetById-Headers", + "documentation": "Defines headers for GetById operation.", + "containsConstantProperties": false, + "name": { + "fixed": false, + "raw": "DigitalTwins-GetById-Headers" + } + }, + { + "$id": "84", + "$type": "CompositeType", + "properties": [ + { + "$id": "85", + "isReadOnly": false, + "realPath": [ + "ETag" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "Weak Etag." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·13o1yan·digitaltwins-id·put·responses·200·headers·etag", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/headers/paths·13o1yan·digitaltwins-id·put·responses·200·headers·etag" + ] + } + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "ETag" + }, + "serializedName": "ETag", + "modelType": { + "$id": "86", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "serializedName": "DigitalTwins-Add-Headers", + "documentation": "Defines headers for Add operation.", + "containsConstantProperties": false, + "name": { + "fixed": false, + "raw": "DigitalTwins-Add-Headers" + } + }, + { + "$id": "87", + "$type": "CompositeType", + "properties": [ + { + "$id": "88", + "isReadOnly": false, + "realPath": [ + "ETag" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "Weak Etag." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·edjhpf·digitaltwins-id·patch·responses·204·headers·etag", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/headers/paths·edjhpf·digitaltwins-id·patch·responses·204·headers·etag" + ] + } + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "ETag" + }, + "serializedName": "ETag", + "modelType": { + "$id": "89", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "serializedName": "DigitalTwins-Update-Headers", + "documentation": "Defines headers for Update operation.", + "containsConstantProperties": false, + "name": { + "fixed": false, + "raw": "DigitalTwins-Update-Headers" + } + }, + { + "$id": "90", + "$type": "CompositeType", + "properties": [ + { + "$id": "91", + "isReadOnly": false, + "realPath": [ + "ETag" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "Weak Etag." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·10k8xfn·digitaltwins-id-relationships-relationshipid·get·responses·200·headers·etag", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/headers/paths·10k8xfn·digitaltwins-id-relationships-relationshipid·get·responses·200·headers·etag" + ] + } + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "ETag" + }, + "serializedName": "ETag", + "modelType": { + "$id": "92", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "serializedName": "DigitalTwins-GetRelationshipById-Headers", + "documentation": "Defines headers for GetRelationshipById operation.", + "containsConstantProperties": false, + "name": { + "fixed": false, + "raw": "DigitalTwins-GetRelationshipById-Headers" + } + }, + { + "$id": "93", + "$type": "CompositeType", + "properties": [ + { + "$id": "94", + "isReadOnly": false, + "realPath": [ + "ETag" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "Weak Etag." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·mwxa07·digitaltwins-id-relationships-relationshipid·put·responses·200·headers·etag", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/headers/paths·mwxa07·digitaltwins-id-relationships-relationshipid·put·responses·200·headers·etag" + ] + } + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "ETag" + }, + "serializedName": "ETag", + "modelType": { + "$id": "95", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "serializedName": "DigitalTwins-AddRelationship-Headers", + "documentation": "Defines headers for AddRelationship operation.", + "containsConstantProperties": false, + "name": { + "fixed": false, + "raw": "DigitalTwins-AddRelationship-Headers" + } + }, + { + "$id": "96", + "$type": "CompositeType", + "properties": [ + { + "$id": "97", + "isReadOnly": false, + "realPath": [ + "ETag" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "Weak Etag." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·2aidma·digitaltwins-id-relationships-relationshipid·patch·responses·204·headers·etag", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/headers/paths·2aidma·digitaltwins-id-relationships-relationshipid·patch·responses·204·headers·etag" + ] + } + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "ETag" + }, + "serializedName": "ETag", + "modelType": { + "$id": "98", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "serializedName": "DigitalTwins-UpdateRelationship-Headers", + "documentation": "Defines headers for UpdateRelationship operation.", + "containsConstantProperties": false, + "name": { + "fixed": false, + "raw": "DigitalTwins-UpdateRelationship-Headers" + } + }, + { + "$id": "99", + "$type": "CompositeType", + "properties": [ + { + "$id": "100", + "isReadOnly": false, + "realPath": [ + "ETag" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "Weak Etag." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1nrlbos·digitaltwins-id-components-componentpath·get·responses·200·headers·etag", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/headers/paths·1nrlbos·digitaltwins-id-components-componentpath·get·responses·200·headers·etag" + ] + } + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "ETag" + }, + "serializedName": "ETag", + "modelType": { + "$id": "101", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "serializedName": "DigitalTwins-GetComponent-Headers", + "documentation": "Defines headers for GetComponent operation.", + "containsConstantProperties": false, + "name": { + "fixed": false, + "raw": "DigitalTwins-GetComponent-Headers" + } + }, + { + "$id": "102", + "$type": "CompositeType", + "properties": [ + { + "$id": "103", + "isReadOnly": false, + "realPath": [ + "ETag" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "Weak Etag." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·faod6m·digitaltwins-id-components-componentpath·patch·responses·204·headers·etag", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/headers/paths·faod6m·digitaltwins-id-components-componentpath·patch·responses·204·headers·etag" + ] + } + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "ETag" + }, + "serializedName": "ETag", + "modelType": { + "$id": "104", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "serializedName": "DigitalTwins-UpdateComponent-Headers", + "documentation": "Defines headers for UpdateComponent operation.", + "containsConstantProperties": false, + "name": { + "fixed": false, + "raw": "DigitalTwins-UpdateComponent-Headers" + } + } + ], + "name": "AzureDigitalTwinsAPI", + "namespace": "Com.azure.digitaltwins.core", + "modelsName": "Models", + "apiVersion": "2020-05-31-preview", + "baseUrl": "https://digitaltwins-name.digitaltwins.azure.net", + "documentation": "A service for managing and querying digital twins and digital twin models.", + "extensions": { + "security": [ + { + "oauth2": [] + } + ] + }, + "properties": [ + { + "$id": "105", + "isReadOnly": false, + "realPath": [ + "dependenciesFor" + ], + "collectionFormat": "multi", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The set of the models which will have their dependencies retrieved. If omitted, all models are retrieved." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1mtbsxt·models·get·parameters·0", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/paths·1mtbsxt·models·get·parameters·0" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "dependenciesFor" + }, + "serializedName": "dependenciesFor", + "modelType": { + "$id": "106", + "$type": "SequenceType", + "elementType": { + "$id": "107", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + }, + "name": { + "fixed": false + } + } + }, + { + "$id": "108", + "isReadOnly": false, + "realPath": [ + "relationshipName" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The name of the relationship." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·aacosl·digitaltwins-id-relationships·get·parameters·1", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/paths·aacosl·digitaltwins-id-relationships·get·parameters·1" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "relationshipName" + }, + "serializedName": "relationshipName", + "modelType": { + "$id": "109", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "110", + "isReadOnly": false, + "realPath": [ + "dt-id" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "A unique message identifier (in the scope of the digital twin id) that is commonly used for de-duplicating messages." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1dpn2p9·digitaltwins-id-telemetry·post·parameters·1", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/paths·1dpn2p9·digitaltwins-id-telemetry·post·parameters·1" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "dt-id" + }, + "serializedName": "dt-id", + "modelType": { + "$id": "111", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "112", + "isReadOnly": false, + "realPath": [ + "dt-timestamp" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "An RFC 3339 timestamp that identifies the time the telemetry was measured." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1y4wap4·digitaltwins-id-telemetry·post·parameters·2", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/paths·1y4wap4·digitaltwins-id-telemetry·post·parameters·2" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "dt-timestamp" + }, + "serializedName": "dt-timestamp", + "modelType": { + "$id": "113", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "114", + "isReadOnly": false, + "realPath": [ + "dt-id" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "A unique message identifier (in the scope of the digital twin id) that is commonly used for de-duplicating messages." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1pbfub8·digitaltwins-id-components-componentpath-telemetry·post·parameters·2", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/paths·1pbfub8·digitaltwins-id-components-componentpath-telemetry·post·parameters·2" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "DtId1" + }, + "serializedName": "dt-id", + "modelType": { + "$id": "115", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "116", + "isReadOnly": false, + "realPath": [ + "dt-timestamp" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "An RFC 3339 timestamp that identifies the time the telemetry was measured." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·156zrxy·digitaltwins-id-components-componentpath-telemetry·post·parameters·3", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/paths·156zrxy·digitaltwins-id-components-componentpath-telemetry·post·parameters·3" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "DtTimestamp1" + }, + "serializedName": "dt-timestamp", + "modelType": { + "$id": "117", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "118", + "isReadOnly": false, + "realPath": [ + "id" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id for an event route. The id is unique within event routes and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "eventRouteId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/eventRouteId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "id" + }, + "serializedName": "id", + "modelType": { + "$id": "119", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "120", + "isReadOnly": false, + "realPath": [ + "includeModelDefinition" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "false" + }, + "documentation": { + "fixed": false, + "raw": "When true the model definition will be returned as part of the result." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "includeModelDefinition", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/includeModelDefinition" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "includeModelDefinition" + }, + "serializedName": "includeModelDefinition", + "modelType": { + "$id": "121", + "$type": "PrimaryType", + "knownPrimaryType": "boolean", + "name": { + "fixed": false, + "raw": "Boolean" + } + } + }, + { + "$id": "122", + "isReadOnly": false, + "realPath": [ + "id" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id of the digital twin. The id is unique within the service and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "digitalTwinId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/digitalTwinId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "Id1" + }, + "serializedName": "id", + "modelType": { + "$id": "123", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "124", + "isReadOnly": false, + "realPath": [ + "id" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id for the model. The id is globally unique and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "modelId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/modelId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "Id2" + }, + "serializedName": "id", + "modelType": { + "$id": "125", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "126", + "isReadOnly": false, + "realPath": [ + "relationshipId" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id of the relationship. The id is unique within the digital twin and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "relationshipId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/relationshipId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "relationshipId" + }, + "serializedName": "relationshipId", + "modelType": { + "$id": "127", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "128", + "isReadOnly": false, + "realPath": [ + "componentPath" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The name of the DTDL component." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "componentPath", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/componentPath" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "componentPath" + }, + "serializedName": "componentPath", + "modelType": { + "$id": "129", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "130", + "isReadOnly": false, + "realPath": [ + "api-version" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The requested API version." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "api-version", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/api-version" + ] + } + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "131", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "132", + "isReadOnly": false, + "realPath": [ + "x-ms-max-item-count" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "-1" + }, + "documentation": { + "fixed": false, + "raw": "The maximum number of items to retrieve per request. The server may choose to return less than the requested max." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "max-item-count", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/max-item-count" + ] + }, + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "postfix": "Options" + }, + "x-ms-client-name": "MaxItemCount" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "x-ms-max-item-count" + }, + "serializedName": "x-ms-max-item-count", + "modelType": { + "$id": "133", + "$type": "PrimaryType", + "knownPrimaryType": "int", + "name": { + "fixed": false, + "raw": "Int" + } + } + }, + { + "$id": "134", + "isReadOnly": false, + "realPath": [ + "If-None-Match" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "Only perform the operation if the entity does not already exist." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "if-none-match-star", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/if-none-match-star" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "If-None-Match" + }, + "serializedName": "If-None-Match", + "modelType": { + "$id": "135", + "$type": "EnumType", + "modelAsExtensible": false, + "values": [ + { + "name": "*", + "serializedName": "*" + } + ], + "modelAsString": true, + "underlyingType": { + "$id": "136", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + }, + "name": { + "fixed": false, + "raw": "" + } + } + }, + { + "$id": "137", + "isReadOnly": false, + "realPath": [ + "If-Match" + ], + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "Only perform the operation if the entity's etag matches one of the etags provided or * is provided." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "if-match", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/if-match" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "If-Match" + }, + "serializedName": "If-Match", + "modelType": { + "$id": "138", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "operations": [ + { + "methods": [ + { + "parameters": [ + { + "$id": "139", + "location": "body", + "collectionFormat": "none", + "constraints": { + "MinItems": "1", + "UniqueItems": "true" + }, + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "An array of models to add." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·rdpph9·models·post·requestbody", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/requestBodies/paths·rdpph9·models·post·requestbody" + ] + }, + "x-ms-requestBody-name": "models" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "models" + }, + "serializedName": "models", + "modelType": { + "$id": "140", + "$type": "SequenceType", + "elementType": { + "$id": "141", + "$type": "PrimaryType", + "knownPrimaryType": "object", + "name": { + "fixed": false, + "raw": "Object" + } + }, + "name": { + "fixed": false + } + } + }, + { + "$id": "142", + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The API version to use for the request." + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "143", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "name": { + "fixed": false, + "raw": "Add" + }, + "group": { + "fixed": false, + "raw": "DigitalTwinModels" + }, + "serializedName": "DigitalTwinModels_Add", + "url": "/models", + "isAbsoluteUrl": false, + "httpMethod": "post", + "responses": { + "OK": { + "body": { + "$id": "144", + "$type": "SequenceType", + "elementType": { + "$ref": "13" + }, + "name": { + "fixed": false + } + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1917otv·models·post·responses·200", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·1917otv·models·post·responses·200" + ] + } + }, + "isNullable": true + } + }, + "defaultResponse": { + "body": { + "$ref": "76" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·12bl8h0·models·post·responses·default", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·12bl8h0·models·post·responses·default" + ] + } + }, + "isNullable": true + }, + "returnType": { + "body": { + "$ref": "144" + }, + "isNullable": true + }, + "description": "Uploads one or more models. When any error occurs, no models are uploaded.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.\n409 (Conflict): One or more of the provided models already exist.", + "requestContentType": "application/json; charset=utf-8", + "responseContentTypes": [ + "application/json" + ], + "extensions": { + "servers": [ + { + "url": "https://digitaltwins-name.digitaltwins.azure.net/" + } + ], + "x-ms-requestBody-index": "0", + "x-ms-examples": { + "ModelAdd": { + "parameters": { + "models": [ + { + "@id": "dtmi:com:example:Sample;1", + "@type": "Interface", + "displayName": "Sample Interface", + "contents": [ + { + "@type": "Property", + "name": "name", + "displayName": "Sample instance name", + "schema": "string" + }, + { + "@type": "Property", + "name": "temp", + "displayName": "Sample instance temperature", + "schema": "integer" + }, + { + "@type": "Property", + "name": "comfortIndex", + "displayName": "Sample instance comfort index", + "schema": "integer" + } + ], + "@context": "dtmi:dtdl:context;2" + } + ], + "api-version": "2020-05-31-preview" + }, + "responses": { + "200": { + "body": [ + { + "id": "dtmi:com:example:Sample;1", + "displayName": { + "en": "Sample Interface" + }, + "uploadTime": "2020-03-01T17:32:28Z", + "decommissioned": false + } + ] + } + } + } + } + }, + "deprecated": false, + "hidden": false + }, + { + "parameters": [ + { + "$id": "145", + "clientProperty": { + "$ref": "105" + }, + "location": "query", + "collectionFormat": "multi", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The set of the models which will have their dependencies retrieved. If omitted, all models are retrieved." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1mtbsxt·models·get·parameters·0", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/paths·1mtbsxt·models·get·parameters·0" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "dependenciesFor" + }, + "serializedName": "dependenciesFor", + "modelType": { + "$id": "146", + "$type": "SequenceType", + "elementType": { + "$id": "147", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + }, + "name": { + "fixed": false + } + } + }, + { + "$id": "148", + "clientProperty": { + "$ref": "120" + }, + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "false" + }, + "documentation": { + "fixed": false, + "raw": "When true the model definition will be returned as part of the result." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "includeModelDefinition", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/includeModelDefinition" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "includeModelDefinition" + }, + "serializedName": "includeModelDefinition", + "modelType": { + "$id": "149", + "$type": "PrimaryType", + "knownPrimaryType": "boolean", + "name": { + "fixed": false, + "raw": "Boolean" + } + } + }, + { + "$id": "150", + "clientProperty": { + "$ref": "132" + }, + "location": "header", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "-1" + }, + "documentation": { + "fixed": false, + "raw": "The maximum number of items to retrieve per request. The server may choose to return less than the requested max." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "max-item-count", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/max-item-count" + ] + }, + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "postfix": "Options" + }, + "x-ms-client-name": "MaxItemCount" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "x-ms-max-item-count" + }, + "serializedName": "x-ms-max-item-count", + "modelType": { + "$id": "151", + "$type": "PrimaryType", + "knownPrimaryType": "int", + "name": { + "fixed": false, + "raw": "Int" + } + } + }, + { + "$id": "152", + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The API version to use for the request." + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "153", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "name": { + "fixed": false, + "raw": "List" + }, + "group": { + "fixed": false, + "raw": "DigitalTwinModels" + }, + "serializedName": "DigitalTwinModels_List", + "url": "/models", + "isAbsoluteUrl": false, + "httpMethod": "get", + "responses": { + "OK": { + "body": { + "$ref": "28" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1h1ygb8·models·get·responses·200", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·1h1ygb8·models·get·responses·200" + ] + } + }, + "isNullable": true + } + }, + "defaultResponse": { + "body": { + "$ref": "76" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·13edvii·models·get·responses·default", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·13edvii·models·get·responses·default" + ] + } + }, + "isNullable": true + }, + "returnType": { + "body": { + "$ref": "28" + }, + "isNullable": true + }, + "description": "Retrieves model metadata and, optionally, model definitions.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.", + "requestContentType": "application/json; charset=utf-8", + "responseContentTypes": [ + "application/json" + ], + "extensions": { + "servers": [ + { + "url": "https://digitaltwins-name.digitaltwins.azure.net/" + } + ], + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "ModelsGet": { + "parameters": { + "api-version": "2020-05-31-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "dtmi:com:example:Sample;1", + "uploadTime": "2020-03-01T17:32:28Z", + "decommissioned": false + }, + { + "id": "dtmi:com:example:SampleDeviceModel;1", + "displayName": { + "en": "My Device Model" + }, + "uploadTime": "2020-05-01T17:32:28Z", + "decommissioned": false + }, + { + "id": "dtmi:com:example:AnotherSample;1", + "displayName": { + "en": "My Sample" + }, + "uploadTime": "2020-03-01T17:32:28Z", + "decommissioned": false + } + ], + "nextLink": "url-to-next-page" + } + } + } + }, + "ModelsGetWithContextAndIncludeModelDefinition": { + "parameters": { + "includeModelDefinition": true, + "dependenciesFor": [ + "dtmi:com:example:SampleDeviceModel;1" + ], + "x-ms-max-item-count": "20", + "api-version": "2020-05-31-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "dtmi:com:example:Sample;1", + "uploadTime": "2020-03-01T17:32:28Z", + "decommissioned": false, + "model": { + "@id": "dtmi:com:example:Sample;1", + "@type": "Interface", + "contents": [ + { + "@type": "Property", + "name": "name", + "displayName": "Sample instance name", + "schema": "string" + }, + { + "@type": "Property", + "name": "temp", + "displayName": "Sample instance temperature", + "schema": "integer" + }, + { + "@type": "Property", + "name": "comfortIndex", + "displayName": "Sample instance comfort index", + "schema": "integer" + } + ], + "@context": "dtmi:dtdl:context;2" + } + }, + { + "id": "dtmi:com:example:SampleDeviceModel;1", + "displayName": { + "en": "My Device Model" + }, + "uploadTime": "2020-03-01T17:32:28Z", + "decommissioned": false, + "model": { + "@id": "dtmi:com:example:SampleDeviceModel;1", + "@type": "Interface", + "displayName": "My Device Model", + "contents": [ + { + "@type": "Component", + "name": "Sample", + "schema": "dtmi:com:example:Sample;1" + } + ], + "@context": "dtmi:dtdl:context;2" + } + } + ], + "nextLink": "url-to-next-page" + } + } + } + } + } + }, + "deprecated": false, + "hidden": false + }, + { + "parameters": [ + { + "$id": "154", + "clientProperty": { + "$ref": "118" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id for the model. The id is globally unique and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "modelId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/modelId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "id" + }, + "serializedName": "id", + "modelType": { + "$id": "155", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "156", + "clientProperty": { + "$ref": "120" + }, + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "false" + }, + "documentation": { + "fixed": false, + "raw": "When true the model definition will be returned as part of the result." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "includeModelDefinition", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/includeModelDefinition" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "includeModelDefinition" + }, + "serializedName": "includeModelDefinition", + "modelType": { + "$id": "157", + "$type": "PrimaryType", + "knownPrimaryType": "boolean", + "name": { + "fixed": false, + "raw": "Boolean" + } + } + }, + { + "$id": "158", + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The API version to use for the request." + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "159", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "name": { + "fixed": false, + "raw": "GetById" + }, + "group": { + "fixed": false, + "raw": "DigitalTwinModels" + }, + "serializedName": "DigitalTwinModels_GetById", + "url": "/models/{id}", + "isAbsoluteUrl": false, + "httpMethod": "get", + "responses": { + "OK": { + "body": { + "$ref": "13" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·k5bbno·models-id·get·responses·200", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·k5bbno·models-id·get·responses·200" + ] + } + }, + "isNullable": true + } + }, + "defaultResponse": { + "body": { + "$ref": "76" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·9om2rl·models-id·get·responses·default", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·9om2rl·models-id·get·responses·default" + ] + } + }, + "isNullable": true + }, + "returnType": { + "body": { + "$ref": "13" + }, + "isNullable": true + }, + "description": "Retrieves model metadata and optionally the model definition.\nStatus codes:\n200 (OK): Success.\n404 (Not Found): There is no model with the provided id.", + "requestContentType": "application/json; charset=utf-8", + "responseContentTypes": [ + "application/json" + ], + "extensions": { + "servers": [ + { + "url": "https://digitaltwins-name.digitaltwins.azure.net/" + } + ], + "x-ms-examples": { + "ModelGetById": { + "parameters": { + "id": "dtmi:com:example:Sample;1", + "api-version": "2020-05-31-preview" + }, + "responses": { + "200": { + "body": { + "id": "dtmi:com:example:Sample;1", + "uploadTime": "2020-03-01T17:32:28Z", + "decommissioned": false + } + } + } + }, + "ModelGetByIdWithIncludeModelDefinition": { + "parameters": { + "id": "dtmi:com:example:Sample;1", + "includeModelDefinition": true, + "api-version": "2020-05-31-preview" + }, + "responses": { + "200": { + "body": { + "id": "dtmi:com:example:Sample;1", + "uploadTime": "2020-03-01T17:32:28Z", + "decommissioned": false, + "model": { + "@id": "dtmi:com:example:Sample;1", + "@type": "Interface", + "contents": [ + { + "@type": "Property", + "name": "name", + "displayName": "Sample instance name", + "schema": "string" + }, + { + "@type": "Property", + "name": "temp", + "displayName": "Sample instance temperature", + "schema": "integer" + }, + { + "@type": "Property", + "name": "comfortIndex", + "displayName": "Sample instance comfort index", + "schema": "integer" + } + ], + "@context": "dtmi:dtdl:context;2" + } + } + } + } + } + } + }, + "deprecated": false, + "hidden": false + }, + { + "parameters": [ + { + "$id": "160", + "clientProperty": { + "$ref": "118" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id for the model. The id is globally unique and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "modelId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/modelId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "id" + }, + "serializedName": "id", + "modelType": { + "$id": "161", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "162", + "location": "body", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "An update specification described by JSON Patch. Only the decommissioned property can be replaced." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·dqy3y5·models-id·patch·requestbody", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/requestBodies/paths·dqy3y5·models-id·patch·requestbody" + ] + }, + "x-ms-requestBody-name": "updateModel" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "updateModel" + }, + "serializedName": "updateModel", + "modelType": { + "$id": "163", + "$type": "SequenceType", + "elementType": { + "$id": "164", + "$type": "PrimaryType", + "knownPrimaryType": "object", + "name": { + "fixed": false, + "raw": "Object" + } + }, + "name": { + "fixed": false + } + } + }, + { + "$id": "165", + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The API version to use for the request." + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "166", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "name": { + "fixed": false, + "raw": "Update" + }, + "group": { + "fixed": false, + "raw": "DigitalTwinModels" + }, + "serializedName": "DigitalTwinModels_Update", + "url": "/models/{id}", + "isAbsoluteUrl": false, + "httpMethod": "patch", + "responses": { + "NoContent": { + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1fr449t·models-id·patch·responses·204", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·1fr449t·models-id·patch·responses·204" + ] + } + }, + "isNullable": true + } + }, + "defaultResponse": { + "body": { + "$ref": "76" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·16dx523·models-id·patch·responses·default", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·16dx523·models-id·patch·responses·default" + ] + } + }, + "isNullable": true + }, + "returnType": { + "isNullable": true + }, + "description": "Updates the metadata for a model.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.\n404 (Not Found): There is no model with the provided id.", + "requestContentType": "application/json-patch+json; charset=utf-8", + "responseContentTypes": [ + "application/json" + ], + "extensions": { + "servers": [ + { + "url": "https://digitaltwins-name.digitaltwins.azure.net/" + } + ], + "x-ms-requestBody-index": "1", + "x-ms-examples": { + "ModelUpdateDecommissioned": { + "parameters": { + "id": "dtmi:com:example:Sample;1", + "updateModel": [ + { + "op": "replace", + "path": "/decommissioned", + "value": true + } + ], + "api-version": "2020-05-31-preview" + }, + "responses": { + "204": {} + } + } + } + }, + "deprecated": false, + "hidden": false + }, + { + "parameters": [ + { + "$id": "167", + "clientProperty": { + "$ref": "118" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id for the model. The id is globally unique and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "modelId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/modelId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "id" + }, + "serializedName": "id", + "modelType": { + "$id": "168", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "169", + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The API version to use for the request." + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "170", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "name": { + "fixed": false, + "raw": "Delete" + }, + "group": { + "fixed": false, + "raw": "DigitalTwinModels" + }, + "serializedName": "DigitalTwinModels_Delete", + "url": "/models/{id}", + "isAbsoluteUrl": false, + "httpMethod": "delete", + "responses": { + "NoContent": { + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·hhfl7m·models-id·delete·responses·204", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·hhfl7m·models-id·delete·responses·204" + ] + } + }, + "isNullable": true + } + }, + "defaultResponse": { + "body": { + "$ref": "76" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1gojuht·models-id·delete·responses·default", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·1gojuht·models-id·delete·responses·default" + ] + } + }, + "isNullable": true + }, + "returnType": { + "isNullable": true + }, + "description": "Deletes a model. A model can only be deleted if no other models reference it.\nStatus codes:\n204 (No Content): Success.\n400 (Bad Request): The request is invalid.\n404 (Not Found): There is no model with the provided id.\n409 (Conflict): There are dependencies on the model that prevent it from being deleted.", + "requestContentType": "application/json; charset=utf-8", + "responseContentTypes": [ + "application/json" + ], + "extensions": { + "servers": [ + { + "url": "https://digitaltwins-name.digitaltwins.azure.net/" + } + ], + "x-ms-examples": { + "DeleteModel": { + "parameters": { + "api-version": "2020-05-31-preview", + "id": "dtmi:com:example:Sample;1" + }, + "responses": { + "204": {} + } + } + } + }, + "deprecated": false, + "hidden": false + } + ], + "name": { + "fixed": false, + "raw": "DigitalTwinModels" + }, + "typeName": { + "fixed": false + }, + "nameForProperty": "DigitalTwinModels" + }, + { + "methods": [ + { + "parameters": [ + { + "$id": "171", + "location": "body", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The query specification to execute." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1dq7mab·query·post·requestbody", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/requestBodies/paths·1dq7mab·query·post·requestbody" + ] + }, + "x-ms-requestBody-name": "querySpecification" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "querySpecification" + }, + "serializedName": "querySpecification", + "modelType": { + "$ref": "53" + } + }, + { + "$id": "172", + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The API version to use for the request." + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "173", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "name": { + "fixed": false, + "raw": "QueryTwins" + }, + "group": { + "fixed": false, + "raw": "Query" + }, + "serializedName": "Query_QueryTwins", + "url": "/query", + "isAbsoluteUrl": false, + "httpMethod": "post", + "responses": { + "OK": { + "body": { + "$ref": "58" + }, + "headers": { + "$ref": "78" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1xtq3k1·query·post·responses·200", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·1xtq3k1·query·post·responses·200" + ] + } + }, + "isNullable": true + } + }, + "defaultResponse": { + "body": { + "$ref": "76" + }, + "headers": { + "$ref": "78" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1i0qbst·query·post·responses·default", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·1i0qbst·query·post·responses·default" + ] + } + }, + "isNullable": true + }, + "returnType": { + "body": { + "$ref": "58" + }, + "headers": { + "$ref": "78" + }, + "isNullable": true + }, + "description": "Executes a query that allows traversing relationships and filtering by property values.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.", + "requestContentType": "application/json; charset=utf-8", + "responseContentTypes": [ + "application/json" + ], + "extensions": { + "servers": [ + { + "url": "https://digitaltwins-name.digitaltwins.azure.net/" + } + ], + "x-ms-requestBody-index": "0", + "x-ms-examples": { + "QueryFirstPage": { + "parameters": { + "querySpecification": { + "query": "SELECT * FROM DIGITALTWINS WHERE temp = 79" + }, + "api-version": "2020-05-31-preview" + }, + "responses": { + "200": { + "body": { + "items": [ + { + "$dtId": "Twin-01", + "$metadata": { + "$model": "dtmi:com:example:Sample;1" + }, + "name": "Sample01", + "temp": "79", + "comfortIndex": "50" + }, + { + "$dtId": "Twin-02", + "$metadata": { + "$model": "dtmi:com:example:Sample;1" + }, + "name": "Sample02", + "temp": "79", + "comfortIndex": "50" + }, + { + "$dtId": "Twin-03", + "$metadata": { + "$model": "dtmi:com:example:Sample;1" + }, + "name": "Sample03", + "temp": "79", + "comfortIndex": "50" + } + ], + "continuationToken": "" + } + } + } + }, + "QueryNextPage": { + "parameters": { + "querySpecification": { + "continuationToken": "" + }, + "api-version": "2020-05-31-preview" + }, + "responses": { + "200": { + "body": { + "items": [ + { + "$dtId": "Twin-04", + "$metadata": { + "$model": "dtmi:com:example:Sample;1" + }, + "name": "Sample04", + "temp": "79", + "comfortIndex": "50" + }, + { + "$dtId": "Twin-05", + "$metadata": { + "$model": "dtmi:com:example:Sample;1" + }, + "name": "Sample05", + "temp": "79", + "comfortIndex": "50" + }, + { + "$dtId": "Twin-06", + "$metadata": { + "$model": "dtmi:com:example:Sample;1" + }, + "name": "Sample06", + "temp": "79", + "comfortIndex": "50" + } + ] + } + } + } + }, + "QueryJoin": { + "parameters": { + "querySpecification": { + "query": "SELECT Widget, Gadget FROM DIGITALTWINS Widget JOIN Gadget RELATED Widget.Contains WHERE Widget.$dtId = 'Twin-01'" + }, + "api-version": "2020-05-31-preview" + }, + "responses": { + "200": { + "body": { + "items": [ + { + "Widget": { + "$dtId": "Twin-01", + "$metadata": { + "$model": "dtmi:com:example:Sample;1" + }, + "name": "Sample01", + "temp": "79", + "comfortIndex": "50" + }, + "Gadget": { + "$dtId": "Twin-02", + "$metadata": { + "$model": "dtmi:com:example:Sample;1" + }, + "name": "Sample02", + "temp": "79", + "comfortIndex": "50" + } + }, + { + "Widget": { + "$dtId": "Twin-01", + "$metadata": { + "$model": "dtmi:com:example:Sample;1" + }, + "name": "Sample01", + "temp": "79", + "comfortIndex": "50" + }, + "Gadget": { + "$dtId": "Twin-10", + "$metadata": { + "$model": "dtmi:com:example:Sample;1" + }, + "name": "Sample10", + "temp": "79", + "comfortIndex": "50" + } + } + ] + } + } + } + } + } + }, + "deprecated": false, + "hidden": false + } + ], + "name": { + "fixed": false, + "raw": "Query" + }, + "typeName": { + "fixed": false + }, + "nameForProperty": "Query" + }, + { + "methods": [ + { + "parameters": [ + { + "$id": "174", + "clientProperty": { + "$ref": "118" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id of the digital twin. The id is unique within the service and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "digitalTwinId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/digitalTwinId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "id" + }, + "serializedName": "id", + "modelType": { + "$id": "175", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "176", + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The API version to use for the request." + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "177", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "name": { + "fixed": false, + "raw": "GetById" + }, + "group": { + "fixed": false, + "raw": "DigitalTwins" + }, + "serializedName": "DigitalTwins_GetById", + "url": "/digitaltwins/{id}", + "isAbsoluteUrl": false, + "httpMethod": "get", + "responses": { + "OK": { + "body": { + "$id": "178", + "$type": "PrimaryType", + "knownPrimaryType": "object", + "name": { + "fixed": false, + "raw": "Object" + } + }, + "headers": { + "$ref": "81" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·d0hqrw·digitaltwins-id·get·responses·200", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·d0hqrw·digitaltwins-id·get·responses·200" + ] + } + }, + "isNullable": true + } + }, + "defaultResponse": { + "body": { + "$ref": "76" + }, + "headers": { + "$ref": "81" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·yfj3y5·digitaltwins-id·get·responses·default", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·yfj3y5·digitaltwins-id·get·responses·default" + ] + } + }, + "isNullable": true + }, + "returnType": { + "body": { + "$ref": "178" + }, + "headers": { + "$ref": "81" + }, + "isNullable": true + }, + "description": "Retrieves a digital twin.\nStatus codes:\n200 (OK): Success.\n404 (Not Found): There is no digital twin with the provided id.", + "requestContentType": "application/json; charset=utf-8", + "responseContentTypes": [ + "application/json" + ], + "extensions": { + "servers": [ + { + "url": "https://digitaltwins-name.digitaltwins.azure.net/" + } + ], + "x-ms-examples": { + "GetTwin": { + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myTwinId" + }, + "responses": { + "200": { + "body": { + "$dtId": "myTwinId", + "$metadata": { + "$model": "dtmi:com:example:interfaces:interfaceName;1", + "property1": { + "desiredValue": "1", + "desiredVersion": "1", + "ackVersion": "1", + "ackCode": "200", + "ackDescription": "description", + "lastUpdateTime": "2020-05-23T21:44:02Z" + }, + "property2": { + "desiredValue": { + "subProperty1": "some value", + "subProperty2": "some other value" + }, + "desiredVersion": "1", + "ackVersion": "1", + "ackCode": "200", + "ackDescription": "description", + "lastUpdateTime": "2020-05-23T21:44:02Z" + } + }, + "property1": "1", + "property2": { + "subProperty1": "some value", + "subProperty2": "some other value" + }, + "component1": { + "$metadata": { + "$model": "dtmi:com:example:interfaces:subInterfaceName;1", + "componentProperty": { + "desiredValue": "some value", + "desiredVersion": "1", + "ackVersion": "1", + "ackCode": "200", + "ackDescription": "description", + "lastUpdateTime": "2020-05-23T21:44:02Z" + } + } + } + } + } + } + } + } + }, + "deprecated": false, + "hidden": false + }, + { + "parameters": [ + { + "$id": "179", + "clientProperty": { + "$ref": "118" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id of the digital twin. The id is unique within the service and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "digitalTwinId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/digitalTwinId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "id" + }, + "serializedName": "id", + "modelType": { + "$id": "180", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "181", + "location": "body", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The digital twin instance being added. If provided, the $dtId property is ignored." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·m9z6xn·digitaltwins-id·put·requestbody", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/requestBodies/paths·m9z6xn·digitaltwins-id·put·requestbody" + ] + }, + "x-ms-requestBody-name": "twin" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "twin" + }, + "serializedName": "twin", + "modelType": { + "$id": "182", + "$type": "PrimaryType", + "knownPrimaryType": "object", + "name": { + "fixed": false, + "raw": "Object" + } + } + }, + { + "$id": "183", + "clientProperty": { + "$ref": "134" + }, + "location": "header", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "Only perform the operation if the entity does not already exist." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "if-none-match-star", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/if-none-match-star" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "If-None-Match" + }, + "serializedName": "If-None-Match", + "modelType": { + "$id": "184", + "$type": "EnumType", + "modelAsExtensible": false, + "values": [ + { + "name": "*", + "serializedName": "*" + } + ], + "modelAsString": true, + "underlyingType": { + "$id": "185", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + }, + "name": { + "fixed": false, + "raw": "" + } + } + }, + { + "$id": "186", + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The API version to use for the request." + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "187", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "name": { + "fixed": false, + "raw": "Add" + }, + "group": { + "fixed": false, + "raw": "DigitalTwins" + }, + "serializedName": "DigitalTwins_Add", + "url": "/digitaltwins/{id}", + "isAbsoluteUrl": false, + "httpMethod": "put", + "responses": { + "OK": { + "body": { + "$id": "188", + "$type": "PrimaryType", + "knownPrimaryType": "object", + "name": { + "fixed": false, + "raw": "Object" + } + }, + "headers": { + "$ref": "84" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·foesnq·digitaltwins-id·put·responses·200", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·foesnq·digitaltwins-id·put·responses·200" + ] + } + }, + "isNullable": true + }, + "Accepted": { + "headers": { + "$ref": "84" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1e94wny·digitaltwins-id·put·responses·202", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·1e94wny·digitaltwins-id·put·responses·202" + ] + } + }, + "isNullable": true + } + }, + "defaultResponse": { + "body": { + "$ref": "76" + }, + "headers": { + "$ref": "84" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·uow1rq·digitaltwins-id·put·responses·default", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·uow1rq·digitaltwins-id·put·responses·default" + ] + } + }, + "isNullable": true + }, + "returnType": { + "body": { + "$ref": "188" + }, + "headers": { + "$ref": "84" + }, + "isNullable": true + }, + "description": "Adds or replaces a digital twin.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.\n412 (Precondition Failed): The model is decommissioned or the digital twin already exists (when using If-None-Match: *).", + "requestContentType": "application/json; charset=utf-8", + "responseContentTypes": [ + "application/json" + ], + "extensions": { + "servers": [ + { + "url": "https://digitaltwins-name.digitaltwins.azure.net/" + } + ], + "x-ms-requestBody-index": "1", + "x-ms-examples": { + "PutTwinBasicExample": { + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myNewTwinId", + "twin": { + "$metadata": { + "$model": "dtmi:com:example:interfaces:interfaceName;1" + } + } + }, + "responses": { + "200": { + "body": { + "$dtId": "myNewTwinId", + "$metadata": { + "$model": "dtmi:com:example:interfaces:interfaceName;1" + } + } + }, + "202": {} + } + }, + "PutTwinAdvancedExample": { + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myNewTwinId", + "If-None-Match": "*", + "twin": { + "$metadata": { + "$model": "dtmi:com:example:interfaces:interfaceName;1" + }, + "property1": "1", + "property2": { + "subProperty1": "some value", + "subProperty2": "some other value" + }, + "component1": { + "$metadata": { + "$model": "dtmi:com:example:interfaces:subInterfaceName;1" + }, + "componentProperty": "some value" + } + } + }, + "responses": { + "200": { + "body": { + "$dtId": "myNewTwinId", + "$metadata": { + "$model": "dtmi:com:example:interfaces:interfaceName;1", + "property1": { + "desiredValue": "1", + "desiredVersion": "1", + "ackVersion": "1", + "ackCode": "200", + "ackDescription": "description", + "lastUpdateTime": "2020-05-23T21:44:02Z" + }, + "property2": { + "desiredValue": { + "subProperty1": "some value", + "subProperty2": "some other value" + }, + "desiredVersion": "1", + "ackVersion": "1", + "ackCode": "200", + "ackDescription": "description", + "lastUpdateTime": "2020-05-23T21:44:02Z" + } + }, + "property1": "1", + "property2": { + "subProperty1": "some value", + "subProperty2": "some other value" + }, + "component1": { + "$metadata": { + "$model": "dtmi:com:example:interfaces:subInterfaceName;1", + "componentProperty": { + "desiredValue": "some value", + "desiredVersion": "1", + "ackVersion": "1", + "ackCode": "200", + "ackDescription": "description", + "lastUpdateTime": "2020-05-23T21:44:02Z" + } + } + } + } + }, + "202": {} + } + } + } + }, + "deprecated": false, + "hidden": false + }, + { + "parameters": [ + { + "$id": "189", + "clientProperty": { + "$ref": "118" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id of the digital twin. The id is unique within the service and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "digitalTwinId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/digitalTwinId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "id" + }, + "serializedName": "id", + "modelType": { + "$id": "190", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "191", + "clientProperty": { + "$ref": "137" + }, + "location": "header", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "Only perform the operation if the entity's etag matches one of the etags provided or * is provided." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "if-match", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/if-match" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "If-Match" + }, + "serializedName": "If-Match", + "modelType": { + "$id": "192", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "193", + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The API version to use for the request." + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "194", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "name": { + "fixed": false, + "raw": "Delete" + }, + "group": { + "fixed": false, + "raw": "DigitalTwins" + }, + "serializedName": "DigitalTwins_Delete", + "url": "/digitaltwins/{id}", + "isAbsoluteUrl": false, + "httpMethod": "delete", + "responses": { + "NoContent": { + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·n65sz8·digitaltwins-id·delete·responses·204", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·n65sz8·digitaltwins-id·delete·responses·204" + ] + } + }, + "isNullable": true + } + }, + "defaultResponse": { + "body": { + "$ref": "76" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1e7hp5e·digitaltwins-id·delete·responses·default", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·1e7hp5e·digitaltwins-id·delete·responses·default" + ] + } + }, + "isNullable": true + }, + "returnType": { + "isNullable": true + }, + "description": "Deletes a digital twin. All relationships referencing the digital twin must already be deleted.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.\n404 (Not Found): There is no digital twin with the provided id.", + "requestContentType": "application/json; charset=utf-8", + "responseContentTypes": [ + "application/json" + ], + "extensions": { + "servers": [ + { + "url": "https://digitaltwins-name.digitaltwins.azure.net/" + } + ], + "x-ms-examples": { + "DeleteTwin": { + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myTwinId" + }, + "responses": { + "204": {} + } + } + } + }, + "deprecated": false, + "hidden": false + }, + { + "parameters": [ + { + "$id": "195", + "clientProperty": { + "$ref": "118" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id of the digital twin. The id is unique within the service and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "digitalTwinId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/digitalTwinId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "id" + }, + "serializedName": "id", + "modelType": { + "$id": "196", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "197", + "location": "body", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "An update specification described by JSON Patch. Updates to property values and $model elements may happen in the same request. Operations are limited to add, replace and remove." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·11buglb·digitaltwins-id·patch·requestbody", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/requestBodies/paths·11buglb·digitaltwins-id·patch·requestbody" + ] + }, + "x-ms-requestBody-name": "patchDocument" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "patchDocument" + }, + "serializedName": "patchDocument", + "modelType": { + "$id": "198", + "$type": "SequenceType", + "elementType": { + "$id": "199", + "$type": "PrimaryType", + "knownPrimaryType": "object", + "name": { + "fixed": false, + "raw": "Object" + } + }, + "name": { + "fixed": false + } + } + }, + { + "$id": "200", + "clientProperty": { + "$ref": "137" + }, + "location": "header", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "Only perform the operation if the entity's etag matches one of the etags provided or * is provided." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "if-match", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/if-match" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "If-Match" + }, + "serializedName": "If-Match", + "modelType": { + "$id": "201", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "202", + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The API version to use for the request." + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "203", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "name": { + "fixed": false, + "raw": "Update" + }, + "group": { + "fixed": false, + "raw": "DigitalTwins" + }, + "serializedName": "DigitalTwins_Update", + "url": "/digitaltwins/{id}", + "isAbsoluteUrl": false, + "httpMethod": "patch", + "responses": { + "Accepted": { + "headers": { + "$ref": "87" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·121lnpx·digitaltwins-id·patch·responses·202", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·121lnpx·digitaltwins-id·patch·responses·202" + ] + } + }, + "isNullable": true + }, + "NoContent": { + "headers": { + "$ref": "87" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·2s0dn1·digitaltwins-id·patch·responses·204", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·2s0dn1·digitaltwins-id·patch·responses·204" + ] + } + }, + "isNullable": true + } + }, + "defaultResponse": { + "body": { + "$ref": "76" + }, + "headers": { + "$ref": "87" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·sge5e1·digitaltwins-id·patch·responses·default", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·sge5e1·digitaltwins-id·patch·responses·default" + ] + } + }, + "isNullable": true + }, + "returnType": { + "headers": { + "$ref": "87" + }, + "isNullable": true + }, + "description": "Updates a digital twin.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.\n404 (Not Found): There is no digital twin with the provided id.", + "requestContentType": "application/json-patch+json; charset=utf-8", + "responseContentTypes": [ + "application/json" + ], + "extensions": { + "servers": [ + { + "url": "https://digitaltwins-name.digitaltwins.azure.net/" + } + ], + "x-ms-requestBody-index": "1", + "x-ms-examples": { + "PatchTwinBasicExample": { + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myNewTwinId", + "patchDocument": [ + { + "op": "replace", + "path": "/property1", + "value": "1" + } + ] + }, + "responses": { + "202": {}, + "204": {} + } + }, + "PatchTwinAdvancedExample": { + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myNewTwinId", + "patchDocument": [ + { + "op": "replace", + "path": "/property1", + "value": "1" + }, + { + "op": "add", + "path": "/property2/subProperty1", + "value": "1" + }, + { + "op": "remove", + "path": "/property3" + } + ] + }, + "responses": { + "202": {}, + "204": {} + } + } + } + }, + "deprecated": false, + "hidden": false + }, + { + "parameters": [ + { + "$id": "204", + "clientProperty": { + "$ref": "118" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id of the digital twin. The id is unique within the service and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "digitalTwinId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/digitalTwinId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "id" + }, + "serializedName": "id", + "modelType": { + "$id": "205", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "206", + "clientProperty": { + "$ref": "126" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id of the relationship. The id is unique within the digital twin and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "relationshipId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/relationshipId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "relationshipId" + }, + "serializedName": "relationshipId", + "modelType": { + "$id": "207", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "208", + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The API version to use for the request." + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "209", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "name": { + "fixed": false, + "raw": "GetRelationshipById" + }, + "group": { + "fixed": false, + "raw": "DigitalTwins" + }, + "serializedName": "DigitalTwins_GetRelationshipById", + "url": "/digitaltwins/{id}/relationships/{relationshipId}", + "isAbsoluteUrl": false, + "httpMethod": "get", + "responses": { + "OK": { + "body": { + "$id": "210", + "$type": "PrimaryType", + "knownPrimaryType": "object", + "name": { + "fixed": false, + "raw": "Object" + } + }, + "headers": { + "$ref": "90" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·2xpxli·digitaltwins-id-relationships-relationshipid·get·responses·200", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·2xpxli·digitaltwins-id-relationships-relationshipid·get·responses·200" + ] + } + }, + "isNullable": true + } + }, + "defaultResponse": { + "body": { + "$ref": "76" + }, + "headers": { + "$ref": "90" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1sjyiup·digitaltwins-id-relationships-relationshipid·get·responses·default", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·1sjyiup·digitaltwins-id-relationships-relationshipid·get·responses·default" + ] + } + }, + "isNullable": true + }, + "returnType": { + "body": { + "$ref": "210" + }, + "headers": { + "$ref": "90" + }, + "isNullable": true + }, + "description": "Retrieves a relationship between two digital twins.\nStatus codes:\n200 (OK): Success.\n404 (Not Found): There is either no digital twin or relationship with the provided id.", + "requestContentType": "application/json; charset=utf-8", + "responseContentTypes": [ + "application/json" + ], + "extensions": { + "servers": [ + { + "url": "https://digitaltwins-name.digitaltwins.azure.net/" + } + ], + "x-ms-examples": { + "GetRelationshipById": { + "parameters": { + "api-version": "2020-05-31-preview", + "id": "mySourceTwin", + "relationshipId": "myRelationshipId" + }, + "responses": { + "200": { + "body": { + "$relationshipId": "myRelationshipId", + "$sourceId": "mySourceTwin", + "$targetId": "myTargetTwin", + "$relationshipName": "myRelationship", + "relationshipProperty": "some value" + } + } + } + } + } + }, + "deprecated": false, + "hidden": false + }, + { + "parameters": [ + { + "$id": "211", + "clientProperty": { + "$ref": "118" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id of the digital twin. The id is unique within the service and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "digitalTwinId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/digitalTwinId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "id" + }, + "serializedName": "id", + "modelType": { + "$id": "212", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "213", + "clientProperty": { + "$ref": "126" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id of the relationship. The id is unique within the digital twin and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "relationshipId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/relationshipId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "relationshipId" + }, + "serializedName": "relationshipId", + "modelType": { + "$id": "214", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "215", + "location": "body", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The data for the relationship." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·yomp8i·digitaltwins-id-relationships-relationshipid·put·requestbody", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/requestBodies/paths·yomp8i·digitaltwins-id-relationships-relationshipid·put·requestbody" + ] + }, + "x-ms-requestBody-name": "relationship" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "relationship" + }, + "serializedName": "relationship", + "modelType": { + "$id": "216", + "$type": "PrimaryType", + "knownPrimaryType": "object", + "name": { + "fixed": false, + "raw": "Object" + } + } + }, + { + "$id": "217", + "clientProperty": { + "$ref": "134" + }, + "location": "header", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "Only perform the operation if the entity does not already exist." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "if-none-match-star", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/if-none-match-star" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "If-None-Match" + }, + "serializedName": "If-None-Match", + "modelType": { + "$id": "218", + "$type": "EnumType", + "modelAsExtensible": false, + "values": [ + { + "name": "*", + "serializedName": "*" + } + ], + "modelAsString": true, + "underlyingType": { + "$id": "219", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + }, + "name": { + "fixed": false, + "raw": "" + } + } + }, + { + "$id": "220", + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The API version to use for the request." + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "221", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "name": { + "fixed": false, + "raw": "AddRelationship" + }, + "group": { + "fixed": false, + "raw": "DigitalTwins" + }, + "serializedName": "DigitalTwins_AddRelationship", + "url": "/digitaltwins/{id}/relationships/{relationshipId}", + "isAbsoluteUrl": false, + "httpMethod": "put", + "responses": { + "OK": { + "body": { + "$id": "222", + "$type": "PrimaryType", + "knownPrimaryType": "object", + "name": { + "fixed": false, + "raw": "Object" + } + }, + "headers": { + "$ref": "93" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·p851zf·digitaltwins-id-relationships-relationshipid·put·responses·200", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·p851zf·digitaltwins-id-relationships-relationshipid·put·responses·200" + ] + } + }, + "isNullable": true + } + }, + "defaultResponse": { + "body": { + "$ref": "76" + }, + "headers": { + "$ref": "93" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1uqrs4x·digitaltwins-id-relationships-relationshipid·put·responses·default", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·1uqrs4x·digitaltwins-id-relationships-relationshipid·put·responses·default" + ] + } + }, + "isNullable": true + }, + "returnType": { + "body": { + "$ref": "222" + }, + "headers": { + "$ref": "93" + }, + "isNullable": true + }, + "description": "Adds a relationship between two digital twins.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.\n404 (Not Found): There is either no digital twin, target digital twin, or relationship with the provided id.\n409 (Conflict): A relationship with the provided id already exists.", + "requestContentType": "application/json; charset=utf-8", + "responseContentTypes": [ + "application/json" + ], + "extensions": { + "servers": [ + { + "url": "https://digitaltwins-name.digitaltwins.azure.net/" + } + ], + "x-ms-requestBody-index": "2", + "x-ms-examples": { + "CreateRelationshipBasicExample": { + "parameters": { + "api-version": "2020-05-31-preview", + "id": "mySourceTwin", + "relationshipId": "myRelationshipId", + "relationship": { + "$targetId": "myTargetTwin", + "$relationshipName": "myRelationship" + } + }, + "responses": { + "200": { + "body": { + "$relationshipId": "myRelationshipId", + "$sourceId": "mySourceTwin", + "$targetId": "myTargetTwin", + "$relationshipName": "myRelationship" + } + } + } + }, + "CreateRelationshipAdvancedExample": { + "parameters": { + "api-version": "2020-05-31-preview", + "id": "mySourceTwin", + "relationshipId": "myRelationshipId", + "relationship": { + "$targetId": "myTargetTwin", + "$relationshipName": "myRelationship", + "relationshipProperty1": "1", + "relationshipProperty2": "some value" + } + }, + "responses": { + "200": { + "body": { + "$relationshipId": "myRelationshipId", + "$sourceId": "mySourceTwin", + "$targetId": "myTargetTwin", + "$relationshipName": "myRelationship", + "relationshipProperty1": "1", + "relationshipProperty2": "some value" + } + } + } + } + } + }, + "deprecated": false, + "hidden": false + }, + { + "parameters": [ + { + "$id": "223", + "clientProperty": { + "$ref": "118" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id of the digital twin. The id is unique within the service and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "digitalTwinId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/digitalTwinId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "id" + }, + "serializedName": "id", + "modelType": { + "$id": "224", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "225", + "clientProperty": { + "$ref": "126" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id of the relationship. The id is unique within the digital twin and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "relationshipId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/relationshipId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "relationshipId" + }, + "serializedName": "relationshipId", + "modelType": { + "$id": "226", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "227", + "clientProperty": { + "$ref": "137" + }, + "location": "header", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "Only perform the operation if the entity's etag matches one of the etags provided or * is provided." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "if-match", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/if-match" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "If-Match" + }, + "serializedName": "If-Match", + "modelType": { + "$id": "228", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "229", + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The API version to use for the request." + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "230", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "name": { + "fixed": false, + "raw": "DeleteRelationship" + }, + "group": { + "fixed": false, + "raw": "DigitalTwins" + }, + "serializedName": "DigitalTwins_DeleteRelationship", + "url": "/digitaltwins/{id}/relationships/{relationshipId}", + "isAbsoluteUrl": false, + "httpMethod": "delete", + "responses": { + "NoContent": { + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·bt67eo·digitaltwins-id-relationships-relationshipid·delete·responses·204", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·bt67eo·digitaltwins-id-relationships-relationshipid·delete·responses·204" + ] + } + }, + "isNullable": true + } + }, + "defaultResponse": { + "body": { + "$ref": "76" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·135la4v·digitaltwins-id-relationships-relationshipid·delete·responses·default", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·135la4v·digitaltwins-id-relationships-relationshipid·delete·responses·default" + ] + } + }, + "isNullable": true + }, + "returnType": { + "isNullable": true + }, + "description": "Deletes a relationship between two digital twins.\nStatus codes:\n200 (OK): Success.\n404 (Not Found): There is either no digital twin or relationship with the provided id.", + "requestContentType": "application/json; charset=utf-8", + "responseContentTypes": [ + "application/json" + ], + "extensions": { + "servers": [ + { + "url": "https://digitaltwins-name.digitaltwins.azure.net/" + } + ], + "x-ms-examples": { + "DeleteRelationship": { + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myTwinId", + "relationshipId": "myRelationshipId" + }, + "responses": { + "204": {} + } + } + } + }, + "deprecated": false, + "hidden": false + }, + { + "parameters": [ + { + "$id": "231", + "clientProperty": { + "$ref": "118" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id of the digital twin. The id is unique within the service and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "digitalTwinId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/digitalTwinId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "id" + }, + "serializedName": "id", + "modelType": { + "$id": "232", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "233", + "clientProperty": { + "$ref": "126" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id of the relationship. The id is unique within the digital twin and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "relationshipId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/relationshipId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "relationshipId" + }, + "serializedName": "relationshipId", + "modelType": { + "$id": "234", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "235", + "location": "body", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "JSON Patch description of the update to the relationship properties." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1ub3pvy·digitaltwins-id-relationships-relationshipid·patch·requestbody", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/requestBodies/paths·1ub3pvy·digitaltwins-id-relationships-relationshipid·patch·requestbody" + ] + }, + "x-ms-requestBody-name": "patchDocument" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "patchDocument" + }, + "serializedName": "patchDocument", + "modelType": { + "$id": "236", + "$type": "SequenceType", + "elementType": { + "$id": "237", + "$type": "PrimaryType", + "knownPrimaryType": "object", + "name": { + "fixed": false, + "raw": "Object" + } + }, + "name": { + "fixed": false + } + } + }, + { + "$id": "238", + "clientProperty": { + "$ref": "137" + }, + "location": "header", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "Only perform the operation if the entity's etag matches one of the etags provided or * is provided." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "if-match", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/if-match" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "If-Match" + }, + "serializedName": "If-Match", + "modelType": { + "$id": "239", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "240", + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The API version to use for the request." + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "241", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "name": { + "fixed": false, + "raw": "UpdateRelationship" + }, + "group": { + "fixed": false, + "raw": "DigitalTwins" + }, + "serializedName": "DigitalTwins_UpdateRelationship", + "url": "/digitaltwins/{id}/relationships/{relationshipId}", + "isAbsoluteUrl": false, + "httpMethod": "patch", + "responses": { + "NoContent": { + "headers": { + "$ref": "96" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·nc4mwc·digitaltwins-id-relationships-relationshipid·patch·responses·204", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·nc4mwc·digitaltwins-id-relationships-relationshipid·patch·responses·204" + ] + } + }, + "isNullable": true + } + }, + "defaultResponse": { + "body": { + "$ref": "76" + }, + "headers": { + "$ref": "96" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·irkbo3·digitaltwins-id-relationships-relationshipid·patch·responses·default", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·irkbo3·digitaltwins-id-relationships-relationshipid·patch·responses·default" + ] + } + }, + "isNullable": true + }, + "returnType": { + "headers": { + "$ref": "96" + }, + "isNullable": true + }, + "description": "Updates the properties on a relationship between two digital twins.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.\n404 (Not Found): There is either no digital twin or relationship with the provided id.", + "requestContentType": "application/json-patch+json; charset=utf-8", + "responseContentTypes": [ + "application/json" + ], + "extensions": { + "servers": [ + { + "url": "https://digitaltwins-name.digitaltwins.azure.net/" + } + ], + "x-ms-requestBody-index": "2", + "x-ms-examples": { + "PatchRelationshipBasicExample": { + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myTwinId", + "relationshipId": "myRelationshipId", + "patchDocument": [ + { + "op": "add", + "path": "/property", + "value": "1" + } + ] + }, + "responses": { + "204": {} + } + }, + "PatchRelationshipAdvancedExample": { + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myTwinId", + "relationshipId": "myRelationshipId", + "patchDocument": [ + { + "op": "add", + "path": "/property1", + "value": "1" + }, + { + "op": "remove", + "path": "/property2" + }, + { + "op": "replace", + "path": "/property3/subProperty1", + "value": "new value" + } + ] + }, + "responses": { + "204": {} + } + } + } + }, + "deprecated": false, + "hidden": false + }, + { + "parameters": [ + { + "$id": "242", + "clientProperty": { + "$ref": "118" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id of the digital twin. The id is unique within the service and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "digitalTwinId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/digitalTwinId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "id" + }, + "serializedName": "id", + "modelType": { + "$id": "243", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "244", + "clientProperty": { + "$ref": "108" + }, + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The name of the relationship." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·aacosl·digitaltwins-id-relationships·get·parameters·1", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/paths·aacosl·digitaltwins-id-relationships·get·parameters·1" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "relationshipName" + }, + "serializedName": "relationshipName", + "modelType": { + "$id": "245", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "246", + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The API version to use for the request." + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "247", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "name": { + "fixed": false, + "raw": "ListRelationships" + }, + "group": { + "fixed": false, + "raw": "DigitalTwins" + }, + "serializedName": "DigitalTwins_ListRelationships", + "url": "/digitaltwins/{id}/relationships", + "isAbsoluteUrl": false, + "httpMethod": "get", + "responses": { + "OK": { + "body": { + "$ref": "33" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1iec9h2·digitaltwins-id-relationships·get·responses·200", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·1iec9h2·digitaltwins-id-relationships·get·responses·200" + ] + } + }, + "isNullable": true + } + }, + "defaultResponse": { + "body": { + "$ref": "76" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1qh3nia·digitaltwins-id-relationships·get·responses·default", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·1qh3nia·digitaltwins-id-relationships·get·responses·default" + ] + } + }, + "isNullable": true + }, + "returnType": { + "body": { + "$ref": "33" + }, + "isNullable": true + }, + "description": "Retrieves the relationships from a digital twin.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.\n404 (Not Found): There is no digital twin with the provided id.", + "requestContentType": "application/json; charset=utf-8", + "responseContentTypes": [ + "application/json" + ], + "extensions": { + "servers": [ + { + "url": "https://digitaltwins-name.digitaltwins.azure.net/" + } + ], + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "GetRelationship": { + "parameters": { + "api-version": "2020-05-31-preview", + "id": "mySourceTwin" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "$sourceId": "mySourceTwin", + "$relationshipId": "firstRelationshipId", + "$targetId": "targetTwinId", + "$relationshipName": "myRelationship", + "property": "value" + }, + { + "$sourceId": "mySourceTwin", + "$relationshipId": "secondRelationshipId", + "$targetId": "targetTwinId", + "$relationshipName": "myRelationship", + "property": "value" + } + ], + "nextLink": "url-to-next-page" + } + } + } + }, + "GetRelationshipByName": { + "parameters": { + "api-version": "2020-05-31-preview", + "id": "mySourceTwin", + "relationshipName": "myRelationship" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "$sourceId": "mySourceTwin", + "$relationshipId": "firstRelationshipId", + "$targetId": "targetTwinId", + "$relationshipName": "myRelationship", + "property": "value" + }, + { + "$sourceId": "mySourceTwin", + "$relationshipId": "secondRelationshipId", + "$targetId": "targetTwinId", + "$relationshipName": "myRelationship", + "property": "value" + } + ], + "nextLink": "url-to-next-page" + } + } + } + } + } + }, + "deprecated": false, + "hidden": false + }, + { + "parameters": [ + { + "$id": "248", + "clientProperty": { + "$ref": "118" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id of the digital twin. The id is unique within the service and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "digitalTwinId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/digitalTwinId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "id" + }, + "serializedName": "id", + "modelType": { + "$id": "249", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "250", + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The API version to use for the request." + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "251", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "name": { + "fixed": false, + "raw": "ListIncomingRelationships" + }, + "group": { + "fixed": false, + "raw": "DigitalTwins" + }, + "serializedName": "DigitalTwins_ListIncomingRelationships", + "url": "/digitaltwins/{id}/incomingrelationships", + "isAbsoluteUrl": false, + "httpMethod": "get", + "responses": { + "OK": { + "body": { + "$ref": "48" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·112olow·digitaltwins-id-incomingrelationships·get·responses·200", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·112olow·digitaltwins-id-incomingrelationships·get·responses·200" + ] + } + }, + "isNullable": true + } + }, + "defaultResponse": { + "body": { + "$ref": "76" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·hrmua1·digitaltwins-id-incomingrelationships·get·responses·default", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·hrmua1·digitaltwins-id-incomingrelationships·get·responses·default" + ] + } + }, + "isNullable": true + }, + "returnType": { + "body": { + "$ref": "48" + }, + "isNullable": true + }, + "description": "Retrieves all incoming relationship for a digital twin.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.\n404 (Not Found): There is no digital twin with the provided id.", + "requestContentType": "application/json; charset=utf-8", + "responseContentTypes": [ + "application/json" + ], + "extensions": { + "servers": [ + { + "url": "https://digitaltwins-name.digitaltwins.azure.net/" + } + ], + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "GetIncomingRelationship": { + "parameters": { + "api-version": "2020-05-31-preview", + "id": "mySourceTwin" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "$sourceId": "mySourceTwin", + "$relationshipId": "firstRelationshipId", + "$relationshipName": "myRelationship", + "$relationshipLink": "/digitaltwins/mySourceTwin/relationships/myRelationship/firstRelationshipId" + }, + { + "$sourceId": "mySourceTwin", + "$relationshipId": "secondRelationshipId", + "$relationshipName": "myRelationship", + "$relationshipLink": "/digitaltwins/mySourceTwin/relationships/myRelationship/secondRelationshipId" + } + ], + "nextLink": "url-to-next-page" + } + } + } + } + } + }, + "deprecated": false, + "hidden": false + }, + { + "parameters": [ + { + "$id": "252", + "clientProperty": { + "$ref": "118" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id of the digital twin. The id is unique within the service and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "digitalTwinId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/digitalTwinId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "id" + }, + "serializedName": "id", + "modelType": { + "$id": "253", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "254", + "location": "body", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The telemetry measurements to send from the digital twin." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1rit3ui·digitaltwins-id-telemetry·post·requestbody", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/requestBodies/paths·1rit3ui·digitaltwins-id-telemetry·post·requestbody" + ] + }, + "x-ms-requestBody-name": "telemetry" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "telemetry" + }, + "serializedName": "telemetry", + "modelType": { + "$id": "255", + "$type": "PrimaryType", + "knownPrimaryType": "object", + "name": { + "fixed": false, + "raw": "Object" + } + } + }, + { + "$id": "256", + "clientProperty": { + "$ref": "110" + }, + "location": "header", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "A unique message identifier (in the scope of the digital twin id) that is commonly used for de-duplicating messages." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1dpn2p9·digitaltwins-id-telemetry·post·parameters·1", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/paths·1dpn2p9·digitaltwins-id-telemetry·post·parameters·1" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "dt-id" + }, + "serializedName": "dt-id", + "modelType": { + "$id": "257", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "258", + "clientProperty": { + "$ref": "112" + }, + "location": "header", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "An RFC 3339 timestamp that identifies the time the telemetry was measured." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1y4wap4·digitaltwins-id-telemetry·post·parameters·2", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/paths·1y4wap4·digitaltwins-id-telemetry·post·parameters·2" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "dt-timestamp" + }, + "serializedName": "dt-timestamp", + "modelType": { + "$id": "259", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "260", + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The API version to use for the request." + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "261", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "name": { + "fixed": false, + "raw": "SendTelemetry" + }, + "group": { + "fixed": false, + "raw": "DigitalTwins" + }, + "serializedName": "DigitalTwins_SendTelemetry", + "url": "/digitaltwins/{id}/telemetry", + "isAbsoluteUrl": false, + "httpMethod": "post", + "responses": { + "NoContent": { + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·g5bxsl·digitaltwins-id-telemetry·post·responses·204", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·g5bxsl·digitaltwins-id-telemetry·post·responses·204" + ] + } + }, + "isNullable": true + } + }, + "defaultResponse": { + "body": { + "$ref": "76" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1wl679b·digitaltwins-id-telemetry·post·responses·default", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·1wl679b·digitaltwins-id-telemetry·post·responses·default" + ] + } + }, + "isNullable": true + }, + "returnType": { + "isNullable": true + }, + "description": "Sends telemetry on behalf of a digital twin.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.\n404 (Not Found): There is no digital twin with the provided id.", + "requestContentType": "application/json; charset=utf-8", + "responseContentTypes": [ + "application/json" + ], + "extensions": { + "servers": [ + { + "url": "https://digitaltwins-name.digitaltwins.azure.net/" + } + ], + "x-ms-requestBody-index": "1", + "x-ms-examples": { + "SendTelemetry": { + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myTwinId", + "dt-id": "e5ca50dd-ca31-4fae-8d84-3af5a72b10c5", + "dt-timestamp": "1985-04-12T23:20:50.52Z", + "telemetry": { + "temperature": "1" + } + }, + "responses": { + "204": {} + } + } + } + }, + "deprecated": false, + "hidden": false + }, + { + "parameters": [ + { + "$id": "262", + "clientProperty": { + "$ref": "118" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id of the digital twin. The id is unique within the service and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "digitalTwinId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/digitalTwinId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "id" + }, + "serializedName": "id", + "modelType": { + "$id": "263", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "264", + "clientProperty": { + "$ref": "128" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The name of the DTDL component." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "componentPath", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/componentPath" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "componentPath" + }, + "serializedName": "componentPath", + "modelType": { + "$id": "265", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "266", + "location": "body", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The telemetry measurements to send from the digital twin's component." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·adrqv7·digitaltwins-id-components-componentpath-telemetry·post·requestbody", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/requestBodies/paths·adrqv7·digitaltwins-id-components-componentpath-telemetry·post·requestbody" + ] + }, + "x-ms-requestBody-name": "telemetry" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "telemetry" + }, + "serializedName": "telemetry", + "modelType": { + "$id": "267", + "$type": "PrimaryType", + "knownPrimaryType": "object", + "name": { + "fixed": false, + "raw": "Object" + } + } + }, + { + "$id": "268", + "clientProperty": { + "$ref": "110" + }, + "location": "header", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "A unique message identifier (in the scope of the digital twin id) that is commonly used for de-duplicating messages." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1pbfub8·digitaltwins-id-components-componentpath-telemetry·post·parameters·2", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/paths·1pbfub8·digitaltwins-id-components-componentpath-telemetry·post·parameters·2" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "dt-id" + }, + "serializedName": "dt-id", + "modelType": { + "$id": "269", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "270", + "clientProperty": { + "$ref": "112" + }, + "location": "header", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "An RFC 3339 timestamp that identifies the time the telemetry was measured." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·156zrxy·digitaltwins-id-components-componentpath-telemetry·post·parameters·3", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/paths·156zrxy·digitaltwins-id-components-componentpath-telemetry·post·parameters·3" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "dt-timestamp" + }, + "serializedName": "dt-timestamp", + "modelType": { + "$id": "271", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "272", + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The API version to use for the request." + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "273", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "name": { + "fixed": false, + "raw": "SendComponentTelemetry" + }, + "group": { + "fixed": false, + "raw": "DigitalTwins" + }, + "serializedName": "DigitalTwins_SendComponentTelemetry", + "url": "/digitaltwins/{id}/components/{componentPath}/telemetry", + "isAbsoluteUrl": false, + "httpMethod": "post", + "responses": { + "NoContent": { + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1e3668l·digitaltwins-id-components-componentpath-telemetry·post·responses·204", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·1e3668l·digitaltwins-id-components-componentpath-telemetry·post·responses·204" + ] + } + }, + "isNullable": true + } + }, + "defaultResponse": { + "body": { + "$ref": "76" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·nb5yoh·digitaltwins-id-components-componentpath-telemetry·post·responses·default", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·nb5yoh·digitaltwins-id-components-componentpath-telemetry·post·responses·default" + ] + } + }, + "isNullable": true + }, + "returnType": { + "isNullable": true + }, + "description": "Sends telemetry on behalf of a component in a digital twin.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.\n404 (Not Found): There is either no digital twin with the provided id or the component path is invalid.", + "requestContentType": "application/json; charset=utf-8", + "responseContentTypes": [ + "application/json" + ], + "extensions": { + "servers": [ + { + "url": "https://digitaltwins-name.digitaltwins.azure.net/" + } + ], + "x-ms-requestBody-index": "2", + "x-ms-examples": { + "SendTelemetry": { + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myTwinId", + "componentPath": "myComponent", + "dt-id": "e5ca50dd-ca31-4fae-8d84-3af5a72b10c5", + "dt-timestamp": "1985-04-12T23:20:50.52Z", + "telemetry": { + "temperature": "1" + } + }, + "responses": { + "204": {} + } + } + } + }, + "deprecated": false, + "hidden": false + }, + { + "parameters": [ + { + "$id": "274", + "clientProperty": { + "$ref": "118" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id of the digital twin. The id is unique within the service and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "digitalTwinId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/digitalTwinId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "id" + }, + "serializedName": "id", + "modelType": { + "$id": "275", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "276", + "clientProperty": { + "$ref": "128" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The name of the DTDL component." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "componentPath", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/componentPath" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "componentPath" + }, + "serializedName": "componentPath", + "modelType": { + "$id": "277", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "278", + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The API version to use for the request." + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "279", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "name": { + "fixed": false, + "raw": "GetComponent" + }, + "group": { + "fixed": false, + "raw": "DigitalTwins" + }, + "serializedName": "DigitalTwins_GetComponent", + "url": "/digitaltwins/{id}/components/{componentPath}", + "isAbsoluteUrl": false, + "httpMethod": "get", + "responses": { + "OK": { + "body": { + "$id": "280", + "$type": "PrimaryType", + "knownPrimaryType": "object", + "name": { + "fixed": false, + "raw": "Object" + } + }, + "headers": { + "$ref": "99" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·11ra5gt·digitaltwins-id-components-componentpath·get·responses·200", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·11ra5gt·digitaltwins-id-components-componentpath·get·responses·200" + ] + } + }, + "isNullable": true + } + }, + "defaultResponse": { + "body": { + "$ref": "76" + }, + "headers": { + "$ref": "99" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·95sx01·digitaltwins-id-components-componentpath·get·responses·default", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·95sx01·digitaltwins-id-components-componentpath·get·responses·default" + ] + } + }, + "isNullable": true + }, + "returnType": { + "body": { + "$ref": "280" + }, + "headers": { + "$ref": "99" + }, + "isNullable": true + }, + "description": "Retrieves a component from a digital twin.\nStatus codes:\n200 (OK): Success.\n404 (Not Found): There is either no digital twin with the provided id or the component path is invalid.", + "requestContentType": "application/json; charset=utf-8", + "responseContentTypes": [ + "application/json" + ], + "extensions": { + "servers": [ + { + "url": "https://digitaltwins-name.digitaltwins.azure.net/" + } + ], + "x-ms-examples": { + "GetComponent": { + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myTwinId", + "componentPath": "myComponent" + }, + "responses": { + "200": { + "body": { + "$metadata": { + "$model": "dtmi:com:example:interfaces:interfaceName;1", + "property1": { + "desiredValue": "1", + "desiredVersion": "1", + "ackVersion": "1", + "ackCode": "200", + "ackDescription": "description", + "lastUpdateTime": "2020-05-23T21:44:02Z" + }, + "property2": { + "desiredValue": { + "subProperty1": "some value", + "subProperty2": "some other value" + }, + "desiredVersion": "1", + "ackVersion": "1", + "ackCode": "200", + "ackDescription": "description", + "lastUpdateTime": "2020-05-23T21:44:02Z" + } + }, + "property1": "1", + "property2": { + "subProperty1": "some value", + "subProperty2": "some other value" + }, + "component1": { + "$metadata": { + "$model": "dtmi:com:example:interfaces:subInterfaceName;1", + "componentProperty": { + "desiredValue": "some value", + "desiredVersion": "1", + "ackVersion": "1", + "ackCode": "200", + "ackDescription": "description", + "lastUpdateTime": "2020-05-23T21:44:02Z" + } + } + } + } + } + } + } + } + }, + "deprecated": false, + "hidden": false + }, + { + "parameters": [ + { + "$id": "281", + "clientProperty": { + "$ref": "118" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id of the digital twin. The id is unique within the service and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "digitalTwinId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/digitalTwinId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "id" + }, + "serializedName": "id", + "modelType": { + "$id": "282", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "283", + "clientProperty": { + "$ref": "128" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The name of the DTDL component." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "componentPath", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/componentPath" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "componentPath" + }, + "serializedName": "componentPath", + "modelType": { + "$id": "284", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "285", + "location": "body", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "An update specification described by JSON Patch. Updates to property values and $model elements may happen in the same request. Operations are limited to add, replace and remove." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1gjuvfa·digitaltwins-id-components-componentpath·patch·requestbody", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/requestBodies/paths·1gjuvfa·digitaltwins-id-components-componentpath·patch·requestbody" + ] + }, + "x-ms-requestBody-name": "patchDocument" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "patchDocument" + }, + "serializedName": "patchDocument", + "modelType": { + "$id": "286", + "$type": "SequenceType", + "elementType": { + "$id": "287", + "$type": "PrimaryType", + "knownPrimaryType": "object", + "name": { + "fixed": false, + "raw": "Object" + } + }, + "name": { + "fixed": false + } + } + }, + { + "$id": "288", + "clientProperty": { + "$ref": "137" + }, + "location": "header", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "Only perform the operation if the entity's etag matches one of the etags provided or * is provided." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "if-match", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/if-match" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "If-Match" + }, + "serializedName": "If-Match", + "modelType": { + "$id": "289", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "290", + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The API version to use for the request." + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "291", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "name": { + "fixed": false, + "raw": "UpdateComponent" + }, + "group": { + "fixed": false, + "raw": "DigitalTwins" + }, + "serializedName": "DigitalTwins_UpdateComponent", + "url": "/digitaltwins/{id}/components/{componentPath}", + "isAbsoluteUrl": false, + "httpMethod": "patch", + "responses": { + "Accepted": { + "headers": { + "$ref": "102" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·e2beq7·digitaltwins-id-components-componentpath·patch·responses·202", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·e2beq7·digitaltwins-id-components-componentpath·patch·responses·202" + ] + } + }, + "isNullable": true + }, + "NoContent": { + "headers": { + "$ref": "102" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·iil9j2·digitaltwins-id-components-componentpath·patch·responses·204", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·iil9j2·digitaltwins-id-components-componentpath·patch·responses·204" + ] + } + }, + "isNullable": true + } + }, + "defaultResponse": { + "body": { + "$ref": "76" + }, + "headers": { + "$ref": "102" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1gn2bx5·digitaltwins-id-components-componentpath·patch·responses·default", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·1gn2bx5·digitaltwins-id-components-componentpath·patch·responses·default" + ] + } + }, + "isNullable": true + }, + "returnType": { + "headers": { + "$ref": "102" + }, + "isNullable": true + }, + "description": "Updates a component on a digital twin.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.\n404 (Not Found): There is either no digital twin with the provided id or the component path is invalid.", + "requestContentType": "application/json-patch+json; charset=utf-8", + "responseContentTypes": [ + "application/json" + ], + "extensions": { + "servers": [ + { + "url": "https://digitaltwins-name.digitaltwins.azure.net/" + } + ], + "x-ms-requestBody-index": "2", + "x-ms-examples": { + "PatchComponentBasicExample": { + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myTwinId", + "componentPath": "myComponent", + "patchDocument": [ + { + "op": "add", + "path": "/property", + "value": "1" + } + ] + }, + "responses": { + "202": {}, + "204": {} + } + }, + "PatchComponentAdvancedExample": { + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myTwinId", + "componentPath": "myComponent", + "patchDocument": [ + { + "op": "add", + "path": "/property1", + "value": "1" + }, + { + "op": "remove", + "path": "/property2" + }, + { + "op": "replace", + "path": "/property3/subProperty1", + "value": "new value" + } + ] + }, + "responses": { + "202": {}, + "204": {} + } + } + } + }, + "deprecated": false, + "hidden": false + } + ], + "name": { + "fixed": false, + "raw": "DigitalTwins" + }, + "typeName": { + "fixed": false + }, + "nameForProperty": "DigitalTwins" + }, + { + "methods": [ + { + "parameters": [ + { + "$id": "292", + "clientProperty": { + "$ref": "132" + }, + "location": "header", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "-1" + }, + "documentation": { + "fixed": false, + "raw": "The maximum number of items to retrieve per request. The server may choose to return less than the requested max." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "max-item-count", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/max-item-count" + ] + }, + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "postfix": "Options" + }, + "x-ms-client-name": "MaxItemCount" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "x-ms-max-item-count" + }, + "serializedName": "x-ms-max-item-count", + "modelType": { + "$id": "293", + "$type": "PrimaryType", + "knownPrimaryType": "int", + "name": { + "fixed": false, + "raw": "Int" + } + } + }, + { + "$id": "294", + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The API version to use for the request." + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "295", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "name": { + "fixed": false, + "raw": "List" + }, + "group": { + "fixed": false, + "raw": "EventRoutes" + }, + "serializedName": "EventRoutes_List", + "url": "/eventroutes", + "isAbsoluteUrl": false, + "httpMethod": "get", + "responses": { + "OK": { + "body": { + "$ref": "8" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1ewaisi·eventroutes·get·responses·200", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·1ewaisi·eventroutes·get·responses·200" + ] + } + }, + "isNullable": true + } + }, + "defaultResponse": { + "body": { + "$ref": "76" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1idkyiz·eventroutes·get·responses·default", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·1idkyiz·eventroutes·get·responses·default" + ] + } + }, + "isNullable": true + }, + "returnType": { + "body": { + "$ref": "8" + }, + "isNullable": true + }, + "description": "Retrieves all event routes.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.", + "requestContentType": "application/json; charset=utf-8", + "responseContentTypes": [ + "application/json" + ], + "extensions": { + "servers": [ + { + "url": "https://digitaltwins-name.digitaltwins.azure.net/" + } + ], + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "EventRoutesList": { + "parameters": { + "api-version": "2020-05-31-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "eventroute-001", + "endpointName": "endpoint-001", + "filter": "type = 'Microsoft.DigitalTwins.Twin.Create'" + }, + { + "id": "eventroute-002", + "endpointName": "endpoint-002", + "filter": "type = 'Microsoft.DigitalTwins.Twin.Create' OR type = 'microsoft.iot.telemetry'" + } + ], + "nextLink": "url-to-next-page" + } + } + } + } + } + }, + "deprecated": false, + "hidden": false + }, + { + "parameters": [ + { + "$id": "296", + "clientProperty": { + "$ref": "118" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id for an event route. The id is unique within event routes and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "eventRouteId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/eventRouteId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "id" + }, + "serializedName": "id", + "modelType": { + "$id": "297", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "298", + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The API version to use for the request." + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "299", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "name": { + "fixed": false, + "raw": "GetById" + }, + "group": { + "fixed": false, + "raw": "EventRoutes" + }, + "serializedName": "EventRoutes_GetById", + "url": "/eventroutes/{id}", + "isAbsoluteUrl": false, + "httpMethod": "get", + "responses": { + "OK": { + "body": { + "$ref": "1" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·an0529·eventroutes-id·get·responses·200", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·an0529·eventroutes-id·get·responses·200" + ] + } + }, + "isNullable": true + } + }, + "defaultResponse": { + "body": { + "$ref": "76" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·v9vzci·eventroutes-id·get·responses·default", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·v9vzci·eventroutes-id·get·responses·default" + ] + } + }, + "isNullable": true + }, + "returnType": { + "body": { + "$ref": "1" + }, + "isNullable": true + }, + "description": "Retrieves an event route.\nStatus codes:\n200 (OK): Success.\n404 (Not Found): There is no event route with the provided id.", + "requestContentType": "application/json; charset=utf-8", + "responseContentTypes": [ + "application/json" + ], + "extensions": { + "servers": [ + { + "url": "https://digitaltwins-name.digitaltwins.azure.net/" + } + ], + "x-ms-examples": { + "EventRouteGet": { + "parameters": { + "id": "eventroute-001", + "api-version": "2020-05-31-preview" + }, + "responses": { + "200": { + "body": { + "id": "eventroute-001", + "endpointName": "endpoint-001", + "filter": "type = 'Microsoft.DigitalTwins.Twin.Create'" + } + } + } + } + } + }, + "deprecated": false, + "hidden": false + }, + { + "parameters": [ + { + "$id": "300", + "clientProperty": { + "$ref": "118" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id for an event route. The id is unique within event routes and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "eventRouteId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/eventRouteId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "id" + }, + "serializedName": "id", + "modelType": { + "$id": "301", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "302", + "location": "body", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The event route data" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·nxu995·eventroutes-id·put·requestbody", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/requestBodies/paths·nxu995·eventroutes-id·put·requestbody" + ] + }, + "x-ms-requestBody-name": "eventRoute" + }, + "isRequired": false, + "isConstant": false, + "name": { + "fixed": false, + "raw": "eventRoute" + }, + "serializedName": "eventRoute", + "modelType": { + "$ref": "1" + } + }, + { + "$id": "303", + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The API version to use for the request." + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "304", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "name": { + "fixed": false, + "raw": "Add" + }, + "group": { + "fixed": false, + "raw": "EventRoutes" + }, + "serializedName": "EventRoutes_Add", + "url": "/eventroutes/{id}", + "isAbsoluteUrl": false, + "httpMethod": "put", + "responses": { + "NoContent": { + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1qs2xe·eventroutes-id·put·responses·204", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·1qs2xe·eventroutes-id·put·responses·204" + ] + } + }, + "isNullable": true + } + }, + "defaultResponse": { + "body": { + "$ref": "76" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1sr0x4g·eventroutes-id·put·responses·default", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·1sr0x4g·eventroutes-id·put·responses·default" + ] + } + }, + "isNullable": true + }, + "returnType": { + "isNullable": true + }, + "description": "Adds or replaces an event route.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.", + "requestContentType": "application/json; charset=utf-8", + "responseContentTypes": [ + "application/json" + ], + "extensions": { + "servers": [ + { + "url": "https://digitaltwins-name.digitaltwins.azure.net/" + } + ], + "x-ms-requestBody-index": "1", + "x-ms-examples": { + "EventRoutePut": { + "parameters": { + "id": "eventroute-001", + "eventRoute": { + "endpointName": "endpoint-001", + "filter": "true" + }, + "api-version": "2020-05-31-preview" + }, + "responses": { + "204": {} + } + }, + "EventRouteWithFilter": { + "parameters": { + "id": "eventroute-001", + "eventRoute": { + "endpointName": "endpoint-001", + "filter": "type = 'Microsoft.DigitalTwins.Twin.Create'" + }, + "api-version": "2020-05-31-preview" + }, + "responses": { + "204": {} + } + } + } + }, + "deprecated": false, + "hidden": false + }, + { + "parameters": [ + { + "$id": "305", + "clientProperty": { + "$ref": "118" + }, + "location": "path", + "collectionFormat": "none", + "defaultValue": { + "fixed": false + }, + "documentation": { + "fixed": false, + "raw": "The id for an event route. The id is unique within event routes and case sensitive." + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "eventRouteId", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/parameters/eventRouteId" + ] + }, + "x-ms-parameter-location": "method" + }, + "isRequired": true, + "isConstant": false, + "name": { + "fixed": false, + "raw": "id" + }, + "serializedName": "id", + "modelType": { + "$id": "306", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + }, + { + "$id": "307", + "location": "query", + "collectionFormat": "none", + "defaultValue": { + "fixed": false, + "raw": "2020-05-31-preview" + }, + "documentation": { + "fixed": false, + "raw": "The API version to use for the request." + }, + "isRequired": true, + "isConstant": true, + "name": { + "fixed": false, + "raw": "api-version" + }, + "serializedName": "api-version", + "modelType": { + "$id": "308", + "$type": "PrimaryType", + "knownPrimaryType": "string", + "name": { + "fixed": false, + "raw": "String" + } + } + } + ], + "name": { + "fixed": false, + "raw": "Delete" + }, + "group": { + "fixed": false, + "raw": "EventRoutes" + }, + "serializedName": "EventRoutes_Delete", + "url": "/eventroutes/{id}", + "isAbsoluteUrl": false, + "httpMethod": "delete", + "responses": { + "NoContent": { + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·q9ku4u·eventroutes-id·delete·responses·204", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·q9ku4u·eventroutes-id·delete·responses·204" + ] + } + }, + "isNullable": true + } + }, + "defaultResponse": { + "body": { + "$ref": "76" + }, + "extensions": { + "x-ms-metadata": { + "apiVersions": [ + "2020-05-31-preview" + ], + "filename": [ + "mem:///137?oai3.shaken.json" + ], + "name": "paths·1l4abqx·eventroutes-id·delete·responses·default", + "originalLocations": [ + "file:///C:/Users/azad_/Enlistments/azure-sdk-for-java/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json#/components/responses/paths·1l4abqx·eventroutes-id·delete·responses·default" + ] + } + }, + "isNullable": true + }, + "returnType": { + "isNullable": true + }, + "description": "Deletes an event route.\nStatus codes:\n200 (OK): Success.\n404 (Not Found): There is no event route with the provided id.", + "requestContentType": "application/json; charset=utf-8", + "responseContentTypes": [ + "application/json" + ], + "extensions": { + "servers": [ + { + "url": "https://digitaltwins-name.digitaltwins.azure.net/" + } + ], + "x-ms-examples": { + "EventRouteDelete": { + "parameters": { + "id": "eventroute-001", + "api-version": "2020-05-31-preview" + }, + "responses": { + "204": {} + } + } + } + }, + "deprecated": false, + "hidden": false + } + ], + "name": { + "fixed": false, + "raw": "EventRoutes" + }, + "typeName": { + "fixed": false + }, + "nameForProperty": "EventRoutes" + } + ] +} \ No newline at end of file diff --git a/sdk/digitaltwins/azure-digitaltwins-core/generate.ps1 b/sdk/digitaltwins/azure-digitaltwins-core/generate.ps1 new file mode 100644 index 000000000000..cd52c2216da9 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/generate.ps1 @@ -0,0 +1,2 @@ +npm i -g autorest +autorest autorest.md diff --git a/sdk/digitaltwins/azure-digitaltwins-core/pom.xml b/sdk/digitaltwins/azure-digitaltwins-core/pom.xml new file mode 100644 index 000000000000..2e87a00e2919 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/pom.xml @@ -0,0 +1,42 @@ + + + 4.0.0 + + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure + azure-digitaltwins-core + 1.0.0-beta.1 + + + + com.azure + azure-core + 1.6.0 + + + + com.azure + azure-identity + 1.0.6 + test + + + com.azure + azure-core-http-netty + 1.5.3 + + + com.fasterxml.jackson.core + jackson-annotations + 2.11.1 + + + diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/AzureDigitalTwinsAPI.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/AzureDigitalTwinsAPI.java new file mode 100644 index 000000000000..19e10b8fc43a --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/AzureDigitalTwinsAPI.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core; + +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; + +/** Initializes a new instance of the AzureDigitalTwinsAPI type. */ +public final class AzureDigitalTwinsAPI { + /** server parameter. */ + private final String host; + + /** + * Gets server parameter. + * + * @return the host value. + */ + public String getHost() { + return this.host; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The DigitalTwinModels object to access its operations. */ + private final DigitalTwinModels digitalTwinModels; + + /** + * Gets the DigitalTwinModels object to access its operations. + * + * @return the DigitalTwinModels object. + */ + public DigitalTwinModels getDigitalTwinModels() { + return this.digitalTwinModels; + } + + /** The Querys object to access its operations. */ + private final Querys querys; + + /** + * Gets the Querys object to access its operations. + * + * @return the Querys object. + */ + public Querys getQuerys() { + return this.querys; + } + + /** The DigitalTwins object to access its operations. */ + private final DigitalTwins digitalTwins; + + /** + * Gets the DigitalTwins object to access its operations. + * + * @return the DigitalTwins object. + */ + public DigitalTwins getDigitalTwins() { + return this.digitalTwins; + } + + /** The EventRoutes object to access its operations. */ + private final EventRoutes eventRoutes; + + /** + * Gets the EventRoutes object to access its operations. + * + * @return the EventRoutes object. + */ + public EventRoutes getEventRoutes() { + return this.eventRoutes; + } + + /** Initializes an instance of AzureDigitalTwinsAPI client. */ + AzureDigitalTwinsAPI(String host) { + this( + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(), + host); + } + + /** + * Initializes an instance of AzureDigitalTwinsAPI client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + */ + AzureDigitalTwinsAPI(HttpPipeline httpPipeline, String host) { + this.httpPipeline = httpPipeline; + this.host = host; + this.apiVersion = "2020-05-31-preview"; + this.digitalTwinModels = new DigitalTwinModels(this); + this.querys = new Querys(this); + this.digitalTwins = new DigitalTwins(this); + this.eventRoutes = new EventRoutes(this); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/AzureDigitalTwinsAPIBuilder.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/AzureDigitalTwinsAPIBuilder.java new file mode 100644 index 000000000000..6a5095cdf114 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/AzureDigitalTwinsAPIBuilder.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; + +/** A builder for creating a new instance of the AzureDigitalTwinsAPI type. */ +@ServiceClientBuilder(serviceClients = {AzureDigitalTwinsAPI.class}) +public final class AzureDigitalTwinsAPIBuilder { + /* + * server parameter + */ + private String host; + + /** + * Sets server parameter. + * + * @param host the host value. + * @return the AzureDigitalTwinsAPIBuilder. + */ + public AzureDigitalTwinsAPIBuilder host(String host) { + this.host = host; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the AzureDigitalTwinsAPIBuilder. + */ + public AzureDigitalTwinsAPIBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /** + * Builds an instance of AzureDigitalTwinsAPI with the provided parameters. + * + * @return an instance of AzureDigitalTwinsAPI. + */ + public AzureDigitalTwinsAPI buildClient() { + if (host == null) { + this.host = "https://digitaltwins-name.digitaltwins.azure.net"; + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + AzureDigitalTwinsAPI client = new AzureDigitalTwinsAPI(pipeline, host); + return client; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinModels.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinModels.java new file mode 100644 index 000000000000..5817ebf366da --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinModels.java @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.CollectionFormat; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.digitaltwins.core.models.DigitalTwinModelsListOptions; +import com.azure.digitaltwins.core.models.ErrorResponseException; +import com.azure.digitaltwins.core.models.ModelData; +import com.azure.digitaltwins.core.models.PagedModelDataCollection; +import java.util.List; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DigitalTwinModels. */ +public final class DigitalTwinModels { + /** The proxy service used to perform REST calls. */ + private final DigitalTwinModelsService service; + + /** The service client containing this operation class. */ + private final AzureDigitalTwinsAPI client; + + /** + * Initializes an instance of DigitalTwinModels. + * + * @param client the instance of the service client containing this operation class. + */ + DigitalTwinModels(AzureDigitalTwinsAPI client) { + this.service = RestProxy.create(DigitalTwinModelsService.class, client.getHttpPipeline()); + this.client = client; + } + + /** + * The interface defining all the services for AzureDigitalTwinsAPIDigitalTwinModels to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureDigitalTwinsAPI") + private interface DigitalTwinModelsService { + @Post("/models") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono>> add( + @HostParam("$host") String host, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") List models, + Context context); + + @Get("/models") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> list( + @HostParam("$host") String host, + @QueryParam("dependenciesFor") String dependenciesFor, + @QueryParam("includeModelDefinition") Boolean includeModelDefinition, + @HeaderParam("x-ms-max-item-count") Integer maxItemCount, + @QueryParam("api-version") String apiVersion, + Context context); + + @Get("/models/{id}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> getById( + @HostParam("$host") String host, + @PathParam("id") String id, + @QueryParam("includeModelDefinition") Boolean includeModelDefinition, + @QueryParam("api-version") String apiVersion, + Context context); + + @Patch("/models/{id}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> update( + @HostParam("$host") String host, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json-patch+json") List updateModel, + Context context); + + @Delete("/models/{id}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> delete( + @HostParam("$host") String host, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + } + + /** + * Uploads one or more models. When any error occurs, no models are uploaded. Status codes: 200 (OK): Success. 400 + * (Bad Request): The request is invalid. 409 (Conflict): One or more of the provided models already exist. + * + * @param models Array of any. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of ModelData objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> addWithResponseAsync(List models) { + return FluxUtil.withContext( + context -> service.add(this.client.getHost(), this.client.getApiVersion(), models, context)); + } + + /** + * Retrieves model metadata and, optionally, model definitions. Status codes: 200 (OK): Success. 400 (Bad Request): + * The request is invalid. + * + * @param dependenciesFor Array of Get0ItemsItem. + * @param includeModelDefinition When true the model definition will be returned as part of the result. + * @param digitalTwinModelsListOptions Parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of ModelData objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync( + List dependenciesFor, + Boolean includeModelDefinition, + DigitalTwinModelsListOptions digitalTwinModelsListOptions) { + Integer maxItemCountInternal = null; + if (digitalTwinModelsListOptions != null) { + maxItemCountInternal = digitalTwinModelsListOptions.getMaxItemCount(); + } + Integer maxItemCount = maxItemCountInternal; + String dependenciesForConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(dependenciesFor, CollectionFormat.CSV); + return FluxUtil.withContext( + context -> + service.list( + this.client.getHost(), + dependenciesForConverted, + includeModelDefinition, + maxItemCount, + this.client.getApiVersion(), + context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().getValue(), + res.getValue().getNextLink(), + null)); + } + + /** + * Retrieves model metadata and optionally the model definition. Status codes: 200 (OK): Success. 404 (Not Found): + * There is no model with the provided id. + * + * @param id The id for the model. The id is globally unique and case sensitive. + * @param includeModelDefinition When true the model definition will be returned as part of the result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a model definition and metadata for that model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByIdWithResponseAsync(String id, Boolean includeModelDefinition) { + return FluxUtil.withContext( + context -> + service.getById( + this.client.getHost(), + id, + includeModelDefinition, + this.client.getApiVersion(), + context)); + } + + /** + * Updates the metadata for a model. Status codes: 200 (OK): Success. 400 (Bad Request): The request is invalid. 404 + * (Not Found): There is no model with the provided id. + * + * @param id The id for the model. The id is globally unique and case sensitive. + * @param updateModel Array of any. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateWithResponseAsync(String id, List updateModel) { + return FluxUtil.withContext( + context -> + service.update(this.client.getHost(), id, this.client.getApiVersion(), updateModel, context)); + } + + /** + * Deletes a model. A model can only be deleted if no other models reference it. Status codes: 204 (No Content): + * Success. 400 (Bad Request): The request is invalid. 404 (Not Found): There is no model with the provided id. 409 + * (Conflict): There are dependencies on the model that prevent it from being deleted. + * + * @param id The id for the model. The id is globally unique and case sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync(String id) { + return FluxUtil.withContext( + context -> service.delete(this.client.getHost(), id, this.client.getApiVersion(), context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of ModelData objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink) { + return FluxUtil.withContext(context -> service.listNext(nextLink, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().getValue(), + res.getValue().getNextLink(), + null)); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwins.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwins.java new file mode 100644 index 000000000000..9cb2f22a96b7 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwins.java @@ -0,0 +1,635 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.digitaltwins.core.models.DigitalTwinsAddRelationshipResponse; +import com.azure.digitaltwins.core.models.DigitalTwinsAddResponse; +import com.azure.digitaltwins.core.models.DigitalTwinsGetByIdResponse; +import com.azure.digitaltwins.core.models.DigitalTwinsGetComponentResponse; +import com.azure.digitaltwins.core.models.DigitalTwinsGetRelationshipByIdResponse; +import com.azure.digitaltwins.core.models.DigitalTwinsUpdateComponentResponse; +import com.azure.digitaltwins.core.models.DigitalTwinsUpdateRelationshipResponse; +import com.azure.digitaltwins.core.models.DigitalTwinsUpdateResponse; +import com.azure.digitaltwins.core.models.ErrorResponseException; +import com.azure.digitaltwins.core.models.IncomingRelationship; +import com.azure.digitaltwins.core.models.IncomingRelationshipCollection; +import com.azure.digitaltwins.core.models.RelationshipCollection; +import java.util.List; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DigitalTwins. */ +public final class DigitalTwins { + /** The proxy service used to perform REST calls. */ + private final DigitalTwinsService service; + + /** The service client containing this operation class. */ + private final AzureDigitalTwinsAPI client; + + /** + * Initializes an instance of DigitalTwins. + * + * @param client the instance of the service client containing this operation class. + */ + DigitalTwins(AzureDigitalTwinsAPI client) { + this.service = RestProxy.create(DigitalTwinsService.class, client.getHttpPipeline()); + this.client = client; + } + + /** + * The interface defining all the services for AzureDigitalTwinsAPIDigitalTwins to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureDigitalTwinsAPI") + private interface DigitalTwinsService { + @Get("/digitaltwins/{id}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono getById( + @HostParam("$host") String host, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + Context context); + + @Put("/digitaltwins/{id}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono add( + @HostParam("$host") String host, + @PathParam("id") String id, + @HeaderParam("If-None-Match") String ifNoneMatch, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") Object twin, + Context context); + + @Delete("/digitaltwins/{id}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> delete( + @HostParam("$host") String host, + @PathParam("id") String id, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + Context context); + + @Patch("/digitaltwins/{id}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono update( + @HostParam("$host") String host, + @PathParam("id") String id, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json-patch+json") List patchDocument, + Context context); + + @Get("/digitaltwins/{id}/relationships/{relationshipId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono getRelationshipById( + @HostParam("$host") String host, + @PathParam("id") String id, + @PathParam("relationshipId") String relationshipId, + @QueryParam("api-version") String apiVersion, + Context context); + + @Put("/digitaltwins/{id}/relationships/{relationshipId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono addRelationship( + @HostParam("$host") String host, + @PathParam("id") String id, + @PathParam("relationshipId") String relationshipId, + @HeaderParam("If-None-Match") String ifNoneMatch, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") Object relationship, + Context context); + + @Delete("/digitaltwins/{id}/relationships/{relationshipId}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> deleteRelationship( + @HostParam("$host") String host, + @PathParam("id") String id, + @PathParam("relationshipId") String relationshipId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + Context context); + + @Patch("/digitaltwins/{id}/relationships/{relationshipId}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono updateRelationship( + @HostParam("$host") String host, + @PathParam("id") String id, + @PathParam("relationshipId") String relationshipId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json-patch+json") List patchDocument, + Context context); + + @Get("/digitaltwins/{id}/relationships") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> listRelationships( + @HostParam("$host") String host, + @PathParam("id") String id, + @QueryParam("relationshipName") String relationshipName, + @QueryParam("api-version") String apiVersion, + Context context); + + @Get("/digitaltwins/{id}/incomingrelationships") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> listIncomingRelationships( + @HostParam("$host") String host, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + Context context); + + @Post("/digitaltwins/{id}/telemetry") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> sendTelemetry( + @HostParam("$host") String host, + @PathParam("id") String id, + @HeaderParam("dt-id") String dtId, + @HeaderParam("dt-timestamp") String dtTimestamp, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") Object telemetry, + Context context); + + @Post("/digitaltwins/{id}/components/{componentPath}/telemetry") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> sendComponentTelemetry( + @HostParam("$host") String host, + @PathParam("id") String id, + @PathParam("componentPath") String componentPath, + @HeaderParam("dt-id") String dtId, + @HeaderParam("dt-timestamp") String dtTimestamp, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") Object telemetry, + Context context); + + @Get("/digitaltwins/{id}/components/{componentPath}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono getComponent( + @HostParam("$host") String host, + @PathParam("id") String id, + @PathParam("componentPath") String componentPath, + @QueryParam("api-version") String apiVersion, + Context context); + + @Patch("/digitaltwins/{id}/components/{componentPath}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono updateComponent( + @HostParam("$host") String host, + @PathParam("id") String id, + @PathParam("componentPath") String componentPath, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json-patch+json") List patchDocument, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> listRelationshipsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> listIncomingRelationshipsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + } + + /** + * Retrieves a digital twin. Status codes: 200 (OK): Success. 404 (Not Found): There is no digital twin with the + * provided id. + * + * @param id The id of the digital twin. The id is unique within the service and case sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByIdWithResponseAsync(String id) { + return FluxUtil.withContext( + context -> service.getById(this.client.getHost(), id, this.client.getApiVersion(), context)); + } + + /** + * Adds or replaces a digital twin. Status codes: 200 (OK): Success. 400 (Bad Request): The request is invalid. 412 + * (Precondition Failed): The model is decommissioned or the digital twin already exists (when using If-None-Match: + * *). + * + * @param id The id of the digital twin. The id is unique within the service and case sensitive. + * @param twin Any object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono addWithResponseAsync(String id, Object twin) { + final String ifNoneMatch = "*"; + return FluxUtil.withContext( + context -> + service.add( + this.client.getHost(), id, ifNoneMatch, this.client.getApiVersion(), twin, context)); + } + + /** + * Deletes a digital twin. All relationships referencing the digital twin must already be deleted. Status codes: 200 + * (OK): Success. 400 (Bad Request): The request is invalid. 404 (Not Found): There is no digital twin with the + * provided id. + * + * @param id The id of the digital twin. The id is unique within the service and case sensitive. + * @param ifMatch Only perform the operation if the entity's etag matches one of the etags provided or * is + * provided. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync(String id, String ifMatch) { + return FluxUtil.withContext( + context -> service.delete(this.client.getHost(), id, ifMatch, this.client.getApiVersion(), context)); + } + + /** + * Updates a digital twin. Status codes: 200 (OK): Success. 400 (Bad Request): The request is invalid. 404 (Not + * Found): There is no digital twin with the provided id. + * + * @param id The id of the digital twin. The id is unique within the service and case sensitive. + * @param patchDocument Array of any. + * @param ifMatch Only perform the operation if the entity's etag matches one of the etags provided or * is + * provided. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateWithResponseAsync( + String id, List patchDocument, String ifMatch) { + return FluxUtil.withContext( + context -> + service.update( + this.client.getHost(), + id, + ifMatch, + this.client.getApiVersion(), + patchDocument, + context)); + } + + /** + * Retrieves a relationship between two digital twins. Status codes: 200 (OK): Success. 404 (Not Found): There is + * either no digital twin or relationship with the provided id. + * + * @param id The id of the digital twin. The id is unique within the service and case sensitive. + * @param relationshipId The id of the relationship. The id is unique within the digital twin and case sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getRelationshipByIdWithResponseAsync( + String id, String relationshipId) { + return FluxUtil.withContext( + context -> + service.getRelationshipById( + this.client.getHost(), id, relationshipId, this.client.getApiVersion(), context)); + } + + /** + * Adds a relationship between two digital twins. Status codes: 200 (OK): Success. 400 (Bad Request): The request is + * invalid. 404 (Not Found): There is either no digital twin, target digital twin, or relationship with the provided + * id. 409 (Conflict): A relationship with the provided id already exists. + * + * @param id The id of the digital twin. The id is unique within the service and case sensitive. + * @param relationshipId The id of the relationship. The id is unique within the digital twin and case sensitive. + * @param relationship Any object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono addRelationshipWithResponseAsync( + String id, String relationshipId, Object relationship) { + final String ifNoneMatch = "*"; + return FluxUtil.withContext( + context -> + service.addRelationship( + this.client.getHost(), + id, + relationshipId, + ifNoneMatch, + this.client.getApiVersion(), + relationship, + context)); + } + + /** + * Deletes a relationship between two digital twins. Status codes: 200 (OK): Success. 404 (Not Found): There is + * either no digital twin or relationship with the provided id. + * + * @param id The id of the digital twin. The id is unique within the service and case sensitive. + * @param relationshipId The id of the relationship. The id is unique within the digital twin and case sensitive. + * @param ifMatch Only perform the operation if the entity's etag matches one of the etags provided or * is + * provided. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteRelationshipWithResponseAsync(String id, String relationshipId, String ifMatch) { + return FluxUtil.withContext( + context -> + service.deleteRelationship( + this.client.getHost(), + id, + relationshipId, + ifMatch, + this.client.getApiVersion(), + context)); + } + + /** + * Updates the properties on a relationship between two digital twins. Status codes: 200 (OK): Success. 400 (Bad + * Request): The request is invalid. 404 (Not Found): There is either no digital twin or relationship with the + * provided id. + * + * @param id The id of the digital twin. The id is unique within the service and case sensitive. + * @param relationshipId The id of the relationship. The id is unique within the digital twin and case sensitive. + * @param ifMatch Only perform the operation if the entity's etag matches one of the etags provided or * is + * provided. + * @param patchDocument Array of any. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateRelationshipWithResponseAsync( + String id, String relationshipId, String ifMatch, List patchDocument) { + return FluxUtil.withContext( + context -> + service.updateRelationship( + this.client.getHost(), + id, + relationshipId, + ifMatch, + this.client.getApiVersion(), + patchDocument, + context)); + } + + /** + * Retrieves the relationships from a digital twin. Status codes: 200 (OK): Success. 400 (Bad Request): The request + * is invalid. 404 (Not Found): There is no digital twin with the provided id. + * + * @param id The id of the digital twin. The id is unique within the service and case sensitive. + * @param relationshipName The name of the relationship. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of relationships which relate digital twins together. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listRelationshipsSinglePageAsync(String id, String relationshipName) { + return FluxUtil.withContext( + context -> + service.listRelationships( + this.client.getHost(), + id, + relationshipName, + this.client.getApiVersion(), + context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().getValue(), + res.getValue().getNextLink(), + null)); + } + + /** + * Retrieves all incoming relationship for a digital twin. Status codes: 200 (OK): Success. 400 (Bad Request): The + * request is invalid. 404 (Not Found): There is no digital twin with the provided id. + * + * @param id The id of the digital twin. The id is unique within the service and case sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of incoming relationships which relate digital twins together. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listIncomingRelationshipsSinglePageAsync(String id) { + return FluxUtil.withContext( + context -> + service.listIncomingRelationships( + this.client.getHost(), id, this.client.getApiVersion(), context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().getValue(), + res.getValue().getNextLink(), + null)); + } + + /** + * Sends telemetry on behalf of a digital twin. Status codes: 200 (OK): Success. 400 (Bad Request): The request is + * invalid. 404 (Not Found): There is no digital twin with the provided id. + * + * @param id The id of the digital twin. The id is unique within the service and case sensitive. + * @param dtId A unique message identifier (in the scope of the digital twin id) that is commonly used for + * de-duplicating messages. + * @param telemetry Any object. + * @param dtTimestamp An RFC 3339 timestamp that identifies the time the telemetry was measured. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> sendTelemetryWithResponseAsync( + String id, String dtId, Object telemetry, String dtTimestamp) { + return FluxUtil.withContext( + context -> + service.sendTelemetry( + this.client.getHost(), + id, + dtId, + dtTimestamp, + this.client.getApiVersion(), + telemetry, + context)); + } + + /** + * Sends telemetry on behalf of a component in a digital twin. Status codes: 200 (OK): Success. 400 (Bad Request): + * The request is invalid. 404 (Not Found): There is either no digital twin with the provided id or the component + * path is invalid. + * + * @param id The id of the digital twin. The id is unique within the service and case sensitive. + * @param componentPath The name of the DTDL component. + * @param dtId A unique message identifier (in the scope of the digital twin id) that is commonly used for + * de-duplicating messages. + * @param telemetry Any object. + * @param dtTimestamp An RFC 3339 timestamp that identifies the time the telemetry was measured. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> sendComponentTelemetryWithResponseAsync( + String id, String componentPath, String dtId, Object telemetry, String dtTimestamp) { + return FluxUtil.withContext( + context -> + service.sendComponentTelemetry( + this.client.getHost(), + id, + componentPath, + dtId, + dtTimestamp, + this.client.getApiVersion(), + telemetry, + context)); + } + + /** + * Retrieves a component from a digital twin. Status codes: 200 (OK): Success. 404 (Not Found): There is either no + * digital twin with the provided id or the component path is invalid. + * + * @param id The id of the digital twin. The id is unique within the service and case sensitive. + * @param componentPath The name of the DTDL component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getComponentWithResponseAsync(String id, String componentPath) { + return FluxUtil.withContext( + context -> + service.getComponent( + this.client.getHost(), id, componentPath, this.client.getApiVersion(), context)); + } + + /** + * Updates a component on a digital twin. Status codes: 200 (OK): Success. 400 (Bad Request): The request is + * invalid. 404 (Not Found): There is either no digital twin with the provided id or the component path is invalid. + * + * @param id The id of the digital twin. The id is unique within the service and case sensitive. + * @param componentPath The name of the DTDL component. + * @param ifMatch Only perform the operation if the entity's etag matches one of the etags provided or * is + * provided. + * @param patchDocument Array of any. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateComponentWithResponseAsync( + String id, String componentPath, String ifMatch, List patchDocument) { + return FluxUtil.withContext( + context -> + service.updateComponent( + this.client.getHost(), + id, + componentPath, + ifMatch, + this.client.getApiVersion(), + patchDocument, + context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of relationships which relate digital twins together. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listRelationshipsNextSinglePageAsync(String nextLink) { + return FluxUtil.withContext(context -> service.listRelationshipsNext(nextLink, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().getValue(), + res.getValue().getNextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of incoming relationships which relate digital twins together. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listIncomingRelationshipsNextSinglePageAsync(String nextLink) { + return FluxUtil.withContext(context -> service.listIncomingRelationshipsNext(nextLink, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().getValue(), + res.getValue().getNextLink(), + null)); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinsAsyncClient.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinsAsyncClient.java new file mode 100644 index 000000000000..9d4003b820d7 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinsAsyncClient.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.digitaltwins.core; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpPipeline; +import com.azure.digitaltwins.core.models.DigitalTwinsGetByIdResponse; +import reactor.core.publisher.Mono; + + +/** + * This class provides a client for interacting asynchronously with an Azure Digital Twins instance. + * + *

+ * This client is instantiated through {@link DigitalTwinsClientBuilder}. + *

+ * + *

+ * This client allows for management of digital twins, their components, and their relationships. It also allows for managing + * the digital twin models and event routes tied to your Azure Digital Twins instance. + *

+ */ +@ServiceClient(builder = DigitalTwinsClientBuilder.class) +public class DigitalTwinsAsyncClient { + protected final DigitalTwinsServiceVersion serviceVersion; + + protected final AzureDigitalTwinsAPI protocolLayer; + + DigitalTwinsAsyncClient(HttpPipeline pipeline, DigitalTwinsServiceVersion serviceVersion, String host) { + this.protocolLayer = new AzureDigitalTwinsAPIBuilder().host(host).pipeline(pipeline).buildClient(); + this.serviceVersion = serviceVersion; + } + + /** + * Gets the Azure Digital Twins service API version that this client is configured to use for all service requests. + * Unless configured while building this client through {@link DigitalTwinsClientBuilder#serviceVersion(DigitalTwinsServiceVersion)}, + * this value will be equal to the latest service API version supported by this client. + * + * @return The Azure Digital Twins service API version. + */ + public DigitalTwinsServiceVersion getServiceVersion() { + return this.serviceVersion; + } + + /** + * Gets the {@link HttpPipeline} that this client is configured to use for all service requests. This pipeline can + * be customized while building this client through {@link DigitalTwinsClientBuilder#httpPipeline(HttpPipeline)}. + * + * @return The {@link HttpPipeline} that this client uses for all service requests. + */ + public HttpPipeline getHttpPipeline() { + return this.protocolLayer.getHttpPipeline(); + } + + // TODO This is just a temporary implementation for sample purposes. This should be spruced up/replaced once this API is actually designed + public Mono getDigitalTwin(String digitalTwinId) { + //TODO the java track 2 guidelines say that this type of API should return Response, but the generated code doesn't expose this. Need to talk to autorest + // team if this is intentional or not. DigitalTwinsGetByIdResponse type is basically Response since it has all the http request/response details. + return this.protocolLayer.getDigitalTwins().getByIdWithResponseAsync(digitalTwinId); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinsClient.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinsClient.java new file mode 100644 index 000000000000..d59939291c87 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinsClient.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.digitaltwins.core; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.HttpPipeline; +import com.azure.digitaltwins.core.models.DigitalTwinsGetByIdResponse; + +/** + * This class provides a client for interacting synchronously with an Azure Digital Twins instance. + * + *

+ * This client is instantiated through {@link DigitalTwinsClientBuilder}. + *

+ * + *

+ * This client allows for management of digital twins, their components, and their relationships. It also allows for managing + * the digital twin models and event routes tied to your Azure Digital Twins instance. + *

+ */ +@ServiceClient(builder = DigitalTwinsClientBuilder.class) +public final class DigitalTwinsClient { + private final DigitalTwinsAsyncClient digitalTwinsAsyncClient; + + DigitalTwinsClient(DigitalTwinsAsyncClient digitalTwinsAsyncClient) { + this.digitalTwinsAsyncClient = digitalTwinsAsyncClient; + } + + /** + * Gets the {@link HttpPipeline} that this client is configured to use for all service requests. This pipeline can + * be customized while building this client through {@link DigitalTwinsClientBuilder#httpPipeline(HttpPipeline)}. + * + * @return The {@link HttpPipeline} that this client uses for all service requests. + */ + public HttpPipeline getHttpPipeline() { + return digitalTwinsAsyncClient.getHttpPipeline(); + } + + /** + * Gets the Azure Digital Twins service API version that this client is configured to use for all service requests. + * Unless configured while building this client through {@link DigitalTwinsClientBuilder#serviceVersion(DigitalTwinsServiceVersion)}, + * this value will be equal to the latest service API version supported by this client. + * + * @return The Azure Digital Twins service API version. + */ + public DigitalTwinsServiceVersion getServiceVersion() { + return this.digitalTwinsAsyncClient.getServiceVersion(); + } + + // this annotation lets users know this method makes a call to the service and whether it returns a single resource or a collection of resources + @ServiceMethod(returns = ReturnType.SINGLE) + // TODO This is just a temporary implementation for test purposes. This should be spruced up/replaced once this API is actually designed + public DigitalTwinsGetByIdResponse getDigitalTwin(String digitalTwinId) { + // Blocking calls to the async client is the established pattern in track 2 Java SDKs + return this.digitalTwinsAsyncClient.getDigitalTwin(digitalTwinId).block(); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinsClientBuilder.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinsClientBuilder.java new file mode 100644 index 000000000000..1883797cb1f3 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinsClientBuilder.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.digitaltwins.core; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * This class provides a fluent builder API to help aid the configuration and instantiation of {@link DigitalTwinsClient + * DigitalTwinsClients} and {@link DigitalTwinsAsyncClient DigitalTwinsAsyncClients}, call {@link #buildClient() buildClient} and {@link + * #buildAsyncClient() buildAsyncClient} respectively to construct an instance of the desired client. + */ +@ServiceClientBuilder(serviceClients = {DigitalTwinsClient.class, DigitalTwinsAsyncClient.class}) +public final class DigitalTwinsClientBuilder { + + private static final String[] adtPublicScope = new String[]{"https://digitaltwins.azure.net" + "/.default"}; + + private final List additionalPolicies = new ArrayList<>(); + // mandatory + private String endpoint; + private TokenCredential tokenCredential; + // optional/have default values + private DigitalTwinsServiceVersion serviceVersion; + private HttpPipeline httpPipeline; + private HttpClient httpClient; + private HttpLogOptions logOptions; + private RetryPolicy retryPolicy; + + private static HttpPipeline buildPipeline(TokenCredential tokenCredential, String endpoint, + HttpLogOptions logOptions, HttpClient httpClient, + List additionalPolicies, RetryPolicy retryPolicy) { + // Closest to API goes first, closest to wire goes last. + List policies = new ArrayList<>(); + + // Adds a "x-ms-client-request-id" header to each request. This header is useful for tracing requests through Azure ecosystems + policies.add(new RequestIdPolicy()); + + // Only the RequestIdPolicy will take effect prior to the retry policy + HttpPolicyProviders.addBeforeRetryPolicies(policies); + + policies.add(retryPolicy); + + // Adds a date header to each HTTP request for tracking purposes + policies.add(new AddDatePolicy()); + + // Add authentication policy so that each HTTP request has authorization header + HttpPipelinePolicy credentialPolicy = new BearerTokenAuthenticationPolicy(tokenCredential, getAuthorizationScopes(endpoint)); + policies.add(credentialPolicy); + + policies.addAll(additionalPolicies); + + // Custom policies, authentication policy, and add date policy all take place after the retry policy + HttpPolicyProviders.addAfterRetryPolicies(policies); + + policies.add(new HttpLoggingPolicy(logOptions)); + + return new HttpPipelineBuilder() + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .build(); + } + + private static String[] getAuthorizationScopes(String endpoint) { + // If the endpoint is in Azure public cloud, the suffix will have "azure.net" or "ppe.net". + // Once ADT becomes available in other clouds, their corresponding scope has to be matched and set. + if (endpoint.indexOf("azure.net") > 0 + || endpoint.indexOf("ppe.net") > 0) { + return adtPublicScope; + } + + throw new IllegalArgumentException(String.format("Azure digital twins instance endpoint %s is not valid.", endpoint)); + } + + /** + * Create a {@link DigitalTwinsClient} based on the builder settings. + * + * @return the created synchronous DigitalTwinsClient + */ + public DigitalTwinsClient buildClient() { + return new DigitalTwinsClient(buildAsyncClient()); + } + + /** + * Create a {@link DigitalTwinsAsyncClient} based on the builder settings. + * + * @return the created synchronous DigitalTwinsAsyncClient + */ + public DigitalTwinsAsyncClient buildAsyncClient() { + Objects.requireNonNull(tokenCredential, "'tokenCredential' cannot be null."); + Objects.requireNonNull(endpoint, "'endpoint' cannot be null"); + + // Set defaults for these fields if they were not set while building the client + this.serviceVersion = this.serviceVersion != null ? this.serviceVersion : DigitalTwinsServiceVersion.getLatest(); + this.retryPolicy = this.retryPolicy != null ? this.retryPolicy : new RetryPolicy(); // Default is exponential backoff + + if (this.httpPipeline == null) { + this.httpPipeline = buildPipeline( + this.tokenCredential, + this.endpoint, + this.logOptions, + this.httpClient, + this.additionalPolicies, + this.retryPolicy); + } + + return new DigitalTwinsAsyncClient(this.httpPipeline, this.serviceVersion, this.endpoint); + } + + /** + * Set the service endpoint that the built client will communicate with. This field is mandatory to set. + * + * @param endpoint URL of the service. + * @return the updated DigitalTwinsClientBuilder instance for fluent building. + */ + public DigitalTwinsClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Set the authentication token provider that the built client will use for all service requests. This field is + * mandatory to set unless you set the http pipeline directly and that set pipeline has an authentication policy configured. + * + * @param tokenCredential the authentication token provider. + * @return the updated DigitalTwinsClientBuilder instance for fluent building. + */ + public DigitalTwinsClientBuilder tokenCredential(TokenCredential tokenCredential) { + this.tokenCredential = tokenCredential; + return this; + } + + /** + * Sets the {@link DigitalTwinsServiceVersion} that is used when making API requests. + *

+ * If a service version is not provided, the service version that will be used will be the latest known service + * version based on the version of the client library being used. If no service version is specified, updating to a + * newer version of the client library will have the result of potentially moving to a newer service version. + *

+ * Targeting a specific service version may also mean that the service will return an error for newer APIs. + * + * @param serviceVersion The service API version to use. + * @return the updated DigitalTwinsClientBuilder instance for fluent building. + */ + public DigitalTwinsClientBuilder serviceVersion(DigitalTwinsServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } + + /** + * Sets the {@link HttpClient} to use for sending a receiving requests to and from the service. + * + * @param httpClient HttpClient to use for requests. + * @return the updated DigitalTwinsClientBuilder instance for fluent building. + */ + public DigitalTwinsClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /** + * Sets the {@link HttpLogOptions} for service requests. + * + * @param logOptions The logging configuration to use when sending and receiving HTTP requests/responses. + * @return the updated DigitalTwinsClientBuilder instance for fluent building. + * @throws NullPointerException If {@code logOptions} is {@code null}. + */ + public DigitalTwinsClientBuilder httpLogOptions(HttpLogOptions logOptions) { + this.logOptions = logOptions; + return this; + } + + /** + * Adds a pipeline policy to apply on each request sent. The policy will be added after the retry policy. If + * the method is called multiple times, all policies will be added and their order preserved. + * + * @param pipelinePolicy a pipeline policy + * @return the updated DigitalTwinsClientBuilder instance for fluent building. + * @throws NullPointerException If {@code pipelinePolicy} is {@code null}. + */ + public DigitalTwinsClientBuilder addPolicy(HttpPipelinePolicy pipelinePolicy) { + this.additionalPolicies.add(Objects.requireNonNull(pipelinePolicy, "'pipelinePolicy' cannot be null")); + return this; + } + + /** + * Sets the request retry options for all the requests made through the client. By default, the pipeline will + * use an exponential backoff retry value as detailed in {@link RetryPolicy#RetryPolicy()}. + * + * @param retryPolicy {@link RetryPolicy}. + * @return the updated DigitalTwinsClientBuilder instance for fluent building. + * @throws NullPointerException If {@code retryOptions} is {@code null}. + */ + public DigitalTwinsClientBuilder retryOptions(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the {@link HttpPipeline} to use for the service client. + *

+ * If {@code pipeline} is set, all other settings are ignored, aside from {@link #endpoint(String) endpoint}. + * + * @param httpPipeline HttpPipeline to use for sending service requests and receiving responses. + * @return the updated DigitalTwinsClientBuilder instance for fluent building. + */ + public DigitalTwinsClientBuilder httpPipeline(HttpPipeline httpPipeline) { + this.httpPipeline = httpPipeline; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinsServiceVersion.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinsServiceVersion.java new file mode 100644 index 000000000000..f7769d3cd515 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinsServiceVersion.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.digitaltwins.core; + +import com.azure.core.util.ServiceVersion; + +/** + * The service API versions of Azure Digital Twins that are supported by this client. + */ +public enum DigitalTwinsServiceVersion implements ServiceVersion { + V2020_05_31_preview("2020-05-31-preview"); + + private final String version; + + DigitalTwinsServiceVersion(String version) { + this.version = version; + } + + /** + * {@inheritDoc} + */ + @Override + public String getVersion() { + return this.version; + } + + /** + * Gets the latest service API version of Azure Digital Twins that is supported by this client. + * @return The latest service API version of Azure Digital Twins that is supported by this client. + */ + public static DigitalTwinsServiceVersion getLatest() { + return V2020_05_31_preview; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/EventRoutes.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/EventRoutes.java new file mode 100644 index 000000000000..05fa45363f04 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/EventRoutes.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.digitaltwins.core.models.ErrorResponseException; +import com.azure.digitaltwins.core.models.EventRoute; +import com.azure.digitaltwins.core.models.EventRouteCollection; +import com.azure.digitaltwins.core.models.EventRoutesListOptions; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in EventRoutes. */ +public final class EventRoutes { + /** The proxy service used to perform REST calls. */ + private final EventRoutesService service; + + /** The service client containing this operation class. */ + private final AzureDigitalTwinsAPI client; + + /** + * Initializes an instance of EventRoutes. + * + * @param client the instance of the service client containing this operation class. + */ + EventRoutes(AzureDigitalTwinsAPI client) { + this.service = RestProxy.create(EventRoutesService.class, client.getHttpPipeline()); + this.client = client; + } + + /** + * The interface defining all the services for AzureDigitalTwinsAPIEventRoutes to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureDigitalTwinsAPI") + private interface EventRoutesService { + @Get("/eventroutes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> list( + @HostParam("$host") String host, + @HeaderParam("x-ms-max-item-count") Integer maxItemCount, + @QueryParam("api-version") String apiVersion, + Context context); + + @Get("/eventroutes/{id}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> getById( + @HostParam("$host") String host, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + Context context); + + @Put("/eventroutes/{id}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> add( + @HostParam("$host") String host, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") EventRoute eventRoute, + Context context); + + @Delete("/eventroutes/{id}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> delete( + @HostParam("$host") String host, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + } + + /** + * Retrieves all event routes. Status codes: 200 (OK): Success. 400 (Bad Request): The request is invalid. + * + * @param eventRoutesListOptions Parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of EventRoute objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync(EventRoutesListOptions eventRoutesListOptions) { + Integer maxItemCountInternal = null; + if (eventRoutesListOptions != null) { + maxItemCountInternal = eventRoutesListOptions.getMaxItemCount(); + } + Integer maxItemCount = maxItemCountInternal; + return FluxUtil.withContext( + context -> + service.list(this.client.getHost(), maxItemCount, this.client.getApiVersion(), context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().getValue(), + res.getValue().getNextLink(), + null)); + } + + /** + * Retrieves an event route. Status codes: 200 (OK): Success. 404 (Not Found): There is no event route with the + * provided id. + * + * @param id The id for an event route. The id is unique within event routes and case sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a route which directs notification and telemetry events to an endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByIdWithResponseAsync(String id) { + return FluxUtil.withContext( + context -> service.getById(this.client.getHost(), id, this.client.getApiVersion(), context)); + } + + /** + * Adds or replaces an event route. Status codes: 200 (OK): Success. 400 (Bad Request): The request is invalid. + * + * @param id The id for an event route. The id is unique within event routes and case sensitive. + * @param eventRoute A route which directs notification and telemetry events to an endpoint. Endpoints are a + * destination outside of Azure Digital Twins such as an EventHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addWithResponseAsync(String id, EventRoute eventRoute) { + return FluxUtil.withContext( + context -> service.add(this.client.getHost(), id, this.client.getApiVersion(), eventRoute, context)); + } + + /** + * Deletes an event route. Status codes: 200 (OK): Success. 404 (Not Found): There is no event route with the + * provided id. + * + * @param id The id for an event route. The id is unique within event routes and case sensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync(String id) { + return FluxUtil.withContext( + context -> service.delete(this.client.getHost(), id, this.client.getApiVersion(), context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of EventRoute objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink) { + return FluxUtil.withContext(context -> service.listNext(nextLink, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().getValue(), + res.getValue().getNextLink(), + null)); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/Querys.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/Querys.java new file mode 100644 index 000000000000..ad3ec24996c5 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/Querys.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.digitaltwins.core.models.ErrorResponseException; +import com.azure.digitaltwins.core.models.QuerySpecification; +import com.azure.digitaltwins.core.models.QuerysQueryTwinsResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in Querys. */ +public final class Querys { + /** The proxy service used to perform REST calls. */ + private final QuerysService service; + + /** The service client containing this operation class. */ + private final AzureDigitalTwinsAPI client; + + /** + * Initializes an instance of Querys. + * + * @param client the instance of the service client containing this operation class. + */ + Querys(AzureDigitalTwinsAPI client) { + this.service = RestProxy.create(QuerysService.class, client.getHttpPipeline()); + this.client = client; + } + + /** + * The interface defining all the services for AzureDigitalTwinsAPIQuerys to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureDigitalTwinsAPI") + private interface QuerysService { + @Post("/query") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono queryTwins( + @HostParam("$host") String host, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") QuerySpecification querySpecification, + Context context); + } + + /** + * Executes a query that allows traversing relationships and filtering by property values. Status codes: 200 (OK): + * Success. 400 (Bad Request): The request is invalid. + * + * @param querySpecification A query specification containing either a query statement or a continuation token from + * a previous query result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the results of a query operation and an optional continuation token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono queryTwinsWithResponseAsync(QuerySpecification querySpecification) { + return FluxUtil.withContext( + context -> + service.queryTwins( + this.client.getHost(), this.client.getApiVersion(), querySpecification, context)); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinModelsListOptions.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinModelsListOptions.java new file mode 100644 index 000000000000..7ae6b14b563b --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinModelsListOptions.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The DigitalTwinModelsListOptions model. */ +@Fluent +public final class DigitalTwinModelsListOptions { + /* + * The maximum number of items to retrieve per request. The server may + * choose to return less than the requested max. + */ + @JsonProperty(value = "MaxItemCount") + private Integer maxItemCount; + + /** + * Get the maxItemCount property: The maximum number of items to retrieve per request. The server may choose to + * return less than the requested max. + * + * @return the maxItemCount value. + */ + public Integer getMaxItemCount() { + return this.maxItemCount; + } + + /** + * Set the maxItemCount property: The maximum number of items to retrieve per request. The server may choose to + * return less than the requested max. + * + * @param maxItemCount the maxItemCount value to set. + * @return the DigitalTwinModelsListOptions object itself. + */ + public DigitalTwinModelsListOptions setMaxItemCount(Integer maxItemCount) { + this.maxItemCount = maxItemCount; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsAddHeaders.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsAddHeaders.java new file mode 100644 index 000000000000..e7b3d8bf83ce --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsAddHeaders.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The DigitalTwinsAddHeaders model. */ +@Fluent +public final class DigitalTwinsAddHeaders { + /* + * The ETag property. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the eTag property: The ETag property. + * + * @return the eTag value. + */ + public String getETag() { + return this.eTag; + } + + /** + * Set the eTag property: The ETag property. + * + * @param eTag the eTag value to set. + * @return the DigitalTwinsAddHeaders object itself. + */ + public DigitalTwinsAddHeaders setETag(String eTag) { + this.eTag = eTag; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsAddRelationshipHeaders.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsAddRelationshipHeaders.java new file mode 100644 index 000000000000..9cc9a64819f5 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsAddRelationshipHeaders.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The DigitalTwinsAddRelationshipHeaders model. */ +@Fluent +public final class DigitalTwinsAddRelationshipHeaders { + /* + * The ETag property. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the eTag property: The ETag property. + * + * @return the eTag value. + */ + public String getETag() { + return this.eTag; + } + + /** + * Set the eTag property: The ETag property. + * + * @param eTag the eTag value to set. + * @return the DigitalTwinsAddRelationshipHeaders object itself. + */ + public DigitalTwinsAddRelationshipHeaders setETag(String eTag) { + this.eTag = eTag; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsAddRelationshipResponse.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsAddRelationshipResponse.java new file mode 100644 index 000000000000..df4c6bff1037 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsAddRelationshipResponse.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the addRelationship operation. */ +public final class DigitalTwinsAddRelationshipResponse + extends ResponseBase { + /** + * Creates an instance of DigitalTwinsAddRelationshipResponse. + * + * @param request the request which resulted in this DigitalTwinsAddRelationshipResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public DigitalTwinsAddRelationshipResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Object value, + DigitalTwinsAddRelationshipHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public Object getValue() { + return super.getValue(); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsAddResponse.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsAddResponse.java new file mode 100644 index 000000000000..439f84bbcec1 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsAddResponse.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the add operation. */ +public final class DigitalTwinsAddResponse extends ResponseBase { + /** + * Creates an instance of DigitalTwinsAddResponse. + * + * @param request the request which resulted in this DigitalTwinsAddResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public DigitalTwinsAddResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, Object value, DigitalTwinsAddHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public Object getValue() { + return super.getValue(); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsGetByIdHeaders.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsGetByIdHeaders.java new file mode 100644 index 000000000000..12e7ab31a15f --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsGetByIdHeaders.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The DigitalTwinsGetByIdHeaders model. */ +@Fluent +public final class DigitalTwinsGetByIdHeaders { + /* + * The ETag property. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the eTag property: The ETag property. + * + * @return the eTag value. + */ + public String getETag() { + return this.eTag; + } + + /** + * Set the eTag property: The ETag property. + * + * @param eTag the eTag value to set. + * @return the DigitalTwinsGetByIdHeaders object itself. + */ + public DigitalTwinsGetByIdHeaders setETag(String eTag) { + this.eTag = eTag; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsGetByIdResponse.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsGetByIdResponse.java new file mode 100644 index 000000000000..781bd72834b7 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsGetByIdResponse.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getById operation. */ +public final class DigitalTwinsGetByIdResponse extends ResponseBase { + /** + * Creates an instance of DigitalTwinsGetByIdResponse. + * + * @param request the request which resulted in this DigitalTwinsGetByIdResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public DigitalTwinsGetByIdResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Object value, + DigitalTwinsGetByIdHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public Object getValue() { + return super.getValue(); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsGetComponentHeaders.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsGetComponentHeaders.java new file mode 100644 index 000000000000..ecbb30fac4bb --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsGetComponentHeaders.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The DigitalTwinsGetComponentHeaders model. */ +@Fluent +public final class DigitalTwinsGetComponentHeaders { + /* + * The ETag property. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the eTag property: The ETag property. + * + * @return the eTag value. + */ + public String getETag() { + return this.eTag; + } + + /** + * Set the eTag property: The ETag property. + * + * @param eTag the eTag value to set. + * @return the DigitalTwinsGetComponentHeaders object itself. + */ + public DigitalTwinsGetComponentHeaders setETag(String eTag) { + this.eTag = eTag; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsGetComponentResponse.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsGetComponentResponse.java new file mode 100644 index 000000000000..081dddce2999 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsGetComponentResponse.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getComponent operation. */ +public final class DigitalTwinsGetComponentResponse extends ResponseBase { + /** + * Creates an instance of DigitalTwinsGetComponentResponse. + * + * @param request the request which resulted in this DigitalTwinsGetComponentResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public DigitalTwinsGetComponentResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Object value, + DigitalTwinsGetComponentHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public Object getValue() { + return super.getValue(); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsGetRelationshipByIdHeaders.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsGetRelationshipByIdHeaders.java new file mode 100644 index 000000000000..9cfc2f6511fd --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsGetRelationshipByIdHeaders.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The DigitalTwinsGetRelationshipByIdHeaders model. */ +@Fluent +public final class DigitalTwinsGetRelationshipByIdHeaders { + /* + * The ETag property. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the eTag property: The ETag property. + * + * @return the eTag value. + */ + public String getETag() { + return this.eTag; + } + + /** + * Set the eTag property: The ETag property. + * + * @param eTag the eTag value to set. + * @return the DigitalTwinsGetRelationshipByIdHeaders object itself. + */ + public DigitalTwinsGetRelationshipByIdHeaders setETag(String eTag) { + this.eTag = eTag; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsGetRelationshipByIdResponse.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsGetRelationshipByIdResponse.java new file mode 100644 index 000000000000..0967eba28373 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsGetRelationshipByIdResponse.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getRelationshipById operation. */ +public final class DigitalTwinsGetRelationshipByIdResponse + extends ResponseBase { + /** + * Creates an instance of DigitalTwinsGetRelationshipByIdResponse. + * + * @param request the request which resulted in this DigitalTwinsGetRelationshipByIdResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public DigitalTwinsGetRelationshipByIdResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Object value, + DigitalTwinsGetRelationshipByIdHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public Object getValue() { + return super.getValue(); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsUpdateComponentHeaders.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsUpdateComponentHeaders.java new file mode 100644 index 000000000000..d8849a8a190b --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsUpdateComponentHeaders.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The DigitalTwinsUpdateComponentHeaders model. */ +@Fluent +public final class DigitalTwinsUpdateComponentHeaders { + /* + * The ETag property. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the eTag property: The ETag property. + * + * @return the eTag value. + */ + public String getETag() { + return this.eTag; + } + + /** + * Set the eTag property: The ETag property. + * + * @param eTag the eTag value to set. + * @return the DigitalTwinsUpdateComponentHeaders object itself. + */ + public DigitalTwinsUpdateComponentHeaders setETag(String eTag) { + this.eTag = eTag; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsUpdateComponentResponse.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsUpdateComponentResponse.java new file mode 100644 index 000000000000..631ffbb164ca --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsUpdateComponentResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the updateComponent operation. */ +public final class DigitalTwinsUpdateComponentResponse extends ResponseBase { + /** + * Creates an instance of DigitalTwinsUpdateComponentResponse. + * + * @param request the request which resulted in this DigitalTwinsUpdateComponentResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public DigitalTwinsUpdateComponentResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + DigitalTwinsUpdateComponentHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsUpdateHeaders.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsUpdateHeaders.java new file mode 100644 index 000000000000..46ec62a8f35c --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsUpdateHeaders.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The DigitalTwinsUpdateHeaders model. */ +@Fluent +public final class DigitalTwinsUpdateHeaders { + /* + * The ETag property. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the eTag property: The ETag property. + * + * @return the eTag value. + */ + public String getETag() { + return this.eTag; + } + + /** + * Set the eTag property: The ETag property. + * + * @param eTag the eTag value to set. + * @return the DigitalTwinsUpdateHeaders object itself. + */ + public DigitalTwinsUpdateHeaders setETag(String eTag) { + this.eTag = eTag; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsUpdateRelationshipHeaders.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsUpdateRelationshipHeaders.java new file mode 100644 index 000000000000..93944ad869eb --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsUpdateRelationshipHeaders.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The DigitalTwinsUpdateRelationshipHeaders model. */ +@Fluent +public final class DigitalTwinsUpdateRelationshipHeaders { + /* + * The ETag property. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the eTag property: The ETag property. + * + * @return the eTag value. + */ + public String getETag() { + return this.eTag; + } + + /** + * Set the eTag property: The ETag property. + * + * @param eTag the eTag value to set. + * @return the DigitalTwinsUpdateRelationshipHeaders object itself. + */ + public DigitalTwinsUpdateRelationshipHeaders setETag(String eTag) { + this.eTag = eTag; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsUpdateRelationshipResponse.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsUpdateRelationshipResponse.java new file mode 100644 index 000000000000..2373d063a0be --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsUpdateRelationshipResponse.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the updateRelationship operation. */ +public final class DigitalTwinsUpdateRelationshipResponse + extends ResponseBase { + /** + * Creates an instance of DigitalTwinsUpdateRelationshipResponse. + * + * @param request the request which resulted in this DigitalTwinsUpdateRelationshipResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public DigitalTwinsUpdateRelationshipResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + DigitalTwinsUpdateRelationshipHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsUpdateResponse.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsUpdateResponse.java new file mode 100644 index 000000000000..cf847cee9d86 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/DigitalTwinsUpdateResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the update operation. */ +public final class DigitalTwinsUpdateResponse extends ResponseBase { + /** + * Creates an instance of DigitalTwinsUpdateResponse. + * + * @param request the request which resulted in this DigitalTwinsUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public DigitalTwinsUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + DigitalTwinsUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/Error.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/Error.java new file mode 100644 index 000000000000..602a4014a329 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/Error.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The Error model. */ +@Fluent +public final class Error { + /* + * Service specific error code which serves as the substatus for the HTTP + * error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * A human-readable representation of the error. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Internal error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /* + * An object containing more specific information than the current object + * about the error. + */ + @JsonProperty(value = "innererror") + private InnerError innererror; + + /** + * Get the code property: Service specific error code which serves as the substatus for the HTTP error code. + * + * @return the code value. + */ + public String getCode() { + return this.code; + } + + /** + * Get the message property: A human-readable representation of the error. + * + * @return the message value. + */ + public String getMessage() { + return this.message; + } + + /** + * Get the details property: Internal error details. + * + * @return the details value. + */ + public List getDetails() { + return this.details; + } + + /** + * Get the innererror property: An object containing more specific information than the current object about the + * error. + * + * @return the innererror value. + */ + public InnerError getInnererror() { + return this.innererror; + } + + /** + * Set the innererror property: An object containing more specific information than the current object about the + * error. + * + * @param innererror the innererror value to set. + * @return the Error object itself. + */ + public Error setInnererror(InnerError innererror) { + this.innererror = innererror; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/ErrorResponse.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/ErrorResponse.java new file mode 100644 index 000000000000..0d1b144695c6 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/ErrorResponse.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ErrorResponse model. */ +@Fluent +public final class ErrorResponse { + /* + * The error details. + */ + @JsonProperty(value = "error") + private Error error; + + /** + * Get the error property: The error details. + * + * @return the error value. + */ + public Error getError() { + return this.error; + } + + /** + * Set the error property: The error details. + * + * @param error the error value to set. + * @return the ErrorResponse object itself. + */ + public ErrorResponse setError(Error error) { + this.error = error; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/ErrorResponseException.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/ErrorResponseException.java new file mode 100644 index 000000000000..4b9eec0488dc --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/ErrorResponseException.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.HttpResponse; + +/** Exception thrown for an invalid response with ErrorResponse information. */ +public final class ErrorResponseException extends HttpResponseException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + */ + public ErrorResponseException(String message, HttpResponse response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + * @param value the deserialized response value. + */ + public ErrorResponseException(String message, HttpResponse response, ErrorResponse value) { + super(message, response, value); + } + + @Override + public ErrorResponse getValue() { + return (ErrorResponse) super.getValue(); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/EventRoute.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/EventRoute.java new file mode 100644 index 000000000000..9ee35e348e49 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/EventRoute.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The EventRoute model. */ +@Fluent +public final class EventRoute { + /* + * The id of the event route. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The name of the endpoint this event route is bound to. + */ + @JsonProperty(value = "endpointName", required = true) + private String endpointName; + + /* + * An expression which describes the events which are routed to the + * endpoint. + */ + @JsonProperty(value = "filter") + private String filter; + + /** + * Get the id property: The id of the event route. + * + * @return the id value. + */ + public String getId() { + return this.id; + } + + /** + * Get the endpointName property: The name of the endpoint this event route is bound to. + * + * @return the endpointName value. + */ + public String getEndpointName() { + return this.endpointName; + } + + /** + * Set the endpointName property: The name of the endpoint this event route is bound to. + * + * @param endpointName the endpointName value to set. + * @return the EventRoute object itself. + */ + public EventRoute setEndpointName(String endpointName) { + this.endpointName = endpointName; + return this; + } + + /** + * Get the filter property: An expression which describes the events which are routed to the endpoint. + * + * @return the filter value. + */ + public String getFilter() { + return this.filter; + } + + /** + * Set the filter property: An expression which describes the events which are routed to the endpoint. + * + * @param filter the filter value to set. + * @return the EventRoute object itself. + */ + public EventRoute setFilter(String filter) { + this.filter = filter; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/EventRouteCollection.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/EventRouteCollection.java new file mode 100644 index 000000000000..c2df9813e0a1 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/EventRouteCollection.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The EventRouteCollection model. */ +@Fluent +public final class EventRouteCollection { + /* + * The EventRoute objects. + */ + @JsonProperty(value = "value") + private List value; + + /* + * A URI to retrieve the next page of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The EventRoute objects. + * + * @return the value value. + */ + public List getValue() { + return this.value; + } + + /** + * Set the value property: The EventRoute objects. + * + * @param value the value value to set. + * @return the EventRouteCollection object itself. + */ + public EventRouteCollection setValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: A URI to retrieve the next page of results. + * + * @return the nextLink value. + */ + public String getNextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: A URI to retrieve the next page of results. + * + * @param nextLink the nextLink value to set. + * @return the EventRouteCollection object itself. + */ + public EventRouteCollection setNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/EventRoutesListOptions.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/EventRoutesListOptions.java new file mode 100644 index 000000000000..2cde31eb2162 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/EventRoutesListOptions.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The EventRoutesListOptions model. */ +@Fluent +public final class EventRoutesListOptions { + /* + * The maximum number of items to retrieve per request. The server may + * choose to return less than the requested max. + */ + @JsonProperty(value = "MaxItemCount") + private Integer maxItemCount; + + /** + * Get the maxItemCount property: The maximum number of items to retrieve per request. The server may choose to + * return less than the requested max. + * + * @return the maxItemCount value. + */ + public Integer getMaxItemCount() { + return this.maxItemCount; + } + + /** + * Set the maxItemCount property: The maximum number of items to retrieve per request. The server may choose to + * return less than the requested max. + * + * @param maxItemCount the maxItemCount value to set. + * @return the EventRoutesListOptions object itself. + */ + public EventRoutesListOptions setMaxItemCount(Integer maxItemCount) { + this.maxItemCount = maxItemCount; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/IncomingRelationship.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/IncomingRelationship.java new file mode 100644 index 000000000000..2d5dbcb633ee --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/IncomingRelationship.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The IncomingRelationship model. */ +@Fluent +public final class IncomingRelationship { + /* + * A user-provided string representing the id of this relationship, unique + * in the context of the source digital twin, i.e. sourceId + + * relationshipId is unique in the context of the service. + */ + @JsonProperty(value = "$relationshipId") + private String relationshipId; + + /* + * The id of the source digital twin. + */ + @JsonProperty(value = "$sourceId") + private String sourceId; + + /* + * The name of the relationship. + */ + @JsonProperty(value = "$relationshipName") + private String relationshipName; + + /* + * Link to the relationship, to be used for deletion. + */ + @JsonProperty(value = "$relationshipLink") + private String relationshipLink; + + /** + * Get the relationshipId property: A user-provided string representing the id of this relationship, unique in the + * context of the source digital twin, i.e. sourceId + relationshipId is unique in the context of the service. + * + * @return the relationshipId value. + */ + public String getRelationshipId() { + return this.relationshipId; + } + + /** + * Set the relationshipId property: A user-provided string representing the id of this relationship, unique in the + * context of the source digital twin, i.e. sourceId + relationshipId is unique in the context of the service. + * + * @param relationshipId the relationshipId value to set. + * @return the IncomingRelationship object itself. + */ + public IncomingRelationship setRelationshipId(String relationshipId) { + this.relationshipId = relationshipId; + return this; + } + + /** + * Get the sourceId property: The id of the source digital twin. + * + * @return the sourceId value. + */ + public String getSourceId() { + return this.sourceId; + } + + /** + * Set the sourceId property: The id of the source digital twin. + * + * @param sourceId the sourceId value to set. + * @return the IncomingRelationship object itself. + */ + public IncomingRelationship setSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get the relationshipName property: The name of the relationship. + * + * @return the relationshipName value. + */ + public String getRelationshipName() { + return this.relationshipName; + } + + /** + * Set the relationshipName property: The name of the relationship. + * + * @param relationshipName the relationshipName value to set. + * @return the IncomingRelationship object itself. + */ + public IncomingRelationship setRelationshipName(String relationshipName) { + this.relationshipName = relationshipName; + return this; + } + + /** + * Get the relationshipLink property: Link to the relationship, to be used for deletion. + * + * @return the relationshipLink value. + */ + public String getRelationshipLink() { + return this.relationshipLink; + } + + /** + * Set the relationshipLink property: Link to the relationship, to be used for deletion. + * + * @param relationshipLink the relationshipLink value to set. + * @return the IncomingRelationship object itself. + */ + public IncomingRelationship setRelationshipLink(String relationshipLink) { + this.relationshipLink = relationshipLink; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/IncomingRelationshipCollection.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/IncomingRelationshipCollection.java new file mode 100644 index 000000000000..7b7c9487c9f2 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/IncomingRelationshipCollection.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The IncomingRelationshipCollection model. */ +@Fluent +public final class IncomingRelationshipCollection { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * A URI to retrieve the next page of objects. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List getValue() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the IncomingRelationshipCollection object itself. + */ + public IncomingRelationshipCollection setValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: A URI to retrieve the next page of objects. + * + * @return the nextLink value. + */ + public String getNextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: A URI to retrieve the next page of objects. + * + * @param nextLink the nextLink value to set. + * @return the IncomingRelationshipCollection object itself. + */ + public IncomingRelationshipCollection setNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/InnerError.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/InnerError.java new file mode 100644 index 000000000000..811d968b2166 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/InnerError.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The InnerError model. */ +@Fluent +public final class InnerError { + /* + * A more specific error code than was provided by the containing error. + */ + @JsonProperty(value = "code") + private String code; + + /* + * An object containing more specific information than the current object + * about the error. + */ + @JsonProperty(value = "innererror") + private InnerError innererror; + + /** + * Get the code property: A more specific error code than was provided by the containing error. + * + * @return the code value. + */ + public String getCode() { + return this.code; + } + + /** + * Set the code property: A more specific error code than was provided by the containing error. + * + * @param code the code value to set. + * @return the InnerError object itself. + */ + public InnerError setCode(String code) { + this.code = code; + return this; + } + + /** + * Get the innererror property: An object containing more specific information than the current object about the + * error. + * + * @return the innererror value. + */ + public InnerError getInnererror() { + return this.innererror; + } + + /** + * Set the innererror property: An object containing more specific information than the current object about the + * error. + * + * @param innererror the innererror value to set. + * @return the InnerError object itself. + */ + public InnerError setInnererror(InnerError innererror) { + this.innererror = innererror; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/ModelData.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/ModelData.java new file mode 100644 index 000000000000..a74c158d41cb --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/ModelData.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** The ModelData model. */ +@Fluent +public final class ModelData { + /* + * A language map that contains the localized display names as specified in + * the model definition. + */ + @JsonProperty(value = "displayName") + private Map displayName; + + /* + * A language map that contains the localized descriptions as specified in + * the model definition. + */ + @JsonProperty(value = "description") + private Map description; + + /* + * The id of the model as specified in the model definition. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /* + * The time the model was uploaded to the service. + */ + @JsonProperty(value = "uploadTime") + private OffsetDateTime uploadTime; + + /* + * Indicates if the model is decommissioned. Decommissioned models cannot + * be referenced by newly created digital twins. + */ + @JsonProperty(value = "decommissioned") + private Boolean decommissioned; + + /* + * The model definition. + */ + @JsonProperty(value = "model") + private Object model; + + /** + * Get the displayName property: A language map that contains the localized display names as specified in the model + * definition. + * + * @return the displayName value. + */ + public Map getDisplayName() { + return this.displayName; + } + + /** + * Set the displayName property: A language map that contains the localized display names as specified in the model + * definition. + * + * @param displayName the displayName value to set. + * @return the ModelData object itself. + */ + public ModelData setDisplayName(Map displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description property: A language map that contains the localized descriptions as specified in the model + * definition. + * + * @return the description value. + */ + public Map getDescription() { + return this.description; + } + + /** + * Set the description property: A language map that contains the localized descriptions as specified in the model + * definition. + * + * @param description the description value to set. + * @return the ModelData object itself. + */ + public ModelData setDescription(Map description) { + this.description = description; + return this; + } + + /** + * Get the id property: The id of the model as specified in the model definition. + * + * @return the id value. + */ + public String getId() { + return this.id; + } + + /** + * Set the id property: The id of the model as specified in the model definition. + * + * @param id the id value to set. + * @return the ModelData object itself. + */ + public ModelData setId(String id) { + this.id = id; + return this; + } + + /** + * Get the uploadTime property: The time the model was uploaded to the service. + * + * @return the uploadTime value. + */ + public OffsetDateTime getUploadTime() { + return this.uploadTime; + } + + /** + * Set the uploadTime property: The time the model was uploaded to the service. + * + * @param uploadTime the uploadTime value to set. + * @return the ModelData object itself. + */ + public ModelData setUploadTime(OffsetDateTime uploadTime) { + this.uploadTime = uploadTime; + return this; + } + + /** + * Get the decommissioned property: Indicates if the model is decommissioned. Decommissioned models cannot be + * referenced by newly created digital twins. + * + * @return the decommissioned value. + */ + public Boolean isDecommissioned() { + return this.decommissioned; + } + + /** + * Set the decommissioned property: Indicates if the model is decommissioned. Decommissioned models cannot be + * referenced by newly created digital twins. + * + * @param decommissioned the decommissioned value to set. + * @return the ModelData object itself. + */ + public ModelData setDecommissioned(Boolean decommissioned) { + this.decommissioned = decommissioned; + return this; + } + + /** + * Get the model property: The model definition. + * + * @return the model value. + */ + public Object getModel() { + return this.model; + } + + /** + * Set the model property: The model definition. + * + * @param model the model value to set. + * @return the ModelData object itself. + */ + public ModelData setModel(Object model) { + this.model = model; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/PagedModelDataCollection.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/PagedModelDataCollection.java new file mode 100644 index 000000000000..aa404a997e84 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/PagedModelDataCollection.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The PagedModelDataCollection model. */ +@Fluent +public final class PagedModelDataCollection { + /* + * The ModelData objects. + */ + @JsonProperty(value = "value") + private List value; + + /* + * A URI to retrieve the next page of objects. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The ModelData objects. + * + * @return the value value. + */ + public List getValue() { + return this.value; + } + + /** + * Set the value property: The ModelData objects. + * + * @param value the value value to set. + * @return the PagedModelDataCollection object itself. + */ + public PagedModelDataCollection setValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: A URI to retrieve the next page of objects. + * + * @return the nextLink value. + */ + public String getNextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: A URI to retrieve the next page of objects. + * + * @param nextLink the nextLink value to set. + * @return the PagedModelDataCollection object itself. + */ + public PagedModelDataCollection setNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/QueryResult.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/QueryResult.java new file mode 100644 index 000000000000..3f1abe3f5853 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/QueryResult.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The QueryResult model. */ +@Fluent +public final class QueryResult { + /* + * The query results. + */ + @JsonProperty(value = "items") + private List items; + + /* + * A token which can be used to construct a new QuerySpecification to + * retrieve the next set of results. + */ + @JsonProperty(value = "continuationToken") + private String continuationToken; + + /** + * Get the items property: The query results. + * + * @return the items value. + */ + public List getItems() { + return this.items; + } + + /** + * Set the items property: The query results. + * + * @param items the items value to set. + * @return the QueryResult object itself. + */ + public QueryResult setItems(List items) { + this.items = items; + return this; + } + + /** + * Get the continuationToken property: A token which can be used to construct a new QuerySpecification to retrieve + * the next set of results. + * + * @return the continuationToken value. + */ + public String getContinuationToken() { + return this.continuationToken; + } + + /** + * Set the continuationToken property: A token which can be used to construct a new QuerySpecification to retrieve + * the next set of results. + * + * @param continuationToken the continuationToken value to set. + * @return the QueryResult object itself. + */ + public QueryResult setContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/QuerySpecification.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/QuerySpecification.java new file mode 100644 index 000000000000..1d30765c9219 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/QuerySpecification.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The QuerySpecification model. */ +@Fluent +public final class QuerySpecification { + /* + * The query to execute. This value is ignored if a continuation token is + * provided. + */ + @JsonProperty(value = "query") + private String query; + + /* + * A token which is used to retrieve the next set of results from a + * previous query. + */ + @JsonProperty(value = "continuationToken") + private String continuationToken; + + /** + * Get the query property: The query to execute. This value is ignored if a continuation token is provided. + * + * @return the query value. + */ + public String getQuery() { + return this.query; + } + + /** + * Set the query property: The query to execute. This value is ignored if a continuation token is provided. + * + * @param query the query value to set. + * @return the QuerySpecification object itself. + */ + public QuerySpecification setQuery(String query) { + this.query = query; + return this; + } + + /** + * Get the continuationToken property: A token which is used to retrieve the next set of results from a previous + * query. + * + * @return the continuationToken value. + */ + public String getContinuationToken() { + return this.continuationToken; + } + + /** + * Set the continuationToken property: A token which is used to retrieve the next set of results from a previous + * query. + * + * @param continuationToken the continuationToken value to set. + * @return the QuerySpecification object itself. + */ + public QuerySpecification setContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/QuerysQueryTwinsHeaders.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/QuerysQueryTwinsHeaders.java new file mode 100644 index 000000000000..0164605cc808 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/QuerysQueryTwinsHeaders.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The QuerysQueryTwinsHeaders model. */ +@Fluent +public final class QuerysQueryTwinsHeaders { + /* + * The query-charge property. + */ + @JsonProperty(value = "query-charge") + private Float queryCharge; + + /** + * Get the queryCharge property: The query-charge property. + * + * @return the queryCharge value. + */ + public Float getQueryCharge() { + return this.queryCharge; + } + + /** + * Set the queryCharge property: The query-charge property. + * + * @param queryCharge the queryCharge value to set. + * @return the QuerysQueryTwinsHeaders object itself. + */ + public QuerysQueryTwinsHeaders setQueryCharge(Float queryCharge) { + this.queryCharge = queryCharge; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/QuerysQueryTwinsResponse.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/QuerysQueryTwinsResponse.java new file mode 100644 index 000000000000..d3b0bb97bffc --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/QuerysQueryTwinsResponse.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the queryTwins operation. */ +public final class QuerysQueryTwinsResponse extends ResponseBase { + /** + * Creates an instance of QuerysQueryTwinsResponse. + * + * @param request the request which resulted in this QuerysQueryTwinsResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public QuerysQueryTwinsResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + QueryResult value, + QuerysQueryTwinsHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public QueryResult getValue() { + return super.getValue(); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/RelationshipCollection.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/RelationshipCollection.java new file mode 100644 index 000000000000..5cdccd2ba7da --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/RelationshipCollection.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The RelationshipCollection model. */ +@Fluent +public final class RelationshipCollection { + /* + * The relationship objects. + */ + @JsonProperty(value = "value") + private List value; + + /* + * A URI to retrieve the next page of objects. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The relationship objects. + * + * @return the value value. + */ + public List getValue() { + return this.value; + } + + /** + * Set the value property: The relationship objects. + * + * @param value the value value to set. + * @return the RelationshipCollection object itself. + */ + public RelationshipCollection setValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: A URI to retrieve the next page of objects. + * + * @return the nextLink value. + */ + public String getNextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: A URI to retrieve the next page of objects. + * + * @param nextLink the nextLink value to set. + * @return the RelationshipCollection object itself. + */ + public RelationshipCollection setNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/package-info.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/package-info.java new file mode 100644 index 000000000000..78cb05f24374 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for AzureDigitalTwinsAPI. A service for managing and querying digital twins and + * digital twin models. + */ +package com.azure.digitaltwins.core.models; diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/package-info.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/package-info.java new file mode 100644 index 000000000000..71f5e121c62f --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for AzureDigitalTwinsAPI. A service for managing and querying digital twins and + * digital twin models. + */ +package com.azure.digitaltwins.core; diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/samples/java/com/azure/digitaltwins/core/AsyncSample.java b/sdk/digitaltwins/azure-digitaltwins-core/src/samples/java/com/azure/digitaltwins/core/AsyncSample.java new file mode 100644 index 000000000000..d06353fdf83b --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/samples/java/com/azure/digitaltwins/core/AsyncSample.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.digitaltwins.core; + +import com.azure.core.credential.TokenCredential; +import com.azure.digitaltwins.core.models.DigitalTwinsGetByIdResponse; +import com.azure.identity.ClientSecretCredentialBuilder; +import reactor.core.publisher.Mono; + +public class AsyncSample +{ + public static void main(String[] args) throws InterruptedException + { + String tenantId = System.getenv("TENANT_ID"); + String clientId = System.getenv("CLIENT_ID"); + String clientSecret = System.getenv("CLIENT_SECRET"); + String endpoint = System.getenv("DIGITAL_TWINS_ENDPOINT"); + String digitalTwinId = System.getenv("DIGITAL_TWIN_ID"); + + TokenCredential tokenCredential = new ClientSecretCredentialBuilder() + .tenantId(tenantId) + .clientId(clientId) + .clientSecret(clientSecret) + .build(); + + DigitalTwinsAsyncClient client = new DigitalTwinsClientBuilder() + .tokenCredential(tokenCredential) + .endpoint(endpoint) + .buildAsyncClient(); + + Mono asyncResponse = client.getDigitalTwin(digitalTwinId); + + // once the async thread completes, the digital twin will be printed, or an error will be printed + asyncResponse.subscribe( + result -> System.out.println(result.getValue()), + error -> System.err.println("Failed to get digital twin with Id " + digitalTwinId + " due to error message " + error.getMessage())); + + //Wait for async thread to finish before ending this thread. + Thread.sleep(3000); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/samples/java/com/azure/digitaltwins/core/SyncSample.java b/sdk/digitaltwins/azure-digitaltwins-core/src/samples/java/com/azure/digitaltwins/core/SyncSample.java new file mode 100644 index 000000000000..ba0e05ccdb7f --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/samples/java/com/azure/digitaltwins/core/SyncSample.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.digitaltwins.core; + +import com.azure.core.credential.TokenCredential; +import com.azure.digitaltwins.core.models.DigitalTwinsGetByIdResponse; +import com.azure.identity.ClientSecretCredentialBuilder; + +public class SyncSample +{ + public static void main(String[] args) + { + String tenantId = System.getenv("TENANT_ID"); + String clientId = System.getenv("CLIENT_ID"); + String clientSecret = System.getenv("CLIENT_SECRET"); + String endpoint = System.getenv("DIGITAL_TWINS_ENDPOINT"); + String digitalTwinId = System.getenv("DIGITAL_TWIN_ID"); + + TokenCredential tokenCredential = new ClientSecretCredentialBuilder() + .tenantId(tenantId) + .clientId(clientId) + .clientSecret(clientSecret) + .build(); + + DigitalTwinsClient client = new DigitalTwinsClientBuilder() + .tokenCredential(tokenCredential) + .endpoint(endpoint) + .buildClient(); + + DigitalTwinsGetByIdResponse syncResponse = client.getDigitalTwin(digitalTwinId); + Object digitalTwin = syncResponse.getValue(); + System.out.println(digitalTwin); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json new file mode 100644 index 000000000000..b17bda728464 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/digitaltwins.json @@ -0,0 +1,1497 @@ +{ + "swagger": "2.0", + "info": { + "version": "2020-05-31-preview", + "title": "Azure Digital Twins API", + "description": "A service for managing and querying digital twins and digital twin models." + }, + "host": "digitaltwins-name.digitaltwins.azure.net", + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "paths": { + "/models": { + "post": { + "tags": [ + "Models" + ], + "description": "Uploads one or more models. When any error occurs, no models are uploaded.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.\n409 (Conflict): One or more of the provided models already exist.", + "operationId": "DigitalTwinModels_Add", + "x-ms-examples": { + "ModelAdd": { + "$ref": "./examples/ModelAdd.json" + } + }, + "parameters": [ + { + "name": "models", + "in": "body", + "description": "An array of models to add.", + "required": false, + "schema": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "object" + } + } + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/NonPagedModelDataCollection" + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "get": { + "tags": [ + "Models" + ], + "description": "Retrieves model metadata and, optionally, model definitions.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "operationId": "DigitalTwinModels_List", + "x-ms-examples": { + "ModelsGet": { + "$ref": "./examples/ModelsGet.json" + }, + "ModelsGetWithContextAndIncludeModelDefinition": { + "$ref": "./examples/ModelsGetWithDependenciesAndIncludeModelDefinition.json" + } + }, + "parameters": [ + { + "name": "dependenciesFor", + "in": "query", + "description": "The set of the models which will have their dependencies retrieved. If omitted, all models are retrieved.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + } + }, + { + "$ref": "#/parameters/includeModelDefinition" + }, + { + "$ref": "#/parameters/max-item-count" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/PagedModelDataCollection" + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/models/{id}": { + "get": { + "tags": [ + "Models" + ], + "description": "Retrieves model metadata and optionally the model definition.\nStatus codes:\n200 (OK): Success.\n404 (Not Found): There is no model with the provided id.", + "operationId": "DigitalTwinModels_GetById", + "x-ms-examples": { + "ModelGetById": { + "$ref": "./examples/ModelGetById.json" + }, + "ModelGetByIdWithIncludeModelDefinition": { + "$ref": "./examples/ModelGetByIdWithIncludeModelDefinition.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/modelId" + }, + { + "$ref": "#/parameters/includeModelDefinition" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ModelData" + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "patch": { + "tags": [ + "Models" + ], + "description": "Updates the metadata for a model.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.\n404 (Not Found): There is no model with the provided id.", + "operationId": "DigitalTwinModels_Update", + "consumes": [ + "application/json-patch+json" + ], + "x-ms-examples": { + "ModelUpdateDecommissioned": { + "$ref": "./examples/ModelUpdateDecommissioned.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/modelId" + }, + { + "name": "updateModel", + "description": "An update specification described by JSON Patch. Only the decommissioned property can be replaced.", + "in": "body", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "object" + } + } + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "tags": [ + "Models" + ], + "operationId": "DigitalTwinModels_Delete", + "description": "Deletes a model. A model can only be deleted if no other models reference it.\nStatus codes:\n204 (No Content): Success.\n400 (Bad Request): The request is invalid.\n404 (Not Found): There is no model with the provided id.\n409 (Conflict): There are dependencies on the model that prevent it from being deleted.", + "x-ms-examples": { + "DeleteModel": { + "$ref": "./examples/DeleteModel.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/modelId" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/query": { + "post": { + "tags": [ + "Query" + ], + "operationId": "Query_QueryTwins", + "description": "Executes a query that allows traversing relationships and filtering by property values.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.", + "x-ms-examples": { + "QueryFirstPage": { + "$ref": "./examples/QueryFirstPage.json" + }, + "QueryNextPage": { + "$ref": "./examples/QueryNextPage.json" + }, + "QueryJoin": { + "$ref": "./examples/QueryJoin.json" + } + }, + "parameters": [ + { + "name": "querySpecification", + "in": "body", + "description": "The query specification to execute.", + "required": true, + "schema": { + "$ref": "#/definitions/QuerySpecification" + } + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/QueryResult" + }, + "headers": { + "query-charge": { + "description": "The query charge.", + "type": "number" + } + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/digitaltwins/{id}": { + "get": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_GetById", + "description": "Retrieves a digital twin.\nStatus codes:\n200 (OK): Success.\n404 (Not Found): There is no digital twin with the provided id.", + "x-ms-examples": { + "GetTwin": { + "$ref": "./examples/GetTwin.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "object" + }, + "headers": { + "ETag": { + "description": "Weak Etag.", + "type": "string" + } + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_Add", + "description": "Adds or replaces a digital twin.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.\n412 (Precondition Failed): The model is decommissioned or the digital twin already exists (when using If-None-Match: *).", + "x-ms-examples": { + "PutTwinBasicExample": { + "$ref": "./examples/PutTwinBasicExample.json" + }, + "PutTwinAdvancedExample": { + "$ref": "./examples/PutTwinAdvancedExample.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "name": "twin", + "description": "The digital twin instance being added. If provided, the $dtId property is ignored.", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + }, + { + "$ref": "#/parameters/if-none-match-star" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "object" + }, + "headers": { + "ETag": { + "description": "Weak Etag.", + "type": "string" + } + } + }, + "202": { + "description": "Asynchronous Success" + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_Delete", + "description": "Deletes a digital twin. All relationships referencing the digital twin must already be deleted.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.\n404 (Not Found): There is no digital twin with the provided id.", + "x-ms-examples": { + "DeleteTwin": { + "$ref": "./examples/DeleteTwin.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "$ref": "#/parameters/if-match" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "patch": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_Update", + "description": "Updates a digital twin.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.\n404 (Not Found): There is no digital twin with the provided id.", + "consumes": [ + "application/json-patch+json" + ], + "x-ms-examples": { + "PatchTwinBasicExample": { + "$ref": "./examples/PatchTwinBasicExample.json" + }, + "PatchTwinAdvancedExample": { + "$ref": "./examples/PatchTwinAdvancedExample.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "name": "patchDocument", + "description": "An update specification described by JSON Patch. Updates to property values and $model elements may happen in the same request. Operations are limited to add, replace and remove.", + "in": "body", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "object" + } + } + }, + { + "$ref": "#/parameters/if-match" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "204": { + "description": "Success", + "headers": { + "ETag": { + "description": "Weak Etag.", + "type": "string" + } + } + }, + "202": { + "description": "Asynchronous Success" + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/digitaltwins/{id}/relationships/{relationshipId}": { + "get": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_GetRelationshipById", + "description": "Retrieves a relationship between two digital twins.\nStatus codes:\n200 (OK): Success.\n404 (Not Found): There is either no digital twin or relationship with the provided id.", + "x-ms-examples": { + "GetRelationshipById": { + "$ref": "./examples/GetRelationshipById.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "$ref": "#/parameters/relationshipId" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "object" + }, + "headers": { + "ETag": { + "description": "Weak Etag.", + "type": "string" + } + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_AddRelationship", + "description": "Adds a relationship between two digital twins.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.\n404 (Not Found): There is either no digital twin, target digital twin, or relationship with the provided id.\n409 (Conflict): A relationship with the provided id already exists.", + "x-ms-examples": { + "CreateRelationshipBasicExample": { + "$ref": "./examples/CreateRelationshipBasicExample.json" + }, + "CreateRelationshipAdvancedExample": { + "$ref": "./examples/CreateRelationshipAdvancedExample.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "$ref": "#/parameters/relationshipId" + }, + { + "name": "relationship", + "in": "body", + "description": "The data for the relationship.", + "required": false, + "schema": { + "type": "object" + } + }, + { + "$ref": "#/parameters/if-none-match-star" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "object" + }, + "headers": { + "ETag": { + "description": "Weak Etag.", + "type": "string" + } + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_DeleteRelationship", + "description": "Deletes a relationship between two digital twins.\nStatus codes:\n200 (OK): Success.\n404 (Not Found): There is either no digital twin or relationship with the provided id.", + "x-ms-examples": { + "DeleteRelationship": { + "$ref": "./examples/DeleteRelationship.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "$ref": "#/parameters/relationshipId" + }, + { + "$ref": "#/parameters/if-match" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "patch": { + "tags": [ + "Twins" + ], + "consumes": [ + "application/json-patch+json" + ], + "operationId": "DigitalTwins_UpdateRelationship", + "description": "Updates the properties on a relationship between two digital twins.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.\n404 (Not Found): There is either no digital twin or relationship with the provided id.", + "x-ms-examples": { + "PatchRelationshipBasicExample": { + "$ref": "./examples/PatchRelationshipBasicExample.json" + }, + "PatchRelationshipAdvancedExample": { + "$ref": "./examples/PatchRelationshipAdvancedExample.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "$ref": "#/parameters/relationshipId" + }, + { + "name": "patchDocument", + "description": "JSON Patch description of the update to the relationship properties.", + "in": "body", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "object" + } + } + }, + { + "$ref": "#/parameters/if-match" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "204": { + "description": "Success", + "headers": { + "ETag": { + "description": "Weak Etag.", + "type": "string" + } + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/digitaltwins/{id}/relationships": { + "get": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_ListRelationships", + "description": "Retrieves the relationships from a digital twin.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.\n404 (Not Found): There is no digital twin with the provided id.", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "GetRelationship": { + "$ref": "./examples/GetRelationship.json" + }, + "GetRelationshipByName": { + "$ref": "./examples/GetRelationshipByRelationshipName.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "name": "relationshipName", + "description": "The name of the relationship.", + "in": "query", + "required": false, + "type": "string" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/RelationshipCollection" + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/digitaltwins/{id}/incomingrelationships": { + "get": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_ListIncomingRelationships", + "description": "Retrieves all incoming relationship for a digital twin.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.\n404 (Not Found): There is no digital twin with the provided id.", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "GetIncomingRelationship": { + "$ref": "./examples/GetIncomingRelationship.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/IncomingRelationshipCollection" + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/digitaltwins/{id}/telemetry": { + "post": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_SendTelemetry", + "description": "Sends telemetry on behalf of a digital twin.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.\n404 (Not Found): There is no digital twin with the provided id.", + "x-ms-examples": { + "SendTelemetry": { + "$ref": "./examples/SendTelemetry.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "name": "telemetry", + "in": "body", + "description": "The telemetry measurements to send from the digital twin.", + "required": true, + "schema": { + "type": "object" + } + }, + { + "name": "dt-id", + "in": "header", + "description": "A unique message identifier (in the scope of the digital twin id) that is commonly used for de-duplicating messages.", + "required": true, + "type": "string" + }, + { + "name": "dt-timestamp", + "in": "header", + "description": "An RFC 3339 timestamp that identifies the time the telemetry was measured.", + "required": false, + "type": "string" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/digitaltwins/{id}/components/{componentPath}/telemetry": { + "post": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_SendComponentTelemetry", + "description": "Sends telemetry on behalf of a component in a digital twin.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.\n404 (Not Found): There is either no digital twin with the provided id or the component path is invalid.", + "x-ms-examples": { + "SendTelemetry": { + "$ref": "./examples/SendTelemetryFromComponent.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "$ref": "#/parameters/componentPath" + }, + { + "name": "telemetry", + "in": "body", + "description": "The telemetry measurements to send from the digital twin's component.", + "required": true, + "schema": { + "type": "object" + } + }, + { + "name": "dt-id", + "in": "header", + "description": "A unique message identifier (in the scope of the digital twin id) that is commonly used for de-duplicating messages.", + "required": true, + "type": "string" + }, + { + "name": "dt-timestamp", + "in": "header", + "description": "An RFC 3339 timestamp that identifies the time the telemetry was measured.", + "required": false, + "type": "string" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/digitaltwins/{id}/components/{componentPath}": { + "get": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_GetComponent", + "description": "Retrieves a component from a digital twin.\nStatus codes:\n200 (OK): Success.\n404 (Not Found): There is either no digital twin with the provided id or the component path is invalid.", + "x-ms-examples": { + "GetComponent": { + "$ref": "./examples/GetComponent.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "$ref": "#/parameters/componentPath" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "object" + }, + "headers": { + "ETag": { + "description": "Weak Etag.", + "type": "string" + } + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "patch": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_UpdateComponent", + "description": "Updates a component on a digital twin.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.\n404 (Not Found): There is either no digital twin with the provided id or the component path is invalid.", + "x-ms-examples": { + "PatchComponentBasicExample": { + "$ref": "./examples/PatchComponentBasicExample.json" + }, + "PatchComponentAdvancedExample": { + "$ref": "./examples/PatchComponentAdvancedExample.json" + } + }, + "consumes": [ + "application/json-patch+json" + ], + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "$ref": "#/parameters/componentPath" + }, + { + "name": "patchDocument", + "description": "An update specification described by JSON Patch. Updates to property values and $model elements may happen in the same request. Operations are limited to add, replace and remove.", + "in": "body", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "object" + } + } + }, + { + "$ref": "#/parameters/if-match" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "204": { + "description": "Success", + "headers": { + "ETag": { + "description": "Weak Etag.", + "type": "string" + } + } + }, + "202": { + "description": "Asynchronous Success" + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/eventroutes": { + "get": { + "tags": [ + "EventRoutes" + ], + "description": "Retrieves all event routes.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.", + "operationId": "EventRoutes_List", + "x-ms-examples": { + "EventRoutesList": { + "$ref": "./examples/EventRoutesList.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/max-item-count" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/EventRouteCollection" + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/eventroutes/{id}": { + "get": { + "tags": [ + "EventRoutes" + ], + "description": "Retrieves an event route.\nStatus codes:\n200 (OK): Success.\n404 (Not Found): There is no event route with the provided id.", + "operationId": "EventRoutes_GetById", + "x-ms-examples": { + "EventRouteGet": { + "$ref": "./examples/EventRouteGet.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/eventRouteId" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/EventRoute" + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "tags": [ + "EventRoutes" + ], + "description": "Adds or replaces an event route.\nStatus codes:\n200 (OK): Success.\n400 (Bad Request): The request is invalid.", + "operationId": "EventRoutes_Add", + "x-ms-examples": { + "EventRoutePut": { + "$ref": "./examples/EventRoutePut.json" + }, + "EventRouteWithFilter": { + "$ref": "./examples/EventRoutePutWithFilter.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/eventRouteId" + }, + { + "name": "eventRoute", + "description": "The event route data", + "in": "body", + "schema": { + "$ref": "#/definitions/EventRoute" + } + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "tags": [ + "EventRoutes" + ], + "description": "Deletes an event route.\nStatus codes:\n200 (OK): Success.\n404 (Not Found): There is no event route with the provided id.", + "operationId": "EventRoutes_Delete", + "x-ms-examples": { + "EventRouteDelete": { + "$ref": "./examples/EventRouteDelete.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/eventRouteId" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + } + }, + "definitions": { + "EventRoute": { + "description": "A route which directs notification and telemetry events to an endpoint. Endpoints are a destination outside of Azure Digital Twins such as an EventHub.", + "type": "object", + "required": [ + "endpointName" + ], + "properties": { + "id": { + "description": "The id of the event route.", + "type": "string", + "readOnly": true + }, + "endpointName": { + "description": "The name of the endpoint this event route is bound to.", + "type": "string" + }, + "filter": { + "description": "An expression which describes the events which are routed to the endpoint.", + "type": "string" + } + } + }, + "EventRouteCollection": { + "description": "A collection of EventRoute objects.", + "type": "object", + "properties": { + "value": { + "description": "The EventRoute objects.", + "type": "array", + "items": { + "$ref": "#/definitions/EventRoute" + } + }, + "nextLink": { + "description": "A URI to retrieve the next page of results.", + "type": "string" + } + } + }, + "NonPagedModelDataCollection": { + "description": "A collection of ModelData objects.", + "type": "array", + "items": { + "$ref": "#/definitions/ModelData" + } + }, + "PagedModelDataCollection": { + "description": "A collection of ModelData objects.", + "type": "object", + "properties": { + "value": { + "description": "The ModelData objects.", + "type": "array", + "items": { + "$ref": "#/definitions/ModelData" + } + }, + "nextLink": { + "description": "A URI to retrieve the next page of objects.", + "type": "string" + } + } + }, + "ModelData": { + "description": "A model definition and metadata for that model.", + "required": [ + "id" + ], + "type": "object", + "properties": { + "displayName": { + "description": "A language map that contains the localized display names as specified in the model definition.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "description": { + "description": "A language map that contains the localized descriptions as specified in the model definition.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "id": { + "description": "The id of the model as specified in the model definition.", + "type": "string" + }, + "uploadTime": { + "description": "The time the model was uploaded to the service.", + "format": "date-time", + "type": "string" + }, + "decommissioned": { + "description": "Indicates if the model is decommissioned. Decommissioned models cannot be referenced by newly created digital twins.", + "type": "boolean", + "default": false + }, + "model": { + "description": "The model definition.", + "type": "object" + } + } + }, + "RelationshipCollection": { + "description": "A collection of relationships which relate digital twins together.", + "type": "object", + "properties": { + "value": { + "description": "The relationship objects.", + "type": "array", + "items": { + "description": "The relationship JSON document.", + "type": "object" + } + }, + "nextLink": { + "description": "A URI to retrieve the next page of objects.", + "type": "string" + } + } + }, + "IncomingRelationshipCollection": { + "description": "A collection of incoming relationships which relate digital twins together.", + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/IncomingRelationship" + } + }, + "nextLink": { + "type": "string", + "description": "A URI to retrieve the next page of objects." + } + } + }, + "IncomingRelationship": { + "type": "object", + "description": "An incoming relationship.", + "properties": { + "$relationshipId": { + "type": "string", + "description": "A user-provided string representing the id of this relationship, unique in the context of the source digital twin, i.e. sourceId + relationshipId is unique in the context of the service." + }, + "$sourceId": { + "type": "string", + "description": "The id of the source digital twin." + }, + "$relationshipName": { + "type": "string", + "description": "The name of the relationship." + }, + "$relationshipLink": { + "type": "string", + "description": "Link to the relationship, to be used for deletion." + } + } + }, + "QuerySpecification": { + "description": "A query specification containing either a query statement or a continuation token from a previous query result.", + "type": "object", + "properties": { + "query": { + "description": "The query to execute. This value is ignored if a continuation token is provided.", + "type": "string" + }, + "continuationToken": { + "description": "A token which is used to retrieve the next set of results from a previous query.", + "type": "string" + } + } + }, + "QueryResult": { + "description": "The results of a query operation and an optional continuation token.", + "type": "object", + "properties": { + "items": { + "description": "The query results.", + "type": "array", + "items": { + "type": "object" + } + }, + "continuationToken": { + "description": "A token which can be used to construct a new QuerySpecification to retrieve the next set of results.", + "type": "string" + } + } + }, + "ErrorResponse": { + "description": "Error response.", + "properties": { + "error": { + "$ref": "#/definitions/Error", + "description": "The error details." + } + } + }, + "Error": { + "description": "Error definition.", + "properties": { + "code": { + "description": "Service specific error code which serves as the substatus for the HTTP error code.", + "type": "string", + "readOnly": true + }, + "message": { + "description": "A human-readable representation of the error.", + "type": "string", + "readOnly": true + }, + "details": { + "description": "Internal error details.", + "type": "array", + "items": { + "$ref": "#/definitions/Error" + }, + "readOnly": true + }, + "innererror": { + "description": "An object containing more specific information than the current object about the error.", + "$ref": "#/definitions/InnerError" + } + } + }, + "InnerError": { + "description": "A more specific error description than was provided by the containing error.", + "properties": { + "code": { + "description": "A more specific error code than was provided by the containing error.", + "type": "string" + }, + "innererror": { + "description": "An object containing more specific information than the current object about the error.", + "$ref": "#/definitions/InnerError" + } + } + } + }, + "securityDefinitions": { + "oauth2": { + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize?resource=0b07f429-9f4b-4714-9392-cc5e8e80c8b0", + "type": "oauth2" + } + }, + "parameters": { + "eventRouteId": { + "name": "id", + "in": "path", + "required": true, + "type": "string", + "description": "The id for an event route. The id is unique within event routes and case sensitive.", + "x-ms-parameter-location": "method" + }, + "includeModelDefinition": { + "name": "includeModelDefinition", + "description": "When true the model definition will be returned as part of the result.", + "in": "query", + "required": false, + "type": "boolean", + "default": false, + "x-ms-parameter-location": "method" + }, + "digitalTwinId": { + "name": "id", + "in": "path", + "description": "The id of the digital twin. The id is unique within the service and case sensitive.", + "type": "string", + "required": true, + "x-ms-parameter-location": "method" + }, + "modelId": { + "name": "id", + "in": "path", + "description": "The id for the model. The id is globally unique and case sensitive.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "relationshipId": { + "name": "relationshipId", + "description": "The id of the relationship. The id is unique within the digital twin and case sensitive.", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "componentPath": { + "name": "componentPath", + "in": "path", + "description": "The name of the DTDL component.", + "type": "string", + "required": true, + "x-ms-parameter-location": "method" + }, + "api-version": { + "name": "api-version", + "in": "query", + "description": "The requested API version.", + "required": true, + "type": "string", + "enum": [ + "2020-05-31-preview" + ] + }, + "max-item-count": { + "name": "x-ms-max-item-count", + "in": "header", + "description": "The maximum number of items to retrieve per request. The server may choose to return less than the requested max.", + "required": false, + "type": "integer", + "default": -1, + "x-ms-client-name": "MaxItemCount", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "postfix": "Options" + } + }, + "if-none-match-star": { + "name": "If-None-Match", + "in": "header", + "description": "Only perform the operation if the entity does not already exist.", + "required": false, + "type": "string", + "enum": [ + "*" + ], + "x-ms-parameter-location": "method" + }, + "if-match": { + "name": "If-Match", + "in": "header", + "description": "Only perform the operation if the entity's etag matches one of the etags provided or * is provided.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + } + }, + "security": [ + { + "oauth2": [] + } + ] +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/CreateRelationshipAdvancedExample.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/CreateRelationshipAdvancedExample.json new file mode 100644 index 000000000000..1f6ec28e906c --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/CreateRelationshipAdvancedExample.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "api-version": "2020-05-31-preview", + "id": "mySourceTwin", + "relationshipId": "myRelationshipId", + "relationship": { + "$targetId": "myTargetTwin", + "$relationshipName": "myRelationship", + "relationshipProperty1": 1, + "relationshipProperty2": "some value" + } + }, + "responses": { + "200": { + "body": { + "$relationshipId": "myRelationshipId", + "$sourceId": "mySourceTwin", + "$targetId": "myTargetTwin", + "$relationshipName": "myRelationship", + "relationshipProperty1": 1, + "relationshipProperty2": "some value" + } + } + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/CreateRelationshipBasicExample.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/CreateRelationshipBasicExample.json new file mode 100644 index 000000000000..5ab5127bfb36 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/CreateRelationshipBasicExample.json @@ -0,0 +1,21 @@ +{ + "parameters": { + "api-version": "2020-05-31-preview", + "id": "mySourceTwin", + "relationshipId": "myRelationshipId", + "relationship": { + "$targetId": "myTargetTwin", + "$relationshipName": "myRelationship" + } + }, + "responses": { + "200": { + "body": { + "$relationshipId": "myRelationshipId", + "$sourceId": "mySourceTwin", + "$targetId": "myTargetTwin", + "$relationshipName": "myRelationship" + } + } + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/DeleteModel.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/DeleteModel.json new file mode 100644 index 000000000000..4a0428b03fb4 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/DeleteModel.json @@ -0,0 +1,9 @@ +{ + "parameters": { + "api-version": "2020-05-31-preview", + "id": "dtmi:com:example:Sample;1" + }, + "responses": { + "204": {} + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/DeleteRelationship.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/DeleteRelationship.json new file mode 100644 index 000000000000..d9acb6cc90a8 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/DeleteRelationship.json @@ -0,0 +1,10 @@ +{ + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myTwinId", + "relationshipId": "myRelationshipId" + }, + "responses": { + "204": {} + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/DeleteTwin.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/DeleteTwin.json new file mode 100644 index 000000000000..bb55048e32c3 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/DeleteTwin.json @@ -0,0 +1,9 @@ +{ + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myTwinId" + }, + "responses": { + "204": {} + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/EventRouteDelete.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/EventRouteDelete.json new file mode 100644 index 000000000000..2ca8cfd3f824 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/EventRouteDelete.json @@ -0,0 +1,9 @@ +{ + "parameters": { + "id": "eventroute-001", + "api-version": "2020-05-31-preview" + }, + "responses": { + "204": {} + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/EventRouteGet.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/EventRouteGet.json new file mode 100644 index 000000000000..be0dc040a850 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/EventRouteGet.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "id": "eventroute-001", + "api-version": "2020-05-31-preview" + }, + "responses": { + "200": { + "body": { + "id": "eventroute-001", + "endpointName": "endpoint-001", + "filter": "type = 'Microsoft.DigitalTwins.Twin.Create'" + } + } + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/EventRoutePut.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/EventRoutePut.json new file mode 100644 index 000000000000..b652891c1b31 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/EventRoutePut.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "id": "eventroute-001", + "eventRoute": { + "endpointName": "endpoint-001", + "filter": "true" + }, + "api-version": "2020-05-31-preview" + }, + "responses": { + "204": {} + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/EventRoutePutWithFilter.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/EventRoutePutWithFilter.json new file mode 100644 index 000000000000..21f265e6ca92 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/EventRoutePutWithFilter.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "id": "eventroute-001", + "eventRoute": { + "endpointName": "endpoint-001", + "filter": "type = 'Microsoft.DigitalTwins.Twin.Create'" + }, + "api-version": "2020-05-31-preview" + }, + "responses": { + "204": {} + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/EventRoutesList.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/EventRoutesList.json new file mode 100644 index 000000000000..44c31910f394 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/EventRoutesList.json @@ -0,0 +1,24 @@ +{ + "parameters": { + "api-version": "2020-05-31-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "eventroute-001", + "endpointName": "endpoint-001", + "filter": "type = 'Microsoft.DigitalTwins.Twin.Create'" + }, + { + "id": "eventroute-002", + "endpointName": "endpoint-002", + "filter": "type = 'Microsoft.DigitalTwins.Twin.Create' OR type = 'microsoft.iot.telemetry'" + } + ], + "nextLink": "url-to-next-page" + } + } + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/GetComponent.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/GetComponent.json new file mode 100644 index 000000000000..655246856feb --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/GetComponent.json @@ -0,0 +1,53 @@ +{ + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myTwinId", + "componentPath": "myComponent" + }, + "responses": { + "200": { + "body": { + "$metadata": { + "$model": "dtmi:com:example:interfaces:interfaceName;1", + "property1": { + "desiredValue": 1, + "desiredVersion": 1, + "ackVersion": 1, + "ackCode": 200, + "ackDescription": "description", + "lastUpdateTime": "2020-05-23T21:44:02Z" + }, + "property2": { + "desiredValue": { + "subProperty1": "some value", + "subProperty2": "some other value" + }, + "desiredVersion": 1, + "ackVersion": 1, + "ackCode": 200, + "ackDescription": "description", + "lastUpdateTime": "2020-05-23T21:44:02Z" + } + }, + "property1": 1, + "property2": { + "subProperty1": "some value", + "subProperty2": "some other value" + }, + "component1": { + "$metadata": { + "$model": "dtmi:com:example:interfaces:subInterfaceName;1", + "componentProperty": { + "desiredValue": "some value", + "desiredVersion": 1, + "ackVersion": 1, + "ackCode": 200, + "ackDescription": "description", + "lastUpdateTime": "2020-05-23T21:44:02Z" + } + } + } + } + } + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/GetIncomingRelationship.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/GetIncomingRelationship.json new file mode 100644 index 000000000000..a50ceb94c675 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/GetIncomingRelationship.json @@ -0,0 +1,27 @@ +{ + "parameters": { + "api-version": "2020-05-31-preview", + "id": "mySourceTwin" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "$sourceId": "mySourceTwin", + "$relationshipId": "firstRelationshipId", + "$relationshipName": "myRelationship", + "$relationshipLink": "/digitaltwins/mySourceTwin/relationships/myRelationship/firstRelationshipId" + }, + { + "$sourceId": "mySourceTwin", + "$relationshipId": "secondRelationshipId", + "$relationshipName": "myRelationship", + "$relationshipLink": "/digitaltwins/mySourceTwin/relationships/myRelationship/secondRelationshipId" + } + ], + "nextLink": "url-to-next-page" + } + } + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/GetRelationship.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/GetRelationship.json new file mode 100644 index 000000000000..259950edf17d --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/GetRelationship.json @@ -0,0 +1,29 @@ +{ + "parameters": { + "api-version": "2020-05-31-preview", + "id": "mySourceTwin" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "$sourceId": "mySourceTwin", + "$relationshipId": "firstRelationshipId", + "$targetId": "targetTwinId", + "$relationshipName": "myRelationship", + "property": "value" + }, + { + "$sourceId": "mySourceTwin", + "$relationshipId": "secondRelationshipId", + "$targetId": "targetTwinId", + "$relationshipName": "myRelationship", + "property": "value" + } + ], + "nextLink": "url-to-next-page" + } + } + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/GetRelationshipById.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/GetRelationshipById.json new file mode 100644 index 000000000000..28a5a08c9784 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/GetRelationshipById.json @@ -0,0 +1,18 @@ +{ + "parameters": { + "api-version": "2020-05-31-preview", + "id": "mySourceTwin", + "relationshipId": "myRelationshipId" + }, + "responses": { + "200": { + "body": { + "$relationshipId": "myRelationshipId", + "$sourceId": "mySourceTwin", + "$targetId": "myTargetTwin", + "$relationshipName": "myRelationship", + "relationshipProperty": "some value" + } + } + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/GetRelationshipByRelationshipName.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/GetRelationshipByRelationshipName.json new file mode 100644 index 000000000000..591dc7ae4b71 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/GetRelationshipByRelationshipName.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "api-version": "2020-05-31-preview", + "id": "mySourceTwin", + "relationshipName": "myRelationship" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "$sourceId": "mySourceTwin", + "$relationshipId": "firstRelationshipId", + "$targetId": "targetTwinId", + "$relationshipName": "myRelationship", + "property": "value" + }, + { + "$sourceId": "mySourceTwin", + "$relationshipId": "secondRelationshipId", + "$targetId": "targetTwinId", + "$relationshipName": "myRelationship", + "property": "value" + } + ], + "nextLink": "url-to-next-page" + } + } + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/GetTwin.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/GetTwin.json new file mode 100644 index 000000000000..7dce0f94a6e8 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/GetTwin.json @@ -0,0 +1,53 @@ +{ + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myTwinId" + }, + "responses": { + "200": { + "body": { + "$dtId": "myTwinId", + "$metadata": { + "$model": "dtmi:com:example:interfaces:interfaceName;1", + "property1": { + "desiredValue": 1, + "desiredVersion": 1, + "ackVersion": 1, + "ackCode": 200, + "ackDescription": "description", + "lastUpdateTime": "2020-05-23T21:44:02Z" + }, + "property2": { + "desiredValue": { + "subProperty1": "some value", + "subProperty2": "some other value" + }, + "desiredVersion": 1, + "ackVersion": 1, + "ackCode": 200, + "ackDescription": "description", + "lastUpdateTime": "2020-05-23T21:44:02Z" + } + }, + "property1": 1, + "property2": { + "subProperty1": "some value", + "subProperty2": "some other value" + }, + "component1": { + "$metadata": { + "$model": "dtmi:com:example:interfaces:subInterfaceName;1", + "componentProperty": { + "desiredValue": "some value", + "desiredVersion": 1, + "ackVersion": 1, + "ackCode": 200, + "ackDescription": "description", + "lastUpdateTime": "2020-05-23T21:44:02Z" + } + } + } + } + } + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/ModelAdd.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/ModelAdd.json new file mode 100644 index 000000000000..b376ddb14860 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/ModelAdd.json @@ -0,0 +1,47 @@ +{ + "parameters": { + "models": [ + { + "@id": "dtmi:com:example:Sample;1", + "@type": "Interface", + "displayName": "Sample Interface", + "contents": [ + { + "@type": "Property", + "name": "name", + "displayName": "Sample instance name", + "schema": "string" + }, + { + "@type": "Property", + "name": "temp", + "displayName": "Sample instance temperature", + "schema": "integer" + }, + { + "@type": "Property", + "name": "comfortIndex", + "displayName": "Sample instance comfort index", + "schema": "integer" + } + ], + "@context": "dtmi:dtdl:context;2" + } + ], + "api-version": "2020-05-31-preview" + }, + "responses": { + "200": { + "body": [ + { + "id": "dtmi:com:example:Sample;1", + "displayName": { + "en": "Sample Interface" + }, + "uploadTime": "2020-03-01T17:32:28Z", + "decommissioned": false + } + ] + } + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/ModelGetById.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/ModelGetById.json new file mode 100644 index 000000000000..6de5d0f71a6e --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/ModelGetById.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "id": "dtmi:com:example:Sample;1", + "api-version": "2020-05-31-preview" + }, + "responses": { + "200": { + "body": { + "id": "dtmi:com:example:Sample;1", + "uploadTime": "2020-03-01T17:32:28Z", + "decommissioned": false + } + } + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/ModelGetByIdWithIncludeModelDefinition.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/ModelGetByIdWithIncludeModelDefinition.json new file mode 100644 index 000000000000..da0330cc5288 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/ModelGetByIdWithIncludeModelDefinition.json @@ -0,0 +1,41 @@ +{ + "parameters": { + "id": "dtmi:com:example:Sample;1", + "includeModelDefinition": true, + "api-version": "2020-05-31-preview" + }, + "responses": { + "200": { + "body": { + "id": "dtmi:com:example:Sample;1", + "uploadTime": "2020-03-01T17:32:28Z", + "decommissioned": false, + "model": { + "@id": "dtmi:com:example:Sample;1", + "@type": "Interface", + "contents": [ + { + "@type": "Property", + "name": "name", + "displayName": "Sample instance name", + "schema": "string" + }, + { + "@type": "Property", + "name": "temp", + "displayName": "Sample instance temperature", + "schema": "integer" + }, + { + "@type": "Property", + "name": "comfortIndex", + "displayName": "Sample instance comfort index", + "schema": "integer" + } + ], + "@context": "dtmi:dtdl:context;2" + } + } + } + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/ModelUpdateDecommissioned.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/ModelUpdateDecommissioned.json new file mode 100644 index 000000000000..513e272d1f54 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/ModelUpdateDecommissioned.json @@ -0,0 +1,16 @@ +{ + "parameters": { + "id": "dtmi:com:example:Sample;1", + "updateModel": [ + { + "op": "replace", + "path": "/decommissioned", + "value": true + } + ], + "api-version": "2020-05-31-preview" + }, + "responses": { + "204": {} + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/ModelsGet.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/ModelsGet.json new file mode 100644 index 000000000000..e4fd22da2eec --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/ModelsGet.json @@ -0,0 +1,35 @@ +{ + "parameters": { + "api-version": "2020-05-31-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "dtmi:com:example:Sample;1", + "uploadTime": "2020-03-01T17:32:28Z", + "decommissioned": false + }, + { + "id": "dtmi:com:example:SampleDeviceModel;1", + "displayName": { + "en": "My Device Model" + }, + "uploadTime": "2020-05-01T17:32:28Z", + "decommissioned": false + }, + { + "id": "dtmi:com:example:AnotherSample;1", + "displayName": { + "en": "My Sample" + }, + "uploadTime": "2020-03-01T17:32:28Z", + "decommissioned": false + } + ], + "nextLink": "url-to-next-page" + } + } + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/ModelsGetWithDependenciesAndIncludeModelDefinition.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/ModelsGetWithDependenciesAndIncludeModelDefinition.json new file mode 100644 index 000000000000..72f41ae288cd --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/ModelsGetWithDependenciesAndIncludeModelDefinition.json @@ -0,0 +1,70 @@ +{ + "parameters": { + "includeModelDefinition": true, + "dependenciesFor": [ + "dtmi:com:example:SampleDeviceModel;1" + ], + "x-ms-max-item-count": 20, + "api-version": "2020-05-31-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "dtmi:com:example:Sample;1", + "uploadTime": "2020-03-01T17:32:28Z", + "decommissioned": false, + "model": { + "@id": "dtmi:com:example:Sample;1", + "@type": "Interface", + "contents": [ + { + "@type": "Property", + "name": "name", + "displayName": "Sample instance name", + "schema": "string" + }, + { + "@type": "Property", + "name": "temp", + "displayName": "Sample instance temperature", + "schema": "integer" + }, + { + "@type": "Property", + "name": "comfortIndex", + "displayName": "Sample instance comfort index", + "schema": "integer" + } + ], + "@context": "dtmi:dtdl:context;2" + } + }, + { + "id": "dtmi:com:example:SampleDeviceModel;1", + "displayName": { + "en": "My Device Model" + }, + "uploadTime": "2020-03-01T17:32:28Z", + "decommissioned": false, + "model": { + "@id": "dtmi:com:example:SampleDeviceModel;1", + "@type": "Interface", + "displayName": "My Device Model", + "contents": [ + { + "@type": "Component", + "name": "Sample", + "schema": "dtmi:com:example:Sample;1" + } + ], + "@context": "dtmi:dtdl:context;2" + } + } + ], + "nextLink": "url-to-next-page" + } + } + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/PatchComponentAdvancedExample.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/PatchComponentAdvancedExample.json new file mode 100644 index 000000000000..195387a5d378 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/PatchComponentAdvancedExample.json @@ -0,0 +1,27 @@ +{ + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myTwinId", + "componentPath": "myComponent", + "patchDocument": [ + { + "op": "add", + "path": "/property1", + "value": 1 + }, + { + "op": "remove", + "path": "/property2" + }, + { + "op": "replace", + "path": "/property3/subProperty1", + "value": "new value" + } + ] + }, + "responses": { + "202": {}, + "204": {} + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/PatchComponentBasicExample.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/PatchComponentBasicExample.json new file mode 100644 index 000000000000..c2a0624b8c35 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/PatchComponentBasicExample.json @@ -0,0 +1,18 @@ +{ + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myTwinId", + "componentPath": "myComponent", + "patchDocument": [ + { + "op": "add", + "path": "/property", + "value": 1 + } + ] + }, + "responses": { + "202": {}, + "204": {} + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/PatchRelationshipAdvancedExample.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/PatchRelationshipAdvancedExample.json new file mode 100644 index 000000000000..59e611092081 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/PatchRelationshipAdvancedExample.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myTwinId", + "relationshipId": "myRelationshipId", + "patchDocument": [ + { + "op": "add", + "path": "/property1", + "value": 1 + }, + { + "op": "remove", + "path": "/property2" + }, + { + "op": "replace", + "path": "/property3/subProperty1", + "value": "new value" + } + ] + }, + "responses": { + "204": {} + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/PatchRelationshipBasicExample.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/PatchRelationshipBasicExample.json new file mode 100644 index 000000000000..f5294ae496de --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/PatchRelationshipBasicExample.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myTwinId", + "relationshipId": "myRelationshipId", + "patchDocument": [ + { + "op": "add", + "path": "/property", + "value": 1 + } + ] + }, + "responses": { + "204": {} + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/PatchTwinAdvancedExample.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/PatchTwinAdvancedExample.json new file mode 100644 index 000000000000..3a33baa321bb --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/PatchTwinAdvancedExample.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myNewTwinId", + "patchDocument": [ + { + "op": "replace", + "path": "/property1", + "value": 1 + }, + { + "op": "add", + "path": "/property2/subProperty1", + "value": 1 + }, + { + "op": "remove", + "path": "/property3" + } + ] + }, + "responses": { + "202": {}, + "204": {} + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/PatchTwinBasicExample.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/PatchTwinBasicExample.json new file mode 100644 index 000000000000..477251dce783 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/PatchTwinBasicExample.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myNewTwinId", + "patchDocument": [ + { + "op": "replace", + "path": "/property1", + "value": 1 + } + ] + }, + "responses": { + "202": {}, + "204": {} + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/PutTwinAdvancedExample.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/PutTwinAdvancedExample.json new file mode 100644 index 000000000000..7639f575e1dc --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/PutTwinAdvancedExample.json @@ -0,0 +1,71 @@ +{ + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myNewTwinId", + "If-None-Match": "*", + "twin": { + "$metadata": { + "$model": "dtmi:com:example:interfaces:interfaceName;1" + }, + "property1": 1, + "property2": { + "subProperty1": "some value", + "subProperty2": "some other value" + }, + "component1": { + "$metadata": { + "$model": "dtmi:com:example:interfaces:subInterfaceName;1" + }, + "componentProperty": "some value" + } + } + }, + "responses": { + "200": { + "body": { + "$dtId": "myNewTwinId", + "$metadata": { + "$model": "dtmi:com:example:interfaces:interfaceName;1", + "property1": { + "desiredValue": 1, + "desiredVersion": 1, + "ackVersion": 1, + "ackCode": 200, + "ackDescription": "description", + "lastUpdateTime": "2020-05-23T21:44:02Z" + }, + "property2": { + "desiredValue": { + "subProperty1": "some value", + "subProperty2": "some other value" + }, + "desiredVersion": 1, + "ackVersion": 1, + "ackCode": 200, + "ackDescription": "description", + "lastUpdateTime": "2020-05-23T21:44:02Z" + } + }, + "property1": 1, + "property2": { + "subProperty1": "some value", + "subProperty2": "some other value" + }, + "component1": { + "$metadata": { + "$model": "dtmi:com:example:interfaces:subInterfaceName;1", + "componentProperty": { + "desiredValue": "some value", + "desiredVersion": 1, + "ackVersion": 1, + "ackCode": 200, + "ackDescription": "description", + "lastUpdateTime": "2020-05-23T21:44:02Z" + } + } + } + } + }, + "202": {} + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/PutTwinBasicExample.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/PutTwinBasicExample.json new file mode 100644 index 000000000000..b1ee99c8ecfc --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/PutTwinBasicExample.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myNewTwinId", + "twin": { + "$metadata": { + "$model": "dtmi:com:example:interfaces:interfaceName;1" + } + } + }, + "responses": { + "200": { + "body": { + "$dtId": "myNewTwinId", + "$metadata": { + "$model": "dtmi:com:example:interfaces:interfaceName;1" + } + } + }, + "202": {} + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/QueryFirstPage.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/QueryFirstPage.json new file mode 100644 index 000000000000..fe1106c5608b --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/QueryFirstPage.json @@ -0,0 +1,44 @@ +{ + "parameters": { + "querySpecification": { + "query": "SELECT * FROM DIGITALTWINS WHERE temp = 79" + }, + "api-version": "2020-05-31-preview" + }, + "responses": { + "200": { + "body": { + "items": [ + { + "$dtId": "Twin-01", + "$metadata": { + "$model": "dtmi:com:example:Sample;1" + }, + "name": "Sample01", + "temp": 79, + "comfortIndex": 50 + }, + { + "$dtId": "Twin-02", + "$metadata": { + "$model": "dtmi:com:example:Sample;1" + }, + "name": "Sample02", + "temp": 79, + "comfortIndex": 50 + }, + { + "$dtId": "Twin-03", + "$metadata": { + "$model": "dtmi:com:example:Sample;1" + }, + "name": "Sample03", + "temp": 79, + "comfortIndex": 50 + } + ], + "continuationToken": "" + } + } + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/QueryJoin.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/QueryJoin.json new file mode 100644 index 000000000000..d40910417c06 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/QueryJoin.json @@ -0,0 +1,56 @@ +{ + "parameters": { + "querySpecification": { + "query": "SELECT Widget, Gadget FROM DIGITALTWINS Widget JOIN Gadget RELATED Widget.Contains WHERE Widget.$dtId = 'Twin-01'" + }, + "api-version": "2020-05-31-preview" + }, + "responses": { + "200": { + "body": { + "items": [ + { + "Widget": { + "$dtId": "Twin-01", + "$metadata": { + "$model": "dtmi:com:example:Sample;1" + }, + "name": "Sample01", + "temp": 79, + "comfortIndex": 50 + }, + "Gadget": { + "$dtId": "Twin-02", + "$metadata": { + "$model": "dtmi:com:example:Sample;1" + }, + "name": "Sample02", + "temp": 79, + "comfortIndex": 50 + } + }, + { + "Widget": { + "$dtId": "Twin-01", + "$metadata": { + "$model": "dtmi:com:example:Sample;1" + }, + "name": "Sample01", + "temp": 79, + "comfortIndex": 50 + }, + "Gadget": { + "$dtId": "Twin-10", + "$metadata": { + "$model": "dtmi:com:example:Sample;1" + }, + "name": "Sample10", + "temp": 79, + "comfortIndex": 50 + } + } + ] + } + } + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/QueryNextPage.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/QueryNextPage.json new file mode 100644 index 000000000000..d7ecc8ad39c6 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/QueryNextPage.json @@ -0,0 +1,43 @@ +{ + "parameters": { + "querySpecification": { + "continuationToken": "" + }, + "api-version": "2020-05-31-preview" + }, + "responses": { + "200": { + "body": { + "items": [ + { + "$dtId": "Twin-04", + "$metadata": { + "$model": "dtmi:com:example:Sample;1" + }, + "name": "Sample04", + "temp": 79, + "comfortIndex": 50 + }, + { + "$dtId": "Twin-05", + "$metadata": { + "$model": "dtmi:com:example:Sample;1" + }, + "name": "Sample05", + "temp": 79, + "comfortIndex": 50 + }, + { + "$dtId": "Twin-06", + "$metadata": { + "$model": "dtmi:com:example:Sample;1" + }, + "name": "Sample06", + "temp": 79, + "comfortIndex": 50 + } + ] + } + } + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/SendTelemetry.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/SendTelemetry.json new file mode 100644 index 000000000000..941a77beffa3 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/SendTelemetry.json @@ -0,0 +1,14 @@ +{ + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myTwinId", + "dt-id": "e5ca50dd-ca31-4fae-8d84-3af5a72b10c5", + "dt-timestamp": "1985-04-12T23:20:50.52Z", + "telemetry": { + "temperature": 1 + } + }, + "responses": { + "204": {} + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/SendTelemetryFromComponent.json b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/SendTelemetryFromComponent.json new file mode 100644 index 000000000000..dfec5fa53273 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/examples/SendTelemetryFromComponent.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "api-version": "2020-05-31-preview", + "id": "myTwinId", + "componentPath": "myComponent", + "dt-id": "e5ca50dd-ca31-4fae-8d84-3af5a72b10c5", + "dt-timestamp": "1985-04-12T23:20:50.52Z", + "telemetry": { + "temperature": 1 + } + }, + "responses": { + "204": {} + } +} diff --git a/sdk/digitaltwins/ci.yml b/sdk/digitaltwins/ci.yml new file mode 100644 index 000000000000..dec3ade9462a --- /dev/null +++ b/sdk/digitaltwins/ci.yml @@ -0,0 +1,36 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. +trigger: + branches: + include: + - master + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/digitaltwins/ + exclude: + - sdk/digitaltwins/mgmt-v2020_03_01_preview + +pr: + branches: + include: + - master + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/digitaltwins/ + exclude: + - sdk/digitaltwins/mgmt-v2020_03_01_preview + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: digitaltwins + Artifacts: + - name: azure-digitaltwins-core + groupId: com.azure + safeName: azuredigitaltwinscore \ No newline at end of file diff --git a/sdk/digitaltwins/pom.xml b/sdk/digitaltwins/pom.xml new file mode 100644 index 000000000000..15548b437b08 --- /dev/null +++ b/sdk/digitaltwins/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + com.azure + azure-digitaltwins-core + pom + 1.0.0 + + azure-digitaltwins-core + + diff --git a/sdk/digitaltwins/remove-test-resources-pre.ps1 b/sdk/digitaltwins/remove-test-resources-pre.ps1 new file mode 100644 index 000000000000..1b328f822815 --- /dev/null +++ b/sdk/digitaltwins/remove-test-resources-pre.ps1 @@ -0,0 +1,51 @@ +# # Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +# IMPORTANT: Do not invoke this file directly. Please instead run eng/Remove-TestResources.ps1 from the repository root. + +#Requires -Version 6.0 +#Requires -PSEdition Core + +# Use same parameter names as declared in eng/Remove-TestResources.ps1 (assume validation therein). +[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Medium')] +param ( + [Parameter(Mandatory = $true)] + [string] $ResourceGroupName, + + + [ValidateNotNullOrEmpty()] + [string] $TenantId, + + [ValidatePattern('^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$')] + [string] $SubscriptionId, + + [ValidatePattern('^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$')] + [string] $ProvisionerApplicationId, + + [Parameter(ParameterSetName = 'ResourceGroup+Provisioner', Mandatory = $true)] + [string] $ProvisionerApplicationSecret, + + # Captures any arguments from eng/Remove-TestResources.ps1 not declared here (no parameter errors). + [Parameter(ValueFromRemainingArguments = $true)] + $RemainingArguments +) + +function Log($Message) { + Write-Host ('{0} - {1}' -f [DateTime]::Now.ToLongTimeString(), $Message) +} + +Log "Logging into service principal '$ProvisionerApplicationId'" + +az login --service-principal -u $ProvisionerApplicationId -p $ProvisionerApplicationSecret --tenant $TenantId +az account set --subscription $SubscriptionId + +Log "Running pre removal script for resource group $ResourceGroupName" + +$adtInstanceName = az rest --method get --uri "/subscriptions/$SubscriptionId/resourceGroups/$ResourceGroupName/providers/Microsoft.DigitalTwins/digitalTwinsInstances?api-version=2020-03-01-preview" --query "value[*].{Name:name}" --output tsv + +if (![string]::IsNullOrWhiteSpace($adtInstanceName)) { + Write-Verbose "remove-test-resources-pre.ps1: Deleting configured endpoint on '$adtInstanceName' ADT instance to avoid issues during deletion of '$ResourceGroupName' resource group" + az rest --method delete --uri "/subscriptions/$SubscriptionId/resourceGroups/$ResourceGroupName/providers/Microsoft.DigitalTwins/digitalTwinsInstances/$adtInstanceName/endpoints/someEventHubEndpoint?api-version=2020-03-01-preview" +} + +az logout \ No newline at end of file diff --git a/sdk/digitaltwins/test-resources.json b/sdk/digitaltwins/test-resources.json new file mode 100644 index 000000000000..90b11322185f --- /dev/null +++ b/sdk/digitaltwins/test-resources.json @@ -0,0 +1,155 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "baseName": { + "type": "string", + "minLength": 6, + "maxLength": 50, + "defaultValue": "[resourceGroup().name]", + "metadata": { + "description": "The base resource name." + } + }, + "testApplicationOid": { + "type": "string", + "metadata": { + "description": "The client OID to grant access to test resources." + } + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "The location of the resource. By default, this is the same as the resource group." + } + } + }, + "variables": { + "digitalTwinInstanceResourceId": "[resourceId('Microsoft.DigitalTwins/digitalTwinsInstances', parameters('baseName'))]", + "namespaceResourceId": "[resourceId('Microsoft.EventHub/namespaces', parameters('baseName'))]", + "eventHubResourceId": "[resourceId('Microsoft.EventHub/namespaces/eventhubs', parameters('baseName'), parameters('baseName'))]", + "eventHubAuthorizationResourceId": "[resourceId('Microsoft.EventHub/namespaces/eventhubs/authorizationRules', parameters('baseName'), parameters('baseName'), 'owner')]", + "rbacOwnerRoleDefinitionId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', '8e3af657-a8ff-443c-a75c-2fe8c4bcb635')]", + "AdtOwnerRoleDefinitionId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', 'bcd981a7-7f74-457b-83e1-cceb9e632ffe')]" + }, + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2018-09-01-preview", + "name": "[guid(resourceGroup().id)]", + "properties": { + "roleDefinitionId": "[variables('rbacOwnerRoleDefinitionId')]", + "principalId": "[parameters('testApplicationOid')]" + } + }, + { + "type": "Microsoft.DigitalTwins/digitalTwinsInstances", + "apiVersion": "2020-03-01-preview", + "name": "[parameters('baseName')]", + "location": "[parameters('location')]", + "sku": { + "name": "S1" + }, + "properties": {} + }, + { + "type": "Microsoft.DigitalTwins/digitalTwinsInstances/providers/roleAssignments", + "apiVersion": "2020-03-01-preview", + "name": "[concat(parameters('baseName'),'/Microsoft.Authorization/', guid(uniqueString(parameters('baseName'))))]", + "properties": { + "roleDefinitionId": "[variables('AdtOwnerRoleDefinitionId')]", + "principalId": "[parameters('testApplicationOid')]" + }, + "dependsOn": [ + "[variables('digitalTwinInstanceResourceId')]" + ] + }, + { + "type": "Microsoft.EventHub/namespaces", + "apiVersion": "2018-01-01-preview", + "name": "[parameters('baseName')]", + "location": "[parameters('location')]", + "sku": { + "name": "Standard", + "tier": "Standard", + "capacity": 1 + }, + "properties": { + "zoneRedundant": false, + "isAutoInflateEnabled": false, + "maximumThroughputUnits": 0, + "kafkaEnabled": true + } + }, + { + "type": "Microsoft.EventHub/namespaces/eventhubs", + "apiVersion": "2017-04-01", + "name": "[concat(parameters('baseName'), '/', parameters('baseName'))]", + "location": "[parameters('location')]", + "dependsOn": [ + "[variables('namespaceResourceId')]" + ], + "properties": { + "messageRetentionInDays": 7, + "partitionCount": 4, + "status": "Active" + } + }, + { + "type": "Microsoft.EventHub/namespaces/AuthorizationRules", + "apiVersion": "2017-04-01", + "name": "[concat(parameters('baseName'), '/RootManageSharedAccessKey')]", + "location": "[parameters('location')]", + "dependsOn": [ + "[variables('namespaceResourceId')]" + ], + "properties": { + "rights": [ + "Listen", + "Manage", + "Send" + ] + } + }, + { + "type": "Microsoft.EventHub/namespaces/eventhubs/authorizationRules", + "apiVersion": "2017-04-01", + "name": "[concat(parameters('baseName'), '/', parameters('baseName'), '/owner')]", + "location": "[parameters('location')]", + "dependsOn": [ + "[variables('namespaceResourceId')]", + "[variables('eventHubResourceId')]" + ], + "properties": { + "rights": [ + "Manage", + "Send", + "Listen" + ] + } + }, + { + "type": "Microsoft.DigitalTwins/digitalTwinsInstances/endpoints", + "apiVersion": "2020-03-01-preview", + "name": "[concat(parameters('baseName'), '/someEventHubEndpoint')]", + "dependsOn": [ + "[variables('digitalTwinInstanceResourceId')]", + "[variables('namespaceResourceId')]", + "[variables('eventHubResourceId')]", + "[variables('eventHubAuthorizationResourceId')]" + ], + "properties": { + "endpointType": "EventHub", + "connectionString-PrimaryKey": "[listKeys(variables('eventHubAuthorizationResourceId'),'2017-04-01').primaryConnectionString]", + "connectionString-SecondaryKey": "[listKeys(variables('eventHubAuthorizationResourceId'),'2017-04-01').secondaryConnectionString]" + } + } + ], + "outputs": { + "DIGITALTWINS_ADT_INSTANCE_ENDPOINT_URL": { + "type": "string", + "value": "[concat('https://', reference(variables('digitalTwinInstanceResourceId'), '2020-03-01-preview').hostName)]" + } + } +} diff --git a/sdk/digitaltwins/tests.yml b/sdk/digitaltwins/tests.yml new file mode 100644 index 000000000000..b07ab1f79b18 --- /dev/null +++ b/sdk/digitaltwins/tests.yml @@ -0,0 +1,11 @@ +trigger: none + +extends: + template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + parameters: + ServiceDirectory: digitaltwins + Location: westus2 + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources-preview) + EnvVars: + # Runs live tests. + AZURE_IOT_TEST_MODE: Live \ No newline at end of file