diff --git a/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/IMarketplaceManagementClient.cs b/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/IMarketplaceManagementClient.cs
index 0cb673fb74851..d1a41e04716d1 100644
--- a/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/IMarketplaceManagementClient.cs
+++ b/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/IMarketplaceManagementClient.cs
@@ -69,11 +69,21 @@ public partial interface IMarketplaceManagementClient : System.IDisposable
///
IPrivateStoreOffersOperations PrivateStoreOffers { get; }
+ ///
+ /// Gets the IPrivateStorePrivateOffersOperations.
+ ///
+ IPrivateStorePrivateOffersOperations PrivateStorePrivateOffers { get; }
+
///
/// Gets the IPrivateStoreOfferOperations.
///
IPrivateStoreOfferOperations PrivateStoreOffer { get; }
+ ///
+ /// Gets the IPrivateStorePrivateOfferOperations.
+ ///
+ IPrivateStorePrivateOfferOperations PrivateStorePrivateOffer { get; }
+
///
/// Gets the IPrivateStoreOperations.
///
diff --git a/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/IPrivateStoreOperations.cs b/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/IPrivateStoreOperations.cs
index 26a4719ba600e..a278f7798e4f8 100644
--- a/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/IPrivateStoreOperations.cs
+++ b/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/IPrivateStoreOperations.cs
@@ -26,6 +26,9 @@ public partial interface IPrivateStoreOperations
///
/// Gets the list of available private stores
///
+ ///
+ /// Determines if to use cache or DB for serving this request
+ ///
///
/// The headers that will be added to request.
///
@@ -41,7 +44,7 @@ public partial interface IPrivateStoreOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListWithHttpMessagesAsync(string useCache = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Get information about the private store
///
diff --git a/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/IPrivateStorePrivateOfferOperations.cs b/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/IPrivateStorePrivateOfferOperations.cs
new file mode 100644
index 0000000000000..1f9ce71a006a7
--- /dev/null
+++ b/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/IPrivateStorePrivateOfferOperations.cs
@@ -0,0 +1,86 @@
+//
+// 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.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.Marketplace
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// PrivateStorePrivateOfferOperations operations.
+ ///
+ public partial interface IPrivateStorePrivateOfferOperations
+ {
+ ///
+ /// Gets information about a specific private offer.
+ ///
+ ///
+ /// Subscription id of the private offers
+ ///
+ ///
+ /// The store ID - must use the tenant ID
+ ///
+ ///
+ /// The offer ID to update or delete
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(string subscriptionId, string privateStoreId, string offerId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Update or add a private offer to the default collection of the
+ /// private store.
+ ///
+ ///
+ /// Subscription id of the private offers
+ ///
+ ///
+ /// The store ID - must use the tenant ID
+ ///
+ ///
+ /// The offer ID to update or delete
+ ///
+ ///
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> CreateOrUpdateWithHttpMessagesAsync(string subscriptionId, string privateStoreId, string offerId, Offer payload = default(Offer), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/IPrivateStorePrivateOffersOperations.cs b/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/IPrivateStorePrivateOffersOperations.cs
new file mode 100644
index 0000000000000..7c43f9cf22844
--- /dev/null
+++ b/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/IPrivateStorePrivateOffersOperations.cs
@@ -0,0 +1,74 @@
+//
+// 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.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.Marketplace
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// PrivateStorePrivateOffersOperations operations.
+ ///
+ public partial interface IPrivateStorePrivateOffersOperations
+ {
+ ///
+ /// Get a list of all private offers in the given private store
+ ///
+ ///
+ /// Subscription id of the private offers
+ ///
+ ///
+ /// The store ID - must use the tenant ID
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListWithHttpMessagesAsync(string subscriptionId, string privateStoreId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Get a list of all private offers in the given private store
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/MarketplaceManagementClient.cs b/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/MarketplaceManagementClient.cs
index 3afd9d1060cd7..152f7cbbcb28c 100644
--- a/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/MarketplaceManagementClient.cs
+++ b/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/MarketplaceManagementClient.cs
@@ -74,11 +74,21 @@ public partial class MarketplaceManagementClient : ServiceClient
public virtual IPrivateStoreOffersOperations PrivateStoreOffers { get; private set; }
+ ///
+ /// Gets the IPrivateStorePrivateOffersOperations.
+ ///
+ public virtual IPrivateStorePrivateOffersOperations PrivateStorePrivateOffers { get; private set; }
+
///
/// Gets the IPrivateStoreOfferOperations.
///
public virtual IPrivateStoreOfferOperations PrivateStoreOffer { get; private set; }
+ ///
+ /// Gets the IPrivateStorePrivateOfferOperations.
+ ///
+ public virtual IPrivateStorePrivateOfferOperations PrivateStorePrivateOffer { get; private set; }
+
///
/// Gets the IPrivateStoreOperations.
///
@@ -331,7 +341,9 @@ public MarketplaceManagementClient(System.Uri baseUri, ServiceClientCredentials
private void Initialize()
{
PrivateStoreOffers = new PrivateStoreOffersOperations(this);
+ PrivateStorePrivateOffers = new PrivateStorePrivateOffersOperations(this);
PrivateStoreOffer = new PrivateStoreOfferOperations(this);
+ PrivateStorePrivateOffer = new PrivateStorePrivateOfferOperations(this);
PrivateStore = new PrivateStoreOperations(this);
Operations = new Operations(this);
BaseUri = new System.Uri("https://management.azure.com");
diff --git a/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/PrivateStoreOperations.cs b/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/PrivateStoreOperations.cs
index a3dfc660bb76d..e428964659137 100644
--- a/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/PrivateStoreOperations.cs
+++ b/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/PrivateStoreOperations.cs
@@ -53,6 +53,9 @@ internal PrivateStoreOperations(MarketplaceManagementClient client)
///
/// Gets the list of available private stores
///
+ ///
+ /// Determines if to use cache or DB for serving this request
+ ///
///
/// Headers that will be added to request.
///
@@ -74,7 +77,7 @@ internal PrivateStoreOperations(MarketplaceManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListWithHttpMessagesAsync(string useCache = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.ApiVersion == null)
{
@@ -87,6 +90,7 @@ internal PrivateStoreOperations(MarketplaceManagementClient client)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("useCache", useCache);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
}
@@ -98,6 +102,10 @@ internal PrivateStoreOperations(MarketplaceManagementClient client)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
+ if (useCache != null)
+ {
+ _queryParameters.Add(string.Format("use-cache={0}", System.Uri.EscapeDataString(useCache)));
+ }
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
diff --git a/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/PrivateStoreOperationsExtensions.cs b/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/PrivateStoreOperationsExtensions.cs
index 5db4992b49692..34fee3e3addb1 100644
--- a/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/PrivateStoreOperationsExtensions.cs
+++ b/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/PrivateStoreOperationsExtensions.cs
@@ -27,9 +27,12 @@ public static partial class PrivateStoreOperationsExtensions
///
/// The operations group for this extension method.
///
- public static IPage List(this IPrivateStoreOperations operations)
+ ///
+ /// Determines if to use cache or DB for serving this request
+ ///
+ public static IPage List(this IPrivateStoreOperations operations, string useCache = default(string))
{
- return operations.ListAsync().GetAwaiter().GetResult();
+ return operations.ListAsync(useCache).GetAwaiter().GetResult();
}
///
@@ -38,12 +41,15 @@ public static IPage List(this IPrivateStoreOperations operations)
///
/// The operations group for this extension method.
///
+ ///
+ /// Determines if to use cache or DB for serving this request
+ ///
///
/// The cancellation token.
///
- public static async Task> ListAsync(this IPrivateStoreOperations operations, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListAsync(this IPrivateStoreOperations operations, string useCache = default(string), CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.ListWithHttpMessagesAsync(useCache, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
diff --git a/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/PrivateStorePrivateOfferOperations.cs b/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/PrivateStorePrivateOfferOperations.cs
new file mode 100644
index 0000000000000..707e583828f49
--- /dev/null
+++ b/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/PrivateStorePrivateOfferOperations.cs
@@ -0,0 +1,454 @@
+//
+// 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.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.Marketplace
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Net;
+ using System.Net.Http;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// PrivateStorePrivateOfferOperations operations.
+ ///
+ internal partial class PrivateStorePrivateOfferOperations : IServiceOperations, IPrivateStorePrivateOfferOperations
+ {
+ ///
+ /// Initializes a new instance of the PrivateStorePrivateOfferOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal PrivateStorePrivateOfferOperations(MarketplaceManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the MarketplaceManagementClient
+ ///
+ public MarketplaceManagementClient Client { get; private set; }
+
+ ///
+ /// Gets information about a specific private offer.
+ ///
+ ///
+ /// Subscription id of the private offers
+ ///
+ ///
+ /// The store ID - must use the tenant ID
+ ///
+ ///
+ /// The offer ID to update or delete
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string subscriptionId, string privateStoreId, string offerId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (subscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionId");
+ }
+ if (privateStoreId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "privateStoreId");
+ }
+ if (offerId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "offerId");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("subscriptionId", subscriptionId);
+ tracingParameters.Add("privateStoreId", privateStoreId);
+ tracingParameters.Add("offerId", offerId);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Marketplace/privateStores/{privateStoreId}/offers/{offerId}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(subscriptionId));
+ _url = _url.Replace("{privateStoreId}", System.Uri.EscapeDataString(privateStoreId));
+ _url = _url.Replace("{offerId}", System.Uri.EscapeDataString(offerId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Update or add a private offer to the default collection of the private
+ /// store.
+ ///
+ ///
+ /// Subscription id of the private offers
+ ///
+ ///
+ /// The store ID - must use the tenant ID
+ ///
+ ///
+ /// The offer ID to update or delete
+ ///
+ ///
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(string subscriptionId, string privateStoreId, string offerId, Offer payload = default(Offer), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (subscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionId");
+ }
+ if (privateStoreId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "privateStoreId");
+ }
+ if (offerId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "offerId");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("payload", payload);
+ tracingParameters.Add("subscriptionId", subscriptionId);
+ tracingParameters.Add("privateStoreId", privateStoreId);
+ tracingParameters.Add("offerId", offerId);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Marketplace/privateStores/{privateStoreId}/offers/{offerId}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(subscriptionId));
+ _url = _url.Replace("{privateStoreId}", System.Uri.EscapeDataString(privateStoreId));
+ _url = _url.Replace("{offerId}", System.Uri.EscapeDataString(offerId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(payload != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(payload, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/PrivateStorePrivateOfferOperationsExtensions.cs b/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/PrivateStorePrivateOfferOperationsExtensions.cs
new file mode 100644
index 0000000000000..5fa37f4179e53
--- /dev/null
+++ b/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/PrivateStorePrivateOfferOperationsExtensions.cs
@@ -0,0 +1,123 @@
+//
+// 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.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.Marketplace
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for PrivateStorePrivateOfferOperations.
+ ///
+ public static partial class PrivateStorePrivateOfferOperationsExtensions
+ {
+ ///
+ /// Gets information about a specific private offer.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Subscription id of the private offers
+ ///
+ ///
+ /// The store ID - must use the tenant ID
+ ///
+ ///
+ /// The offer ID to update or delete
+ ///
+ public static Offer Get(this IPrivateStorePrivateOfferOperations operations, string subscriptionId, string privateStoreId, string offerId)
+ {
+ return operations.GetAsync(subscriptionId, privateStoreId, offerId).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Gets information about a specific private offer.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Subscription id of the private offers
+ ///
+ ///
+ /// The store ID - must use the tenant ID
+ ///
+ ///
+ /// The offer ID to update or delete
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetAsync(this IPrivateStorePrivateOfferOperations operations, string subscriptionId, string privateStoreId, string offerId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(subscriptionId, privateStoreId, offerId, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Update or add a private offer to the default collection of the private
+ /// store.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Subscription id of the private offers
+ ///
+ ///
+ /// The store ID - must use the tenant ID
+ ///
+ ///
+ /// The offer ID to update or delete
+ ///
+ ///
+ ///
+ public static Offer CreateOrUpdate(this IPrivateStorePrivateOfferOperations operations, string subscriptionId, string privateStoreId, string offerId, Offer payload = default(Offer))
+ {
+ return operations.CreateOrUpdateAsync(subscriptionId, privateStoreId, offerId, payload).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Update or add a private offer to the default collection of the private
+ /// store.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Subscription id of the private offers
+ ///
+ ///
+ /// The store ID - must use the tenant ID
+ ///
+ ///
+ /// The offer ID to update or delete
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task CreateOrUpdateAsync(this IPrivateStorePrivateOfferOperations operations, string subscriptionId, string privateStoreId, string offerId, Offer payload = default(Offer), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(subscriptionId, privateStoreId, offerId, payload, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/PrivateStorePrivateOffersOperations.cs b/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/PrivateStorePrivateOffersOperations.cs
new file mode 100644
index 0000000000000..9dfb65ed7f7c2
--- /dev/null
+++ b/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/PrivateStorePrivateOffersOperations.cs
@@ -0,0 +1,408 @@
+//
+// 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.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.Marketplace
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Net;
+ using System.Net.Http;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// PrivateStorePrivateOffersOperations operations.
+ ///
+ internal partial class PrivateStorePrivateOffersOperations : IServiceOperations, IPrivateStorePrivateOffersOperations
+ {
+ ///
+ /// Initializes a new instance of the PrivateStorePrivateOffersOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal PrivateStorePrivateOffersOperations(MarketplaceManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the MarketplaceManagementClient
+ ///
+ public MarketplaceManagementClient Client { get; private set; }
+
+ ///
+ /// Get a list of all private offers in the given private store
+ ///
+ ///
+ /// Subscription id of the private offers
+ ///
+ ///
+ /// The store ID - must use the tenant ID
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListWithHttpMessagesAsync(string subscriptionId, string privateStoreId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (subscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionId");
+ }
+ if (privateStoreId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "privateStoreId");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("subscriptionId", subscriptionId);
+ tracingParameters.Add("privateStoreId", privateStoreId);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Marketplace/privateStores/{privateStoreId}/offers").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(subscriptionId));
+ _url = _url.Replace("{privateStoreId}", System.Uri.EscapeDataString(privateStoreId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Get a list of all private offers in the given private store
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/PrivateStorePrivateOffersOperationsExtensions.cs b/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/PrivateStorePrivateOffersOperationsExtensions.cs
new file mode 100644
index 0000000000000..78c0880e0bc13
--- /dev/null
+++ b/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/PrivateStorePrivateOffersOperationsExtensions.cs
@@ -0,0 +1,99 @@
+//
+// 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.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.Marketplace
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for PrivateStorePrivateOffersOperations.
+ ///
+ public static partial class PrivateStorePrivateOffersOperationsExtensions
+ {
+ ///
+ /// Get a list of all private offers in the given private store
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Subscription id of the private offers
+ ///
+ ///
+ /// The store ID - must use the tenant ID
+ ///
+ public static IPage List(this IPrivateStorePrivateOffersOperations operations, string subscriptionId, string privateStoreId)
+ {
+ return operations.ListAsync(subscriptionId, privateStoreId).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get a list of all private offers in the given private store
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Subscription id of the private offers
+ ///
+ ///
+ /// The store ID - must use the tenant ID
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListAsync(this IPrivateStorePrivateOffersOperations operations, string subscriptionId, string privateStoreId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(subscriptionId, privateStoreId, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Get a list of all private offers in the given private store
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ public static IPage ListNext(this IPrivateStorePrivateOffersOperations operations, string nextPageLink)
+ {
+ return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get a list of all private offers in the given private store
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListNextAsync(this IPrivateStorePrivateOffersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/SdkInfo_MarketplaceManagementClient.cs b/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/SdkInfo_MarketplaceManagementClient.cs
index c7f557faacc39..94e0fbb14f5ac 100644
--- a/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/SdkInfo_MarketplaceManagementClient.cs
+++ b/sdk/marketplace/Microsoft.Azure.Management.Marketplace/src/Generated/SdkInfo_MarketplaceManagementClient.cs
@@ -23,19 +23,10 @@ public static IEnumerable> ApiInfo_MarketplaceMana
new Tuple("Marketplace", "PrivateStore", "2020-01-01"),
new Tuple("Marketplace", "PrivateStoreOffer", "2020-01-01"),
new Tuple("Marketplace", "PrivateStoreOffers", "2020-01-01"),
+ new Tuple("Marketplace", "PrivateStorePrivateOffer", "2020-01-01"),
+ new Tuple("Marketplace", "PrivateStorePrivateOffers", "2020-01-01"),
}.AsEnumerable();
}
}
- // BEGIN: Code Generation Metadata Section
- public static readonly String AutoRestVersion = "v2";
- public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413";
- public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/marketplace/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\\netSDK\\azure-sdk-for-net\\sdk";
- public static readonly String GithubForkName = "Azure";
- public static readonly String GithubBranchName = "master";
- public static readonly String GithubCommidId = "b383c4ad670ae561d8f790ed02ea951416f70c70";
- public static readonly String CodeGenerationErrors = "";
- public static readonly String GithubRepoName = "azure-rest-api-specs";
- // END: Code Generation Metadata Section
}
}
-