diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/DeadLetterDestination.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/DeadLetterDestination.java new file mode 100644 index 00000000000..f2884ca4046 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/DeadLetterDestination.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Information about the dead letter destination for an event subscription. To + * configure a deadletter destination, do not directly instantiate an object of + * this class. Instead, instantiate an object of a derived class. Currently, + * StorageBlobDeadLetterDestination is the only class that derives from this + * class. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType") +@JsonTypeName("DeadLetterDestination") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "StorageBlob", value = StorageBlobDeadLetterDestination.class) +}) +public class DeadLetterDestination { +} diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/EventDeliverySchema.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/EventDeliverySchema.java new file mode 100644 index 00000000000..2421f5adce8 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/EventDeliverySchema.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EventDeliverySchema. + */ +public final class EventDeliverySchema extends ExpandableStringEnum { + /** Static value EventGridSchema for EventDeliverySchema. */ + public static final EventDeliverySchema EVENT_GRID_SCHEMA = fromString("EventGridSchema"); + + /** Static value InputEventSchema for EventDeliverySchema. */ + public static final EventDeliverySchema INPUT_EVENT_SCHEMA = fromString("InputEventSchema"); + + /** Static value CloudEventV01Schema for EventDeliverySchema. */ + public static final EventDeliverySchema CLOUD_EVENT_V01SCHEMA = fromString("CloudEventV01Schema"); + + /** + * Creates or finds a EventDeliverySchema from its string representation. + * @param name a name to look for + * @return the corresponding EventDeliverySchema + */ + @JsonCreator + public static EventDeliverySchema fromString(String name) { + return fromString(name, EventDeliverySchema.class); + } + + /** + * @return known EventDeliverySchema values + */ + public static Collection values() { + return values(EventDeliverySchema.class); + } +} diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/EventSubscriptionDestination.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/EventSubscriptionDestination.java index 9208045c1b6..c13abca3c79 100644 --- a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/EventSubscriptionDestination.java +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/EventSubscriptionDestination.java @@ -19,7 +19,9 @@ @JsonTypeName("EventSubscriptionDestination") @JsonSubTypes({ @JsonSubTypes.Type(name = "WebHook", value = WebHookEventSubscriptionDestination.class), - @JsonSubTypes.Type(name = "EventHub", value = EventHubEventSubscriptionDestination.class) + @JsonSubTypes.Type(name = "EventHub", value = EventHubEventSubscriptionDestination.class), + @JsonSubTypes.Type(name = "StorageQueue", value = StorageQueueEventSubscriptionDestination.class), + @JsonSubTypes.Type(name = "HybridConnection", value = HybridConnectionEventSubscriptionDestination.class) }) public class EventSubscriptionDestination { } diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/EventSubscriptionProvisioningState.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/EventSubscriptionProvisioningState.java index 55b5a7a7dab..c2a29a71c44 100644 --- a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/EventSubscriptionProvisioningState.java +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/EventSubscriptionProvisioningState.java @@ -34,6 +34,9 @@ public final class EventSubscriptionProvisioningState extends ExpandableStringEn /** Static value Failed for EventSubscriptionProvisioningState. */ public static final EventSubscriptionProvisioningState FAILED = fromString("Failed"); + /** Static value AwaitingManualAction for EventSubscriptionProvisioningState. */ + public static final EventSubscriptionProvisioningState AWAITING_MANUAL_ACTION = fromString("AwaitingManualAction"); + /** * Creates or finds a EventSubscriptionProvisioningState from its string representation. * @param name a name to look for diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/HybridConnectionEventSubscriptionDestination.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/HybridConnectionEventSubscriptionDestination.java new file mode 100644 index 00000000000..4f50f78a822 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/HybridConnectionEventSubscriptionDestination.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information about the HybridConnection destination for an event + * subscription. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType") +@JsonTypeName("HybridConnection") +@JsonFlatten +public class HybridConnectionEventSubscriptionDestination extends EventSubscriptionDestination { + /** + * The Azure Resource ID of an hybrid connection that is the destination of + * an event subscription. + */ + @JsonProperty(value = "properties.resourceId") + private String resourceId; + + /** + * Get the resourceId value. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId value. + * + * @param resourceId the resourceId value to set + * @return the HybridConnectionEventSubscriptionDestination object itself. + */ + public HybridConnectionEventSubscriptionDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + +} diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/InputSchema.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/InputSchema.java new file mode 100644 index 00000000000..3503f613445 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/InputSchema.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for InputSchema. + */ +public final class InputSchema extends ExpandableStringEnum { + /** Static value EventGridSchema for InputSchema. */ + public static final InputSchema EVENT_GRID_SCHEMA = fromString("EventGridSchema"); + + /** Static value CustomEventSchema for InputSchema. */ + public static final InputSchema CUSTOM_EVENT_SCHEMA = fromString("CustomEventSchema"); + + /** Static value CloudEventV01Schema for InputSchema. */ + public static final InputSchema CLOUD_EVENT_V01SCHEMA = fromString("CloudEventV01Schema"); + + /** + * Creates or finds a InputSchema from its string representation. + * @param name a name to look for + * @return the corresponding InputSchema + */ + @JsonCreator + public static InputSchema fromString(String name) { + return fromString(name, InputSchema.class); + } + + /** + * @return known InputSchema values + */ + public static Collection values() { + return values(InputSchema.class); + } +} diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/InputSchemaMapping.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/InputSchemaMapping.java new file mode 100644 index 00000000000..5d92b30ac3f --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/InputSchemaMapping.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * By default, Event Grid expects events to be in the Event Grid event schema. + * Specifying an input schema mapping enables publishing to Event Grid using a + * custom input schema. Currently, the only supported type of + * InputSchemaMapping is 'JsonInputSchemaMapping'. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "inputSchemaMappingType") +@JsonTypeName("InputSchemaMapping") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Json", value = JsonInputSchemaMapping.class) +}) +public class InputSchemaMapping { +} diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/JsonField.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/JsonField.java new file mode 100644 index 00000000000..b9082fbac19 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/JsonField.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This is used to express the source of an input schema mapping for a single + * target field in the Event Grid Event schema. This is currently used in the + * mappings for the 'id','topic' and 'eventtime' properties. This represents a + * field in the input event schema. + */ +public class JsonField { + /** + * Name of a field in the input event schema that's to be used as the + * source of a mapping. + */ + @JsonProperty(value = "sourceField") + private String sourceField; + + /** + * Get the sourceField value. + * + * @return the sourceField value + */ + public String sourceField() { + return this.sourceField; + } + + /** + * Set the sourceField value. + * + * @param sourceField the sourceField value to set + * @return the JsonField object itself. + */ + public JsonField withSourceField(String sourceField) { + this.sourceField = sourceField; + return this; + } + +} diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/JsonFieldWithDefault.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/JsonFieldWithDefault.java new file mode 100644 index 00000000000..ac82fe13c2e --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/JsonFieldWithDefault.java @@ -0,0 +1,76 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This is used to express the source of an input schema mapping for a single + * target field in the Event Grid Event schema. This is currently used in the + * mappings for the 'subject','eventtype' and 'dataversion' properties. This + * represents a field in the input event schema along with a default value to + * be used, and at least one of these two properties should be provided. + */ +public class JsonFieldWithDefault { + /** + * Name of a field in the input event schema that's to be used as the + * source of a mapping. + */ + @JsonProperty(value = "sourceField") + private String sourceField; + + /** + * The default value to be used for mapping when a SourceField is not + * provided or if there's no property with the specified name in the + * published JSON event payload. + */ + @JsonProperty(value = "defaultValue") + private String defaultValue; + + /** + * Get the sourceField value. + * + * @return the sourceField value + */ + public String sourceField() { + return this.sourceField; + } + + /** + * Set the sourceField value. + * + * @param sourceField the sourceField value to set + * @return the JsonFieldWithDefault object itself. + */ + public JsonFieldWithDefault withSourceField(String sourceField) { + this.sourceField = sourceField; + return this; + } + + /** + * Get the defaultValue value. + * + * @return the defaultValue value + */ + public String defaultValue() { + return this.defaultValue; + } + + /** + * Set the defaultValue value. + * + * @param defaultValue the defaultValue value to set + * @return the JsonFieldWithDefault object itself. + */ + public JsonFieldWithDefault withDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + return this; + } + +} diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/JsonInputSchemaMapping.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/JsonInputSchemaMapping.java new file mode 100644 index 00000000000..e054e49ff29 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/JsonInputSchemaMapping.java @@ -0,0 +1,185 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * This enables publishing to Event Grid using a custom input schema. This can + * be used to map properties from a custom input JSON schema to the Event Grid + * event schema. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "inputSchemaMappingType") +@JsonTypeName("Json") +@JsonFlatten +public class JsonInputSchemaMapping extends InputSchemaMapping { + /** + * The mapping information for the Id property of the Event Grid Event. + */ + @JsonProperty(value = "properties.id") + private JsonField id; + + /** + * The mapping information for the Topic property of the Event Grid Event. + */ + @JsonProperty(value = "properties.topic") + private JsonField topic; + + /** + * The mapping information for the EventTime property of the Event Grid + * Event. + */ + @JsonProperty(value = "properties.eventTime") + private JsonField eventTime; + + /** + * The mapping information for the EventType property of the Event Grid + * Event. + */ + @JsonProperty(value = "properties.eventType") + private JsonFieldWithDefault eventType; + + /** + * The mapping information for the Subject property of the Event Grid + * Event. + */ + @JsonProperty(value = "properties.subject") + private JsonFieldWithDefault subject; + + /** + * The mapping information for the DataVersion property of the Event Grid + * Event. + */ + @JsonProperty(value = "properties.dataVersion") + private JsonFieldWithDefault dataVersion; + + /** + * Get the id value. + * + * @return the id value + */ + public JsonField id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the JsonInputSchemaMapping object itself. + */ + public JsonInputSchemaMapping withId(JsonField id) { + this.id = id; + return this; + } + + /** + * Get the topic value. + * + * @return the topic value + */ + public JsonField topic() { + return this.topic; + } + + /** + * Set the topic value. + * + * @param topic the topic value to set + * @return the JsonInputSchemaMapping object itself. + */ + public JsonInputSchemaMapping withTopic(JsonField topic) { + this.topic = topic; + return this; + } + + /** + * Get the eventTime value. + * + * @return the eventTime value + */ + public JsonField eventTime() { + return this.eventTime; + } + + /** + * Set the eventTime value. + * + * @param eventTime the eventTime value to set + * @return the JsonInputSchemaMapping object itself. + */ + public JsonInputSchemaMapping withEventTime(JsonField eventTime) { + this.eventTime = eventTime; + return this; + } + + /** + * Get the eventType value. + * + * @return the eventType value + */ + public JsonFieldWithDefault eventType() { + return this.eventType; + } + + /** + * Set the eventType value. + * + * @param eventType the eventType value to set + * @return the JsonInputSchemaMapping object itself. + */ + public JsonInputSchemaMapping withEventType(JsonFieldWithDefault eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get the subject value. + * + * @return the subject value + */ + public JsonFieldWithDefault subject() { + return this.subject; + } + + /** + * Set the subject value. + * + * @param subject the subject value to set + * @return the JsonInputSchemaMapping object itself. + */ + public JsonInputSchemaMapping withSubject(JsonFieldWithDefault subject) { + this.subject = subject; + return this; + } + + /** + * Get the dataVersion value. + * + * @return the dataVersion value + */ + public JsonFieldWithDefault dataVersion() { + return this.dataVersion; + } + + /** + * Set the dataVersion value. + * + * @param dataVersion the dataVersion value to set + * @return the JsonInputSchemaMapping object itself. + */ + public JsonInputSchemaMapping withDataVersion(JsonFieldWithDefault dataVersion) { + this.dataVersion = dataVersion; + return this; + } + +} diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/RetryPolicy.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/RetryPolicy.java new file mode 100644 index 00000000000..3756a16375a --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/RetryPolicy.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about the retry policy for an event subscription. + */ +public class RetryPolicy { + /** + * Maximum number of delivery retry attempts for events. + */ + @JsonProperty(value = "maxDeliveryAttempts") + private Integer maxDeliveryAttempts; + + /** + * Time To Live (in minutes) for events. + */ + @JsonProperty(value = "eventTimeToLiveInMinutes") + private Integer eventTimeToLiveInMinutes; + + /** + * Get the maxDeliveryAttempts value. + * + * @return the maxDeliveryAttempts value + */ + public Integer maxDeliveryAttempts() { + return this.maxDeliveryAttempts; + } + + /** + * Set the maxDeliveryAttempts value. + * + * @param maxDeliveryAttempts the maxDeliveryAttempts value to set + * @return the RetryPolicy object itself. + */ + public RetryPolicy withMaxDeliveryAttempts(Integer maxDeliveryAttempts) { + this.maxDeliveryAttempts = maxDeliveryAttempts; + return this; + } + + /** + * Get the eventTimeToLiveInMinutes value. + * + * @return the eventTimeToLiveInMinutes value + */ + public Integer eventTimeToLiveInMinutes() { + return this.eventTimeToLiveInMinutes; + } + + /** + * Set the eventTimeToLiveInMinutes value. + * + * @param eventTimeToLiveInMinutes the eventTimeToLiveInMinutes value to set + * @return the RetryPolicy object itself. + */ + public RetryPolicy withEventTimeToLiveInMinutes(Integer eventTimeToLiveInMinutes) { + this.eventTimeToLiveInMinutes = eventTimeToLiveInMinutes; + return this; + } + +} diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/StorageBlobDeadLetterDestination.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/StorageBlobDeadLetterDestination.java new file mode 100644 index 00000000000..5fa7e5237d0 --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/StorageBlobDeadLetterDestination.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information about the storage blob based dead letter destination. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType") +@JsonTypeName("StorageBlob") +@JsonFlatten +public class StorageBlobDeadLetterDestination extends DeadLetterDestination { + /** + * The Azure Resource ID of the storage account that is the destination of + * the deadletter events. + */ + @JsonProperty(value = "properties.resourceId") + private String resourceId; + + /** + * The name of the Storage blob container that is the destination of the + * deadletter events. + */ + @JsonProperty(value = "properties.blobContainerName") + private String blobContainerName; + + /** + * Get the resourceId value. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId value. + * + * @param resourceId the resourceId value to set + * @return the StorageBlobDeadLetterDestination object itself. + */ + public StorageBlobDeadLetterDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the blobContainerName value. + * + * @return the blobContainerName value + */ + public String blobContainerName() { + return this.blobContainerName; + } + + /** + * Set the blobContainerName value. + * + * @param blobContainerName the blobContainerName value to set + * @return the StorageBlobDeadLetterDestination object itself. + */ + public StorageBlobDeadLetterDestination withBlobContainerName(String blobContainerName) { + this.blobContainerName = blobContainerName; + return this; + } + +} diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/StorageQueueEventSubscriptionDestination.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/StorageQueueEventSubscriptionDestination.java new file mode 100644 index 00000000000..1ec7baf5f8d --- /dev/null +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/StorageQueueEventSubscriptionDestination.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.eventgrid; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information about the storage queue destination for an event subscription. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType") +@JsonTypeName("StorageQueue") +@JsonFlatten +public class StorageQueueEventSubscriptionDestination extends EventSubscriptionDestination { + /** + * The Azure Resource ID of the storage account that contains the queue + * that is the destination of an event subscription. + */ + @JsonProperty(value = "properties.resourceId") + private String resourceId; + + /** + * The name of the Storage queue under a storage account that is the + * destination of an event subscription. + */ + @JsonProperty(value = "properties.queueName") + private String queueName; + + /** + * Get the resourceId value. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId value. + * + * @param resourceId the resourceId value to set + * @return the StorageQueueEventSubscriptionDestination object itself. + */ + public StorageQueueEventSubscriptionDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the queueName value. + * + * @return the queueName value + */ + public String queueName() { + return this.queueName; + } + + /** + * Set the queueName value. + * + * @param queueName the queueName value to set + * @return the StorageQueueEventSubscriptionDestination object itself. + */ + public StorageQueueEventSubscriptionDestination withQueueName(String queueName) { + this.queueName = queueName; + return this; + } + +} diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/TopicRegenerateKeyRequest.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/TopicRegenerateKeyRequest.java index afa4711c260..6799201e3e4 100644 --- a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/TopicRegenerateKeyRequest.java +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/TopicRegenerateKeyRequest.java @@ -11,7 +11,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Topic regenerate share access key key request. + * Topic regenerate share access key request. */ public class TopicRegenerateKeyRequest { /** diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventGridManagementClientImpl.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventGridManagementClientImpl.java index 1ecc48968f5..e0cc61c9a39 100644 --- a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventGridManagementClientImpl.java +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventGridManagementClientImpl.java @@ -215,7 +215,7 @@ public EventGridManagementClientImpl(RestClient restClient) { } protected void initialize() { - this.apiVersion = "2018-01-01"; + this.apiVersion = "2018-05-01-preview"; this.acceptLanguage = "en-US"; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; @@ -233,6 +233,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "EventGridManagementClient", "2018-01-01"); + return String.format("%s (%s, %s)", super.userAgent(), "EventGridManagementClient", "2018-05-01-preview"); } } diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventSubscriptionInner.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventSubscriptionInner.java index 0d1e3cec7fb..cca0962690b 100644 --- a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventSubscriptionInner.java +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventSubscriptionInner.java @@ -12,6 +12,9 @@ import com.microsoft.azure.management.eventgrid.EventSubscriptionDestination; import com.microsoft.azure.management.eventgrid.EventSubscriptionFilter; import java.util.List; +import com.microsoft.azure.management.eventgrid.EventDeliverySchema; +import com.microsoft.azure.management.eventgrid.RetryPolicy; +import com.microsoft.azure.management.eventgrid.DeadLetterDestination; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.Resource; @@ -29,7 +32,8 @@ public class EventSubscriptionInner extends Resource { /** * Provisioning state of the event subscription. Possible values include: - * 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed'. + * 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed', + * 'AwaitingManualAction'. */ @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) private EventSubscriptionProvisioningState provisioningState; @@ -53,6 +57,26 @@ public class EventSubscriptionInner extends Resource { @JsonProperty(value = "properties.labels") private List labels; + /** + * The event delivery schema for the event subscription. Possible values + * include: 'EventGridSchema', 'InputEventSchema', 'CloudEventV01Schema'. + */ + @JsonProperty(value = "properties.eventDeliverySchema") + private EventDeliverySchema eventDeliverySchema; + + /** + * The retry policy for events. This can be used to configure maximum + * number of delivery attempts and time to live for events. + */ + @JsonProperty(value = "properties.retryPolicy") + private RetryPolicy retryPolicy; + + /** + * The DeadLetter destination of the event subscription. + */ + @JsonProperty(value = "properties.deadLetterDestination") + private DeadLetterDestination deadLetterDestination; + /** * Get the topic value. * @@ -131,4 +155,64 @@ public EventSubscriptionInner withLabels(List labels) { return this; } + /** + * Get the eventDeliverySchema value. + * + * @return the eventDeliverySchema value + */ + public EventDeliverySchema eventDeliverySchema() { + return this.eventDeliverySchema; + } + + /** + * Set the eventDeliverySchema value. + * + * @param eventDeliverySchema the eventDeliverySchema value to set + * @return the EventSubscriptionInner object itself. + */ + public EventSubscriptionInner withEventDeliverySchema(EventDeliverySchema eventDeliverySchema) { + this.eventDeliverySchema = eventDeliverySchema; + return this; + } + + /** + * Get the retryPolicy value. + * + * @return the retryPolicy value + */ + public RetryPolicy retryPolicy() { + return this.retryPolicy; + } + + /** + * Set the retryPolicy value. + * + * @param retryPolicy the retryPolicy value to set + * @return the EventSubscriptionInner object itself. + */ + public EventSubscriptionInner withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Get the deadLetterDestination value. + * + * @return the deadLetterDestination value + */ + public DeadLetterDestination deadLetterDestination() { + return this.deadLetterDestination; + } + + /** + * Set the deadLetterDestination value. + * + * @param deadLetterDestination the deadLetterDestination value to set + * @return the EventSubscriptionInner object itself. + */ + public EventSubscriptionInner withDeadLetterDestination(DeadLetterDestination deadLetterDestination) { + this.deadLetterDestination = deadLetterDestination; + return this; + } + } diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventSubscriptionUpdateParametersInner.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventSubscriptionUpdateParametersInner.java index f1e42d56af9..1dc88214241 100644 --- a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventSubscriptionUpdateParametersInner.java +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventSubscriptionUpdateParametersInner.java @@ -11,6 +11,9 @@ import com.microsoft.azure.management.eventgrid.EventSubscriptionDestination; import com.microsoft.azure.management.eventgrid.EventSubscriptionFilter; import java.util.List; +import com.microsoft.azure.management.eventgrid.EventDeliverySchema; +import com.microsoft.azure.management.eventgrid.RetryPolicy; +import com.microsoft.azure.management.eventgrid.DeadLetterDestination; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -36,6 +39,26 @@ public class EventSubscriptionUpdateParametersInner { @JsonProperty(value = "labels") private List labels; + /** + * The event delivery schema for the event subscription. Possible values + * include: 'EventGridSchema', 'InputEventSchema', 'CloudEventV01Schema'. + */ + @JsonProperty(value = "eventDeliverySchema") + private EventDeliverySchema eventDeliverySchema; + + /** + * The retry policy for events. This can be used to configure maximum + * number of delivery attempts and time to live for events. + */ + @JsonProperty(value = "retryPolicy") + private RetryPolicy retryPolicy; + + /** + * The DeadLetter destination of the event subscription. + */ + @JsonProperty(value = "deadLetterDestination") + private DeadLetterDestination deadLetterDestination; + /** * Get the destination value. * @@ -96,4 +119,64 @@ public EventSubscriptionUpdateParametersInner withLabels(List labels) { return this; } + /** + * Get the eventDeliverySchema value. + * + * @return the eventDeliverySchema value + */ + public EventDeliverySchema eventDeliverySchema() { + return this.eventDeliverySchema; + } + + /** + * Set the eventDeliverySchema value. + * + * @param eventDeliverySchema the eventDeliverySchema value to set + * @return the EventSubscriptionUpdateParametersInner object itself. + */ + public EventSubscriptionUpdateParametersInner withEventDeliverySchema(EventDeliverySchema eventDeliverySchema) { + this.eventDeliverySchema = eventDeliverySchema; + return this; + } + + /** + * Get the retryPolicy value. + * + * @return the retryPolicy value + */ + public RetryPolicy retryPolicy() { + return this.retryPolicy; + } + + /** + * Set the retryPolicy value. + * + * @param retryPolicy the retryPolicy value to set + * @return the EventSubscriptionUpdateParametersInner object itself. + */ + public EventSubscriptionUpdateParametersInner withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Get the deadLetterDestination value. + * + * @return the deadLetterDestination value + */ + public DeadLetterDestination deadLetterDestination() { + return this.deadLetterDestination; + } + + /** + * Set the deadLetterDestination value. + * + * @param deadLetterDestination the deadLetterDestination value to set + * @return the EventSubscriptionUpdateParametersInner object itself. + */ + public EventSubscriptionUpdateParametersInner withDeadLetterDestination(DeadLetterDestination deadLetterDestination) { + this.deadLetterDestination = deadLetterDestination; + return this; + } + } diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventSubscriptionsInner.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventSubscriptionsInner.java index bcf375bed29..6341da61528 100644 --- a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventSubscriptionsInner.java +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/EventSubscriptionsInner.java @@ -554,7 +554,7 @@ private ServiceResponse beginDeleteDelegate(Response respons * Asynchronously updates an existing event subscription. * * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. - * @param eventSubscriptionName Name of the event subscription to be created + * @param eventSubscriptionName Name of the event subscription to be updated * @param eventSubscriptionUpdateParameters Updated event subscription information * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server @@ -570,7 +570,7 @@ public EventSubscriptionInner update(String scope, String eventSubscriptionName, * Asynchronously updates an existing event subscription. * * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. - * @param eventSubscriptionName Name of the event subscription to be created + * @param eventSubscriptionName Name of the event subscription to be updated * @param eventSubscriptionUpdateParameters Updated event subscription information * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -585,7 +585,7 @@ public ServiceFuture updateAsync(String scope, String ev * Asynchronously updates an existing event subscription. * * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. - * @param eventSubscriptionName Name of the event subscription to be created + * @param eventSubscriptionName Name of the event subscription to be updated * @param eventSubscriptionUpdateParameters Updated event subscription information * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -604,7 +604,7 @@ public EventSubscriptionInner call(ServiceResponse respo * Asynchronously updates an existing event subscription. * * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. - * @param eventSubscriptionName Name of the event subscription to be created + * @param eventSubscriptionName Name of the event subscription to be updated * @param eventSubscriptionUpdateParameters Updated event subscription information * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -632,7 +632,7 @@ public Observable> updateWithServiceResp * Asynchronously updates an existing event subscription. * * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. - * @param eventSubscriptionName Name of the event subscription to be created + * @param eventSubscriptionName Name of the event subscription to be updated * @param eventSubscriptionUpdateParameters Updated event subscription information * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server @@ -648,7 +648,7 @@ public EventSubscriptionInner beginUpdate(String scope, String eventSubscription * Asynchronously updates an existing event subscription. * * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. - * @param eventSubscriptionName Name of the event subscription to be created + * @param eventSubscriptionName Name of the event subscription to be updated * @param eventSubscriptionUpdateParameters Updated event subscription information * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -663,7 +663,7 @@ public ServiceFuture beginUpdateAsync(String scope, Stri * Asynchronously updates an existing event subscription. * * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. - * @param eventSubscriptionName Name of the event subscription to be created + * @param eventSubscriptionName Name of the event subscription to be updated * @param eventSubscriptionUpdateParameters Updated event subscription information * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the EventSubscriptionInner object @@ -682,7 +682,7 @@ public EventSubscriptionInner call(ServiceResponse respo * Asynchronously updates an existing event subscription. * * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic. - * @param eventSubscriptionName Name of the event subscription to be created + * @param eventSubscriptionName Name of the event subscription to be updated * @param eventSubscriptionUpdateParameters Updated event subscription information * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the EventSubscriptionInner object diff --git a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/TopicInner.java b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/TopicInner.java index 7f37d766e79..6c35f981b46 100644 --- a/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/TopicInner.java +++ b/azure-mgmt-eventgrid/src/main/java/com/microsoft/azure/management/eventgrid/implementation/TopicInner.java @@ -9,6 +9,8 @@ package com.microsoft.azure.management.eventgrid.implementation; import com.microsoft.azure.management.eventgrid.TopicProvisioningState; +import com.microsoft.azure.management.eventgrid.InputSchema; +import com.microsoft.azure.management.eventgrid.InputSchemaMapping; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -30,6 +32,23 @@ public class TopicInner extends TrackedResourceInner { @JsonProperty(value = "properties.endpoint", access = JsonProperty.Access.WRITE_ONLY) private String endpoint; + /** + * This determines the format that Event Grid should expect for incoming + * events published to the topic. Possible values include: + * 'EventGridSchema', 'CustomEventSchema', 'CloudEventV01Schema'. + */ + @JsonProperty(value = "properties.inputSchema") + private InputSchema inputSchema; + + /** + * This enables publishing using custom event schemas. An + * InputSchemaMapping can be specified to map various properties of a + * source schema to various required properties of the EventGridEvent + * schema. + */ + @JsonProperty(value = "properties.inputSchemaMapping") + private InputSchemaMapping inputSchemaMapping; + /** * Get the provisioningState value. * @@ -48,4 +67,44 @@ public String endpoint() { return this.endpoint; } + /** + * Get the inputSchema value. + * + * @return the inputSchema value + */ + public InputSchema inputSchema() { + return this.inputSchema; + } + + /** + * Set the inputSchema value. + * + * @param inputSchema the inputSchema value to set + * @return the TopicInner object itself. + */ + public TopicInner withInputSchema(InputSchema inputSchema) { + this.inputSchema = inputSchema; + return this; + } + + /** + * Get the inputSchemaMapping value. + * + * @return the inputSchemaMapping value + */ + public InputSchemaMapping inputSchemaMapping() { + return this.inputSchemaMapping; + } + + /** + * Set the inputSchemaMapping value. + * + * @param inputSchemaMapping the inputSchemaMapping value to set + * @return the TopicInner object itself. + */ + public TopicInner withInputSchemaMapping(InputSchemaMapping inputSchemaMapping) { + this.inputSchemaMapping = inputSchemaMapping; + return this; + } + }