| | | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 2 | | // Licensed under the MIT License. |
| | | 3 | | |
| | | 4 | | using System; |
| | | 5 | | using Azure.Core; |
| | | 6 | | using Azure.Core.Serialization; |
| | | 7 | | |
| | | 8 | | namespace Azure.Messaging.EventGrid |
| | | 9 | | { |
| | | 10 | | /// <summary> |
| | | 11 | | /// Options that allow to configure the management of the request sent to the service. |
| | | 12 | | /// </summary> |
| | | 13 | | public class EventGridPublisherClientOptions : ClientOptions |
| | | 14 | | { |
| | | 15 | | |
| | | 16 | | /// <summary> |
| | | 17 | | /// The latest service version supported by this client library. |
| | | 18 | | /// </summary> |
| | | 19 | | internal const ServiceVersion LatestVersion = ServiceVersion.V2018_01_01; |
| | | 20 | | |
| | | 21 | | /// <summary> |
| | | 22 | | /// The versions of the Event Grid service supported by this client library. |
| | | 23 | | /// </summary> |
| | | 24 | | public enum ServiceVersion |
| | | 25 | | { |
| | | 26 | | /// <summary> |
| | | 27 | | /// API version "2018-01-01" |
| | | 28 | | /// </summary> |
| | | 29 | | #pragma warning disable CA1707 // Identifiers should not contain underscores |
| | | 30 | | V2018_01_01 = 1 |
| | | 31 | | #pragma warning restore CA1707 // Identifiers should not contain underscores |
| | | 32 | | } |
| | | 33 | | |
| | | 34 | | /// <summary> |
| | | 35 | | /// Gets the <see cref="ServiceVersion"/> of the service API used when |
| | | 36 | | /// making requests. |
| | | 37 | | /// </summary> |
| | 84 | 38 | | internal ServiceVersion Version { get; } |
| | | 39 | | |
| | | 40 | | /// <summary> |
| | | 41 | | /// Used to serialize the payloads of given events to UTF-8 encoded JSON. |
| | | 42 | | /// </summary> |
| | 48 | 43 | | public ObjectSerializer DataSerializer { get; set; } |
| | | 44 | | |
| | | 45 | | /// <summary> |
| | | 46 | | /// Initializes a new instance of the <see cref="EventGridPublisherClientOptions"/> |
| | | 47 | | /// class. |
| | | 48 | | /// </summary> |
| | | 49 | | /// <param name="version"> |
| | | 50 | | /// The <see cref="ServiceVersion"/> of the service API used when |
| | | 51 | | /// making requests. |
| | | 52 | | /// </param> |
| | 44 | 53 | | public EventGridPublisherClientOptions(ServiceVersion version = LatestVersion) |
| | | 54 | | { |
| | 44 | 55 | | Version = version; |
| | 44 | 56 | | } |
| | | 57 | | } |
| | | 58 | | } |