diff --git a/src/swagger-generation/config-beta.yml b/src/swagger-generation/config-beta.yml index ae3694b..f6170f0 100644 --- a/src/swagger-generation/config-beta.yml +++ b/src/swagger-generation/config-beta.yml @@ -258,3 +258,29 @@ EntityTypes: - Name: microsoft.graph.entity ReadOnly: - id + - Name: microsoft.graph.subscription + RootUri: /subscriptions + AvailableProperty: + - applicationId + - changeType + - clientState + - creatorId + - encryptionCertificate + - encryptionCertificateId + - expirationDateTime + - includeResourceData + - latestSupportedTlsVersion + - lifecycleNotificationUrl + - notificationContentType + - notificationQueryOptions + - notificationUrl + - notificationUrlAppId + - resource + RequiredOnWrite: + - changeType + - expirationDateTime + - notificationUrl + - resource + ReadOnly: + - applicationId + - creatorId \ No newline at end of file diff --git a/src/swagger-generation/config-v1.0.yml b/src/swagger-generation/config-v1.0.yml index 1dd5f7c..1237c54 100644 --- a/src/swagger-generation/config-v1.0.yml +++ b/src/swagger-generation/config-v1.0.yml @@ -248,3 +248,28 @@ EntityTypes: - Name: microsoft.graph.entity ReadOnly: - id + - Name: microsoft.graph.subscription + RootUri: /subscriptions + AvailableProperty: + - applicationId + - changeType + - clientState + - creatorId + - encryptionCertificate + - encryptionCertificateId + - expirationDateTime + - includeResourceData + - latestSupportedTlsVersion + - lifecycleNotificationUrl + - notificationQueryOptions + - notificationUrl + - notificationUrlAppId + - resource + RequiredOnWrite: + - changeType + - expirationDateTime + - notificationUrl + - resource + ReadOnly: + - applicationId + - creatorId diff --git a/src/swagger-generation/output/metadata.json b/src/swagger-generation/output/metadata.json index f410b3a..86712f7 100644 --- a/src/swagger-generation/output/metadata.json +++ b/src/swagger-generation/output/metadata.json @@ -126,5 +126,17 @@ "resourceId" ] } + }, + "subscriptions": { + "beta": { + "isIdempotent": false, + "updatable": false, + "isContainment": false + }, + "v1.0": { + "isIdempotent": false, + "updatable": false, + "isContainment": false + } } } \ No newline at end of file diff --git a/src/swagger-generation/output/microsoftgraph-beta.json b/src/swagger-generation/output/microsoftgraph-beta.json index cd94d91..46df6b0 100644 --- a/src/swagger-generation/output/microsoftgraph-beta.json +++ b/src/swagger-generation/output/microsoftgraph-beta.json @@ -879,6 +879,87 @@ } } }, + "microsoft.graph.subscription": { + "allOf": [ + { + "$ref": "#/definitions/microsoft.graph.entity" + }, + { + "type": "object", + "properties": { + "applicationId": { + "type": "string", + "description": "Optional. Identifier of the application used to create the subscription. Read-only.", + "readOnly": true + }, + "changeType": { + "type": "string", + "description": "Required. Indicates the type of change in the subscribed resource that raises a change notification. The supported values are: created, updated, deleted. Multiple values can be combined using a comma-separated list. Note: Drive root item and list change notifications support only the updated changeType. User and group change notifications support updated and deleted changeType. Use updated to receive notifications when user or group is created, updated, or soft deleted. Use deleted to receive notifications when user or group is permanently deleted." + }, + "clientState": { + "type": "string", + "description": "Optional. Specifies the value of the clientState property sent by the service in each change notification. The maximum length is 255 characters. The client can check that the change notification came from the service by comparing the value of the clientState property sent with the subscription with the value of the clientState property received with each change notification." + }, + "creatorId": { + "type": "string", + "description": "Optional. Identifier of the user or service principal that created the subscription. If the app used delegated permissions to create the subscription, this field contains the ID of the signed-in user the app called on behalf of. If the app used application permissions, this field contains the ID of the service principal corresponding to the app. Read-only.", + "readOnly": true + }, + "encryptionCertificate": { + "type": "string", + "description": "Optional. A base64-encoded representation of a certificate with a public key used to encrypt resource data in change notifications. Optional but required when includeResourceData is true." + }, + "encryptionCertificateId": { + "type": "string", + "description": "Optional. A custom app-provided identifier to help identify the certificate needed to decrypt resource data. Required when includeResourceData is true." + }, + "expirationDateTime": { + "type": "string", + "format": "date-time", + "description": "Required. Specifies the date and time when the webhook subscription expires. The time is in UTC, and can be an amount of time from subscription creation that varies for the resource subscribed to. For the maximum supported subscription length of time, see Subscription lifetime." + }, + "includeResourceData": { + "type": "boolean", + "description": "Optional. When set to true, change notifications include resource data (such as content of a chat message)." + }, + "latestSupportedTlsVersion": { + "type": "string", + "description": "Optional. Specifies the latest version of Transport Layer Security (TLS) that the notification endpoint, specified by notificationUrl, supports. The possible values are: v10, v11, v12, v13. For subscribers whose notification endpoint supports a version lower than the currently recommended version (TLS 1.2), specifying this property by a set timeline allows them to temporarily use their deprecated version of TLS before completing their upgrade to TLS 1.2. For these subscribers, not setting this property per the timeline would result in subscription operations failing. For subscribers whose notification endpoint already supports TLS 1.2, setting this property is optional. In such cases, Microsoft Graph defaults the property to v1_2." + }, + "lifecycleNotificationUrl": { + "type": "string", + "description": "Required for Teams resources if the expirationDateTime value is more than 1 hour from now; optional otherwise. The URL of the endpoint that receives lifecycle notifications, including subscriptionRemoved, reauthorizationRequired, and missed notifications. This URL must make use of the HTTPS protocol. For more information, see Reduce missing subscriptions and change notifications." + }, + "notificationContentType": { + "type": "string", + "description": "Optional. Desired content-type for Microsoft Graph change notifications for supported resource types. The default content-type is application/json." + }, + "notificationQueryOptions": { + "type": "string", + "description": "Optional. OData query options for specifying the value for the targeting resource. Clients receive notifications when the resource reaches the state matching the query options provided here. With this new property in the subscription creation payload along with all existing properties, Webhooks deliver notifications whenever a resource reaches the desired state mentioned in the notificationQueryOptions property. For example, when the print job is completed or when a print job resource isFetchable property value becomes true etc. Supported only for Universal Print Service. For more information, see Subscribe to change notifications from cloud printing APIs using Microsoft Graph." + }, + "notificationUrl": { + "type": "string", + "description": "Required. The URL of the endpoint that receives the change notifications. This URL must make use of the HTTPS protocol. Any query string parameter included in the notificationUrl property is included in the HTTP POST request when Microsoft Graph sends the change notifications." + }, + "notificationUrlAppId": { + "type": "string", + "description": "Optional. The app ID that the subscription service can use to generate the validation token. The value allows the client to validate the authenticity of the notification received." + }, + "resource": { + "type": "string", + "description": "Required. Specifies the resource that is monitored for changes. Don't include the base URL (https://graph.microsoft.com/beta/). See the possible resource path values for each supported resource." + } + }, + "required": [ + "changeType", + "expirationDateTime", + "notificationUrl", + "resource" + ] + } + ] + }, "microsoft.graph.onPremisesProvisioningError": { "type": "object", "properties": { @@ -1665,6 +1746,47 @@ } } } + }, + "/{rootScope}/providers/Microsoft.Graph/subscriptions/{subscriptionId}": { + "put": { + "tags": [ + "subscriptions" + ], + "description": "Create or update a subscription", + "operationId": "subscriptions_Put", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "body", + "name": "subscription", + "description": "The subscription to be created or updated", + "required": true, + "schema": { + "$ref": "#/definitions/microsoft.graph.subscription" + } + }, + { + "in": "path", + "description": "The id of the subscription", + "name": "subscriptionId", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "subscription created/updated successfully", + "schema": { + "$ref": "#/definitions/microsoft.graph.subscription" + } + } + } + } } } } \ No newline at end of file diff --git a/src/swagger-generation/output/microsoftgraph-v1.0.json b/src/swagger-generation/output/microsoftgraph-v1.0.json index a2062dc..614c667 100644 --- a/src/swagger-generation/output/microsoftgraph-v1.0.json +++ b/src/swagger-generation/output/microsoftgraph-v1.0.json @@ -830,6 +830,83 @@ } } }, + "microsoft.graph.subscription": { + "allOf": [ + { + "$ref": "#/definitions/microsoft.graph.entity" + }, + { + "type": "object", + "properties": { + "applicationId": { + "type": "string", + "description": "Optional. Identifier of the application used to create the subscription. Read-only.", + "readOnly": true + }, + "changeType": { + "type": "string", + "description": "Required. Indicates the type of change in the subscribed resource that raises a change notification. The supported values are: created, updated, deleted. Multiple values can be combined using a comma-separated list. Note: Drive root item and list change notifications support only the updated changeType. User and group change notifications support updated and deleted changeType. Use updated to receive notifications when user or group is created, updated, or soft deleted. Use deleted to receive notifications when user or group is permanently deleted." + }, + "clientState": { + "type": "string", + "description": "Optional. Specifies the value of the clientState property sent by the service in each change notification. The maximum length is 128 characters. The client can check that the change notification came from the service by comparing the value of the clientState property sent with the subscription with the value of the clientState property received with each change notification." + }, + "creatorId": { + "type": "string", + "description": "Optional. Identifier of the user or service principal that created the subscription. If the app used delegated permissions to create the subscription, this field contains the ID of the signed-in user the app called on behalf of. If the app used application permissions, this field contains the ID of the service principal corresponding to the app. Read-only.", + "readOnly": true + }, + "encryptionCertificate": { + "type": "string", + "description": "Optional. A base64-encoded representation of a certificate with a public key used to encrypt resource data in change notifications. Optional but required when includeResourceData is true." + }, + "encryptionCertificateId": { + "type": "string", + "description": "Optional. A custom app-provided identifier to help identify the certificate needed to decrypt resource data." + }, + "expirationDateTime": { + "type": "string", + "format": "date-time", + "description": "Required. Specifies the date and time when the webhook subscription expires. The time is in UTC, and can be an amount of time from subscription creation that varies for the resource subscribed to. For the maximum supported subscription length of time, see Subscription lifetime." + }, + "includeResourceData": { + "type": "boolean", + "description": "Optional. When set to true, change notifications include resource data (such as content of a chat message)." + }, + "latestSupportedTlsVersion": { + "type": "string", + "description": "Optional. Specifies the latest version of Transport Layer Security (TLS) that the notification endpoint, specified by notificationUrl, supports. The possible values are: v10, v11, v12, v13. For subscribers whose notification endpoint supports a version lower than the currently recommended version (TLS 1.2), specifying this property by a set timeline allows them to temporarily use their deprecated version of TLS before completing their upgrade to TLS 1.2. For these subscribers, not setting this property per the timeline would result in subscription operations failing. For subscribers whose notification endpoint already supports TLS 1.2, setting this property is optional. In such cases, Microsoft Graph defaults the property to v1_2." + }, + "lifecycleNotificationUrl": { + "type": "string", + "description": "Required for Teams resources if the expirationDateTime value is more than 1 hour from now; optional otherwise. The URL of the endpoint that receives lifecycle notifications, including subscriptionRemoved, reauthorizationRequired, and missed notifications. This URL must make use of the HTTPS protocol. For more information, see Reduce missing subscriptions and change notifications." + }, + "notificationQueryOptions": { + "type": "string", + "description": "Optional. OData query options for specifying value for the targeting resource. Clients receive notifications when resource reaches the state matching the query options provided here. With this new property in the subscription creation payload along with all existing properties, Webhooks deliver notifications whenever a resource reaches the desired state mentioned in the notificationQueryOptions property. For example, when the print job is completed or when a print job resource isFetchable property value becomes true etc. Supported only for Universal Print Service. For more information, see Subscribe to change notifications from cloud printing APIs using Microsoft Graph." + }, + "notificationUrl": { + "type": "string", + "description": "Required. The URL of the endpoint that receives the change notifications. This URL must make use of the HTTPS protocol. Any query string parameter included in the notificationUrl property is included in the HTTP POST request when Microsoft Graph sends the change notifications." + }, + "notificationUrlAppId": { + "type": "string", + "description": "Optional. The app ID that the subscription service can use to generate the validation token. The value allows the client to validate the authenticity of the notification received." + }, + "resource": { + "type": "string", + "description": "Required. Specifies the resource that is monitored for changes. Don't include the base URL (https://graph.microsoft.com/v1.0/). See the possible resource path values for each supported resource." + } + }, + "required": [ + "changeType", + "expirationDateTime", + "notificationUrl", + "resource" + ] + } + ] + }, "microsoft.graph.onPremisesProvisioningError": { "type": "object", "properties": { @@ -1600,6 +1677,47 @@ } } } + }, + "/{rootScope}/providers/Microsoft.Graph/subscriptions/{subscriptionId}": { + "put": { + "tags": [ + "subscriptions" + ], + "description": "Create or update a subscription", + "operationId": "subscriptions_Put", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "body", + "name": "subscription", + "description": "The subscription to be created or updated", + "required": true, + "schema": { + "$ref": "#/definitions/microsoft.graph.subscription" + } + }, + { + "in": "path", + "description": "The id of the subscription", + "name": "subscriptionId", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "subscription created/updated successfully", + "schema": { + "$ref": "#/definitions/microsoft.graph.subscription" + } + } + } + } } } } \ No newline at end of file