/// <summary> /// Get the policy configuration at the Product level. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='productId'> /// Product identifier. Must be unique in the current API Management service /// instance. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <PolicyCollection> ListByProductAsync(this IProductPolicyOperations operations, string resourceGroupName, string serviceName, string productId, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByProductWithHttpMessagesAsync(resourceGroupName, serviceName, productId, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Initializes a new instance of the ApiManagementClient class. /// </summary> /// <param name='httpClient'> /// The Http client /// </param> public ApiManagementClient(HttpClient httpClient) : base(httpClient) { this._apiOperationPolicy = new ApiOperationPolicyOperations(this); this._apiOperations = new ApiOperationsOperations(this); this._apiPolicy = new ApiPolicyOperations(this); this._apiProducts = new ApiProductsOperations(this); this._apis = new ApisOperations(this); this._authorizationServers = new AuthorizationServersOperations(this); this._certificates = new CertificatesOperations(this); this._groups = new GroupsOperations(this); this._groupUsers = new GroupUsersOperations(this); this._policySnippents = new PolicySnippetsOperations(this); this._productApis = new ProductApisOperations(this); this._productGroups = new ProductGroupsOperations(this); this._productPolicy = new ProductPolicyOperations(this); this._products = new ProductsOperations(this); this._productSubscriptions = new ProductSubscriptionsOperations(this); this._regions = new RegionsOperations(this); this._reports = new ReportsOperations(this); this._resourceProvider = new ResourceProviderOperations(this); this._subscriptions = new SubscriptionsOperations(this); this._tenantPolicy = new TenantPolicyOperations(this); this._userApplications = new UserApplicationsOperations(this); this._userGroups = new UserGroupsOperations(this); this._userIdentities = new UserIdentitiesOperations(this); this._users = new UsersOperations(this); this._apiVersion = "2014-02-14"; this._longRunningOperationInitialTimeout = -1; this._longRunningOperationRetryTimeout = -1; this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Creates or updates policy configuration for the Product. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='productId'> /// Product identifier. Must be unique in the current API Management service /// instance. /// </param> /// <param name='parameters'> /// The policy contents to apply. /// </param> /// <param name='ifMatch'> /// ETag of the Entity. Not required when creating an entity, but required when /// updating an entity. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <PolicyContract> CreateOrUpdateAsync(this IProductPolicyOperations operations, string resourceGroupName, string serviceName, string productId, PolicyContract parameters, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, productId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Deletes specific product policy of the Api Management service /// instance. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.ApiManagement.IProductPolicyOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='serviceName'> /// Required. The name of the Api Management service. /// </param> /// <param name='pid'> /// Required. Identifier of the product. /// </param> /// <param name='etag'> /// Required. ETag. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static AzureOperationResponse Delete(this IProductPolicyOperations operations, string resourceGroupName, string serviceName, string pid, string etag) { return(Task.Factory.StartNew((object s) => { return ((IProductPolicyOperations)s).DeleteAsync(resourceGroupName, serviceName, pid, etag); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
internal PolicyOperations( ITenantPolicyOperations tenantLevel, IProductPolicyOperations productLevel, IApiPolicyOperations apiLevel, IApiOperationPolicyOperations operationLevel) { TenantLevel = tenantLevel; ProductLevel = productLevel; ApiLevel = apiLevel; OperationLevel = operationLevel; }
internal PolicyOperations( ITenantPolicyOperations tenantLevel, IProductPolicyOperations productLevel, IApiPolicyOperations apiLevel, IApiOperationPolicyOperations operationLevel) { TenantLevel = tenantLevel; ProductLevel = productLevel; ApiLevel = apiLevel; OperationLevel = operationLevel; }
/// <summary> /// Initializes a new instance of the ApiManagementClient class. /// </summary> /// <param name='httpClient'> /// The Http client /// </param> public ApiManagementClient(HttpClient httpClient) : base(httpClient) { this._apiOperationPolicy = new ApiOperationPolicyOperations(this); this._apiOperations = new ApiOperationsOperations(this); this._apiPolicy = new ApiPolicyOperations(this); this._apiProducts = new ApiProductsOperations(this); this._apis = new ApisOperations(this); this._authorizationServers = new AuthorizationServersOperations(this); this._backends = new BackendOperations(this); this._certificates = new CertificatesOperations(this); this._groups = new GroupsOperations(this); this._groupUsers = new GroupUsersOperations(this); this._identityProvider = new IdentityProviderOperations(this); this._loggers = new LoggerOperations(this); this._openIdConnectProviders = new OpenIdConnectProvidersOperations(this); this._policySnippents = new PolicySnippetsOperations(this); this._productApis = new ProductApisOperations(this); this._productGroups = new ProductGroupsOperations(this); this._productPolicy = new ProductPolicyOperations(this); this._products = new ProductsOperations(this); this._productSubscriptions = new ProductSubscriptionsOperations(this); this._property = new PropertiesOperations(this); this._regions = new RegionsOperations(this); this._reports = new ReportsOperations(this); this._resourceProvider = new ResourceProviderOperations(this); this._subscriptions = new SubscriptionsOperations(this); this._tenantAccessGit = new TenantAccessGitOperations(this); this._tenantAccess = new TenantAccessInformationOperations(this); this._tenantConfiguration = new TenantConfigurationOperations(this); this._tenantConfigurationSyncState = new TenantConfigurationSyncStateOperation(this); this._tenantPolicy = new TenantPolicyOperations(this); this._userApplications = new UserApplicationsOperations(this); this._userGroups = new UserGroupsOperations(this); this._userIdentities = new UserIdentitiesOperations(this); this._users = new UsersOperations(this); this._userSubscriptions = new UserSubscriptionsOperations(this); this._apiVersion = "2016-10-10"; this._longRunningOperationInitialTimeout = -1; this._longRunningOperationRetryTimeout = -1; this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Sets policy for product. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.ApiManagement.IProductPolicyOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='serviceName'> /// Required. The name of the Api Management service. /// </param> /// <param name='pid'> /// Required. Identifier of the product. /// </param> /// <param name='format'> /// Required. Format of the policy. Supported formats: /// application/vnd.ms-azure-apim.policy+xml, /// application/vnd.ms-azure-apim.policy.raw+xml /// </param> /// <param name='policyStream'> /// Required. Policy stream. /// </param> /// <param name='etag'> /// Optional. ETag. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <AzureOperationResponse> SetAsync(this IProductPolicyOperations operations, string resourceGroupName, string serviceName, string pid, string format, Stream policyStream, string etag) { return(operations.SetAsync(resourceGroupName, serviceName, pid, format, policyStream, etag, CancellationToken.None)); }
/// <summary> /// Gets specific product policy. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.ApiManagement.IProductPolicyOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='serviceName'> /// Required. The name of the Api Management service. /// </param> /// <param name='pid'> /// Required. Identifier of the product. /// </param> /// <param name='format'> /// Required. Format of the policy. Supported formats: /// application/vnd.ms-azure-apim.policy+xml, /// application/vnd.ms-azure-apim.policy.raw+xml /// </param> /// <returns> /// The response model for the get policy output operation. /// </returns> public static Task <PolicyGetResponse> GetAsync(this IProductPolicyOperations operations, string resourceGroupName, string serviceName, string pid, string format) { return(operations.GetAsync(resourceGroupName, serviceName, pid, format, CancellationToken.None)); }
/// <summary> /// Get the ETag of the policy configuration at the Product level. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='productId'> /// Product identifier. Must be unique in the current API Management service /// instance. /// </param> public static ProductPolicyGetEntityTagHeaders GetEntityTag(this IProductPolicyOperations operations, string resourceGroupName, string serviceName, string productId) { return(operations.GetEntityTagAsync(resourceGroupName, serviceName, productId).GetAwaiter().GetResult()); }
/// <summary> /// Deletes the policy configuration at the Product. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='productId'> /// Product identifier. Must be unique in the current API Management service /// instance. /// </param> /// <param name='ifMatch'> /// ETag of the Entity. ETag should match the current entity state from the /// header response of the GET request or it should be * for unconditional /// update. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DeleteAsync(this IProductPolicyOperations operations, string resourceGroupName, string serviceName, string productId, string ifMatch, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceName, productId, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Deletes the policy configuration at the Product. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='productId'> /// Product identifier. Must be unique in the current API Management service /// instance. /// </param> /// <param name='ifMatch'> /// ETag of the Entity. ETag should match the current entity state from the /// header response of the GET request or it should be * for unconditional /// update. /// </param> public static void Delete(this IProductPolicyOperations operations, string resourceGroupName, string serviceName, string productId, string ifMatch) { operations.DeleteAsync(resourceGroupName, serviceName, productId, ifMatch).GetAwaiter().GetResult(); }
/// <summary> /// Creates or updates policy configuration for the Product. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='productId'> /// Product identifier. Must be unique in the current API Management service /// instance. /// </param> /// <param name='parameters'> /// The policy contents to apply. /// </param> /// <param name='ifMatch'> /// ETag of the Entity. Not required when creating an entity, but required when /// updating an entity. /// </param> public static PolicyContract CreateOrUpdate(this IProductPolicyOperations operations, string resourceGroupName, string serviceName, string productId, PolicyContract parameters, string ifMatch = default(string)) { return(operations.CreateOrUpdateAsync(resourceGroupName, serviceName, productId, parameters, ifMatch).GetAwaiter().GetResult()); }
/// <summary> /// Get the policy configuration at the Product level. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='productId'> /// Product identifier. Must be unique in the current API Management service /// instance. /// </param> /// <param name='format'> /// Policy Export Format. Possible values include: 'xml', 'rawxml' /// </param> public static PolicyContract Get(this IProductPolicyOperations operations, string resourceGroupName, string serviceName, string productId, string format = default(string)) { return(operations.GetAsync(resourceGroupName, serviceName, productId, format).GetAwaiter().GetResult()); }
/// <summary> /// Get the ETag of the policy configuration at the Product level. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='productId'> /// Product identifier. Must be unique in the current API Management service /// instance. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ProductPolicyGetEntityTagHeaders> GetEntityTagAsync(this IProductPolicyOperations operations, string resourceGroupName, string serviceName, string productId, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetEntityTagWithHttpMessagesAsync(resourceGroupName, serviceName, productId, null, cancellationToken).ConfigureAwait(false)) { return(_result.Headers); } }
/// <summary> /// Deletes specific product policy of the Api Management service /// instance. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.ApiManagement.IProductPolicyOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='serviceName'> /// Required. The name of the Api Management service. /// </param> /// <param name='pid'> /// Required. Identifier of the product. /// </param> /// <param name='etag'> /// Required. ETag. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <AzureOperationResponse> DeleteAsync(this IProductPolicyOperations operations, string resourceGroupName, string serviceName, string pid, string etag) { return(operations.DeleteAsync(resourceGroupName, serviceName, pid, etag, CancellationToken.None)); }
/// <summary> /// Get the policy configuration at the Product level. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='productId'> /// Product identifier. Must be unique in the current API Management service /// instance. /// </param> public static PolicyCollection ListByProduct(this IProductPolicyOperations operations, string resourceGroupName, string serviceName, string productId) { return(operations.ListByProductAsync(resourceGroupName, serviceName, productId).GetAwaiter().GetResult()); }