/// <summary> /// Gets all the custom resource providers within a subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <CustomRPManifest> > ListBySubscriptionAsync(this ICustomResourceProviderOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Creates or updates the custom resource provider. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='resourceProviderName'> /// The name of the resource provider. /// </param> /// <param name='resourceProvider'> /// The parameters required to create or update a custom resource provider /// definition. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <CustomRPManifest> CreateOrUpdateAsync(this ICustomResourceProviderOperations operations, string resourceGroupName, string resourceProviderName, CustomRPManifest resourceProvider, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, resourceProviderName, resourceProvider, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { Operations = new Operations(this); CustomResourceProvider = new CustomResourceProviderOperations(this); BaseUri = new System.Uri("https://management.azure.com"); ApiVersion = "2018-09-01-preview"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; SerializationSettings = new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; SerializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; CustomInitialize(); DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); }
/// <summary> /// Deletes the custom resource provider. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='resourceProviderName'> /// The name of the resource provider. /// </param> public static void Delete(this ICustomResourceProviderOperations operations, string resourceGroupName, string resourceProviderName) { operations.DeleteAsync(resourceGroupName, resourceProviderName).GetAwaiter().GetResult(); }
/// <summary> /// Creates or updates the custom resource provider. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='resourceProviderName'> /// The name of the resource provider. /// </param> /// <param name='resourceProvider'> /// The parameters required to create or update a custom resource provider /// definition. /// </param> public static CustomRPManifest CreateOrUpdate(this ICustomResourceProviderOperations operations, string resourceGroupName, string resourceProviderName, CustomRPManifest resourceProvider) { return(operations.CreateOrUpdateAsync(resourceGroupName, resourceProviderName, resourceProvider).GetAwaiter().GetResult()); }
/// <summary> /// Gets all the custom resource providers within a subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> public static IPage <CustomRPManifest> ListBySubscriptionNext(this ICustomResourceProviderOperations operations, string nextPageLink) { return(operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// Deletes the custom resource provider. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='resourceProviderName'> /// The name of the resource provider. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task BeginDeleteAsync(this ICustomResourceProviderOperations operations, string resourceGroupName, string resourceProviderName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, resourceProviderName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Gets all the custom resource providers within a subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static IPage <CustomRPManifest> ListBySubscription(this ICustomResourceProviderOperations operations) { return(operations.ListBySubscriptionAsync().GetAwaiter().GetResult()); }
/// <summary> /// Gets all the custom resource providers within a resource group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> public static IPage <CustomRPManifest> ListByResourceGroup(this ICustomResourceProviderOperations operations, string resourceGroupName) { return(operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult()); }
/// <summary> /// Updates an existing custom resource provider. The only value that can be /// updated via PATCH currently is the tags. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='resourceProviderName'> /// The name of the resource provider. /// </param> /// <param name='tags'> /// Resource tags /// </param> public static CustomRPManifest Update(this ICustomResourceProviderOperations operations, string resourceGroupName, string resourceProviderName, IDictionary <string, string> tags = default(IDictionary <string, string>)) { return(operations.UpdateAsync(resourceGroupName, resourceProviderName, tags).GetAwaiter().GetResult()); }
/// <summary> /// Gets the custom resource provider manifest. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='resourceProviderName'> /// The name of the resource provider. /// </param> public static CustomRPManifest Get(this ICustomResourceProviderOperations operations, string resourceGroupName, string resourceProviderName) { return(operations.GetAsync(resourceGroupName, resourceProviderName).GetAwaiter().GetResult()); }