/// <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> /// Get the policy configuration at the API 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='apiId'> /// API revision identifier. Must be unique in the current API Management /// service instance. Non-current revision has ;rev=n as a suffix where n is /// the revision number. /// </param> /// <param name='format'> /// Policy Export Format. Possible values include: 'xml', 'rawxml' /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <PolicyContract> GetAsync(this IApiPolicyOperations operations, string resourceGroupName, string serviceName, string apiId, string format = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, format, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Get the policy configuration at the API 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='apiId'> /// API revision identifier. Must be unique in the current API Management /// service instance. Non-current revision has ;rev=n as a suffix where n is /// the revision number. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <PolicyCollection> ListByApiAsync(this IApiPolicyOperations operations, string resourceGroupName, string serviceName, string apiId, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByApiWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Creates or updates policy configuration for the API. /// </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='apiId'> /// API revision identifier. Must be unique in the current API Management /// service instance. Non-current revision has ;rev=n as a suffix where n is /// the revision number. /// </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 IApiPolicyOperations operations, string resourceGroupName, string serviceName, string apiId, PolicyContract parameters, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets the entity state (Etag) version of the API policy specified by its /// identifier. /// </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='apiId'> /// API revision identifier. Must be unique in the current API Management /// service instance. Non-current revision has ;rev=n as a suffix where n is /// the revision number. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ApiPolicyGetEntityTagHeaders> GetEntityTagAsync(this IApiPolicyOperations operations, string resourceGroupName, string serviceName, string apiId, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetEntityTagWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, null, cancellationToken).ConfigureAwait(false)) { return(_result.Headers); } }
/// <summary> /// Deletes specific API policy of the Api Management service instance. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.ApiManagement.IApiPolicyOperations. /// </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='aid'> /// Required. Identifier of the API. /// </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 IApiPolicyOperations operations, string resourceGroupName, string serviceName, string aid, string etag) { return(Task.Factory.StartNew((object s) => { return ((IApiPolicyOperations)s).DeleteAsync(resourceGroupName, serviceName, aid, 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; }
/// <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 API. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.ApiManagement.IApiPolicyOperations. /// </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='aid'> /// Required. Identifier of the API. /// </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 IApiPolicyOperations operations, string resourceGroupName, string serviceName, string aid, string format, Stream policyStream, string etag) { return(operations.SetAsync(resourceGroupName, serviceName, aid, format, policyStream, etag, CancellationToken.None)); }
/// <summary> /// Gets specific API policy. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.ApiManagement.IApiPolicyOperations. /// </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='aid'> /// Required. Identifier of the API. /// </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 IApiPolicyOperations operations, string resourceGroupName, string serviceName, string aid, string format) { return(operations.GetAsync(resourceGroupName, serviceName, aid, format, CancellationToken.None)); }
/// <summary> /// Gets the entity state (Etag) version of the API policy specified by its /// identifier. /// </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='apiId'> /// API revision identifier. Must be unique in the current API Management /// service instance. Non-current revision has ;rev=n as a suffix where n is /// the revision number. /// </param> public static ApiPolicyGetEntityTagHeaders GetEntityTag(this IApiPolicyOperations operations, string resourceGroupName, string serviceName, string apiId) { return(operations.GetEntityTagAsync(resourceGroupName, serviceName, apiId).GetAwaiter().GetResult()); }
/// <summary> /// Deletes the policy configuration at the Api. /// </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='apiId'> /// API revision identifier. Must be unique in the current API Management /// service instance. Non-current revision has ;rev=n as a suffix where n is /// the revision number. /// </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 IApiPolicyOperations operations, string resourceGroupName, string serviceName, string apiId, string ifMatch, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Deletes the policy configuration at the Api. /// </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='apiId'> /// API revision identifier. Must be unique in the current API Management /// service instance. Non-current revision has ;rev=n as a suffix where n is /// the revision number. /// </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 IApiPolicyOperations operations, string resourceGroupName, string serviceName, string apiId, string ifMatch) { operations.DeleteAsync(resourceGroupName, serviceName, apiId, ifMatch).GetAwaiter().GetResult(); }
/// <summary> /// Creates or updates policy configuration for the API. /// </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='apiId'> /// API revision identifier. Must be unique in the current API Management /// service instance. Non-current revision has ;rev=n as a suffix where n is /// the revision number. /// </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 IApiPolicyOperations operations, string resourceGroupName, string serviceName, string apiId, PolicyContract parameters, string ifMatch = default(string)) { return(operations.CreateOrUpdateAsync(resourceGroupName, serviceName, apiId, parameters, ifMatch).GetAwaiter().GetResult()); }
/// <summary> /// Get the policy configuration at the API 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='apiId'> /// API revision identifier. Must be unique in the current API Management /// service instance. Non-current revision has ;rev=n as a suffix where n is /// the revision number. /// </param> /// <param name='format'> /// Policy Export Format. Possible values include: 'xml', 'rawxml' /// </param> public static PolicyContract Get(this IApiPolicyOperations operations, string resourceGroupName, string serviceName, string apiId, string format = default(string)) { return(operations.GetAsync(resourceGroupName, serviceName, apiId, format).GetAwaiter().GetResult()); }
/// <summary> /// Deletes specific API policy of the Api Management service instance. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.ApiManagement.IApiPolicyOperations. /// </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='aid'> /// Required. Identifier of the API. /// </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 IApiPolicyOperations operations, string resourceGroupName, string serviceName, string aid, string etag) { return(operations.DeleteAsync(resourceGroupName, serviceName, aid, etag, CancellationToken.None)); }
/// <summary> /// Get the policy configuration at the API 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='apiId'> /// API revision identifier. Must be unique in the current API Management /// service instance. Non-current revision has ;rev=n as a suffix where n is /// the revision number. /// </param> public static PolicyCollection ListByApi(this IApiPolicyOperations operations, string resourceGroupName, string serviceName, string apiId) { return(operations.ListByApiAsync(resourceGroupName, serviceName, apiId).GetAwaiter().GetResult()); }