/// <summary> /// Retrieves a policy set definition. /// </summary> /// <remarks> /// This operation retrieves the policy set definition in the given management /// group with the given name. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='policySetDefinitionName'> /// The name of the policy set definition to get. /// </param> /// <param name='managementGroupId'> /// The ID of the management group. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <PolicySetDefinition> GetAtManagementGroupAsync(this IPolicySetDefinitionsOperations operations, string policySetDefinitionName, string managementGroupId, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetAtManagementGroupWithHttpMessagesAsync(policySetDefinitionName, managementGroupId, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Creates or updates a policy set definition. /// </summary> /// <remarks> /// This operation creates or updates a policy set definition in the given /// subscription with the given name. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='policySetDefinitionName'> /// The name of the policy set definition to create. /// </param> /// <param name='parameters'> /// The policy set definition properties. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <PolicySetDefinition> CreateOrUpdateAsync(this IPolicySetDefinitionsOperations operations, string policySetDefinitionName, PolicySetDefinition parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(policySetDefinitionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Retrieves built-in policy set definitions. /// </summary> /// <remarks> /// This operation retrieves a list of all the built-in policy set definitions /// that match the optional given $filter. If $filter='category -eq {value}' is /// provided, the returned list only includes all built-in policy set /// definitions whose category match the {value}. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='filter'> /// The filter to apply on the operation. Valid values for $filter are: /// 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If /// $filter is not provided, no filtering is performed. If /// $filter=atExactScope() is provided, the returned list only includes all /// policy set definitions that at the given scope. If $filter='policyType -eq /// {value}' is provided, the returned list only includes all policy set /// definitions whose type match the {value}. Possible policyType values are /// NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq /// {value}' is provided, the returned list only includes all policy set /// definitions whose category match the {value}. /// </param> /// <param name='top'> /// Maximum number of records to return. When the $top filter is not provided, /// it will return 500 records. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <PolicySetDefinition> > ListBuiltInAsync(this IPolicySetDefinitionsOperations operations, string filter = default(string), int?top = default(int?), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListBuiltInWithHttpMessagesAsync(filter, top, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Retrieves built-in policy set definitions. /// </summary> /// <remarks> /// This operation retrieves a list of all the built-in policy set definitions /// that match the optional given $filter. If $filter='category -eq {value}' is /// provided, the returned list only includes all built-in policy set /// definitions whose category match the {value}. /// </remarks> /// <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> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <PolicySetDefinition> > ListBuiltInNextAsync(this IPolicySetDefinitionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListBuiltInNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Retrieves a built in policy set definition. /// </summary> /// <remarks> /// This operation retrieves the built-in policy set definition with the given /// name. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='policySetDefinitionName'> /// The name of the policy set definition to get. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <PolicySetDefinitionInner> GetBuiltInAsync(this IPolicySetDefinitionsOperations operations, string policySetDefinitionName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetBuiltInWithHttpMessagesAsync(policySetDefinitionName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Initializes client properties. /// </summary> protected override void Initialize() { PolicyAssignments = new PolicyAssignmentsOperations(this); PolicyDefinitions = new PolicyDefinitionsOperations(this); PolicySetDefinitions = new PolicySetDefinitionsOperations(this); this.BaseUri = new System.Uri("https://management.azure.com"); ApiVersion = "2019-06-01"; 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 a policy set definition. /// </summary> /// <remarks> /// This operation deletes the policy set definition in the given management /// group with the given name. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='policySetDefinitionName'> /// The name of the policy set definition to delete. /// </param> /// <param name='managementGroupId'> /// The ID of the management group. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DeleteAtManagementGroupAsync(this IPolicySetDefinitionsOperations operations, string policySetDefinitionName, string managementGroupId, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DeleteAtManagementGroupWithHttpMessagesAsync(policySetDefinitionName, managementGroupId, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Retrieves all policy set definitions in management group. /// </summary> /// <remarks> /// This operation retrieves a list of all the policy set definitions in a /// given management group that match the optional given $filter. Valid values /// for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq /// '{value}''. If $filter is not provided, the unfiltered list includes all /// policy set definitions associated with the management group, including /// those that apply directly or from management groups that contain the given /// management group. If $filter=atExactScope() is provided, the returned list /// only includes all policy set definitions that at the given management /// group. If $filter='policyType -eq {value}' is provided, the returned list /// only includes all policy set definitions whose type match the {value}. /// Possible policyType values are NotSpecified, BuiltIn and Custom. If /// $filter='category -eq {value}' is provided, the returned list only includes /// all policy set definitions whose category match the {value}. /// </remarks> /// <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 <PolicySetDefinition> ListByManagementGroupNext(this IPolicySetDefinitionsOperations operations, string nextPageLink) { return(operations.ListByManagementGroupNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// Deletes a policy set definition. /// </summary> /// <remarks> /// This operation deletes the policy set definition in the given subscription /// with the given name. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='policySetDefinitionName'> /// The name of the policy set definition to delete. /// </param> public static void Delete(this IPolicySetDefinitionsOperations operations, string policySetDefinitionName) { operations.DeleteAsync(policySetDefinitionName).GetAwaiter().GetResult(); }
/// <summary> /// Retrieves a built in policy set definition. /// </summary> /// <remarks> /// This operation retrieves the built-in policy set definition with the given /// name. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='policySetDefinitionName'> /// The name of the policy set definition to get. /// </param> public static PolicySetDefinition GetBuiltIn(this IPolicySetDefinitionsOperations operations, string policySetDefinitionName) { return(operations.GetBuiltInAsync(policySetDefinitionName).GetAwaiter().GetResult()); }
/// <summary> /// Retrieves all policy set definitions in management group. /// </summary> /// <remarks> /// This operation retrieves a list of all the a policy set definition in the /// given management group. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='managementGroupId'> /// The ID of the management group. /// </param> public static IPage <PolicySetDefinition> ListByManagementGroup(this IPolicySetDefinitionsOperations operations, string managementGroupId) { return(operations.ListByManagementGroupAsync(managementGroupId).GetAwaiter().GetResult()); }
/// <summary> /// Retrieves built-in policy set definitions. /// </summary> /// <remarks> /// This operation retrieves a list of all the built-in policy set definitions /// that match the optional given $filter. If $filter='category -eq {value}' is /// provided, the returned list only includes all built-in policy set /// definitions whose category match the {value}. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='filter'> /// The filter to apply on the operation. Valid values for $filter are: /// 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If /// $filter is not provided, no filtering is performed. If /// $filter=atExactScope() is provided, the returned list only includes all /// policy set definitions that at the given scope. If $filter='policyType -eq /// {value}' is provided, the returned list only includes all policy set /// definitions whose type match the {value}. Possible policyType values are /// NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq /// {value}' is provided, the returned list only includes all policy set /// definitions whose category match the {value}. /// </param> /// <param name='top'> /// Maximum number of records to return. When the $top filter is not provided, /// it will return 500 records. /// </param> public static IPage <PolicySetDefinition> ListBuiltIn(this IPolicySetDefinitionsOperations operations, string filter = default(string), int?top = default(int?)) { return(operations.ListBuiltInAsync(filter, top).GetAwaiter().GetResult()); }
/// <summary> /// Retrieves all policy set definitions in management group. /// </summary> /// <remarks> /// This operation retrieves a list of all the policy set definitions in a /// given management group that match the optional given $filter. Valid values /// for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq /// '{value}''. If $filter is not provided, the unfiltered list includes all /// policy set definitions associated with the management group, including /// those that apply directly or from management groups that contain the given /// management group. If $filter=atExactScope() is provided, the returned list /// only includes all policy set definitions that at the given management /// group. If $filter='policyType -eq {value}' is provided, the returned list /// only includes all policy set definitions whose type match the {value}. /// Possible policyType values are NotSpecified, BuiltIn and Custom. If /// $filter='category -eq {value}' is provided, the returned list only includes /// all policy set definitions whose category match the {value}. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='managementGroupId'> /// The ID of the management group. /// </param> /// <param name='filter'> /// The filter to apply on the operation. Valid values for $filter are: /// 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If /// $filter is not provided, no filtering is performed. If /// $filter=atExactScope() is provided, the returned list only includes all /// policy set definitions that at the given scope. If $filter='policyType -eq /// {value}' is provided, the returned list only includes all policy set /// definitions whose type match the {value}. Possible policyType values are /// NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq /// {value}' is provided, the returned list only includes all policy set /// definitions whose category match the {value}. /// </param> /// <param name='top'> /// Maximum number of records to return. When the $top filter is not provided, /// it will return 500 records. /// </param> public static IPage <PolicySetDefinition> ListByManagementGroup(this IPolicySetDefinitionsOperations operations, string managementGroupId, string filter = default(string), int?top = default(int?)) { return(operations.ListByManagementGroupAsync(managementGroupId, filter, top).GetAwaiter().GetResult()); }
/// <summary> /// Retrieves a policy set definition. /// </summary> /// <remarks> /// This operation retrieves the policy set definition in the given management /// group with the given name. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='policySetDefinitionName'> /// The name of the policy set definition to get. /// </param> /// <param name='managementGroupId'> /// The ID of the management group. /// </param> public static PolicySetDefinition GetAtManagementGroup(this IPolicySetDefinitionsOperations operations, string policySetDefinitionName, string managementGroupId) { return(operations.GetAtManagementGroupAsync(policySetDefinitionName, managementGroupId).GetAwaiter().GetResult()); }
/// <summary> /// Retrieves built-in policy set definitions. /// </summary> /// <remarks> /// This operation retrieves a list of all the built-in policy set definitions. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static IPage <PolicySetDefinition> ListBuiltIn(this IPolicySetDefinitionsOperations operations) { return(operations.ListBuiltInAsync().GetAwaiter().GetResult()); }
/// <summary> /// Deletes a policy set definition. /// </summary> /// <remarks> /// This operation deletes the policy set definition in the given management /// group with the given name. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='policySetDefinitionName'> /// The name of the policy set definition to delete. /// </param> /// <param name='managementGroupId'> /// The ID of the management group. /// </param> public static void DeleteAtManagementGroup(this IPolicySetDefinitionsOperations operations, string policySetDefinitionName, string managementGroupId) { operations.DeleteAtManagementGroupAsync(policySetDefinitionName, managementGroupId).GetAwaiter().GetResult(); }
/// <summary> /// Creates or updates a policy set definition. /// </summary> /// <remarks> /// This operation creates or updates a policy set definition in the given /// subscription with the given name. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='policySetDefinitionName'> /// The name of the policy set definition to create. /// </param> /// <param name='parameters'> /// The policy set definition properties. /// </param> public static PolicySetDefinition CreateOrUpdate(this IPolicySetDefinitionsOperations operations, string policySetDefinitionName, PolicySetDefinition parameters) { return(operations.CreateOrUpdateAsync(policySetDefinitionName, parameters).GetAwaiter().GetResult()); }
/// <summary> /// Creates or updates a policy set definition. /// </summary> /// <remarks> /// This operation creates or updates a policy set definition in the given /// management group with the given name. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='policySetDefinitionName'> /// The name of the policy set definition to create. /// </param> /// <param name='parameters'> /// The policy set definition properties. /// </param> /// <param name='managementGroupId'> /// The ID of the management group. /// </param> public static PolicySetDefinition CreateOrUpdateAtManagementGroup(this IPolicySetDefinitionsOperations operations, string policySetDefinitionName, PolicySetDefinition parameters, string managementGroupId) { return(operations.CreateOrUpdateAtManagementGroupAsync(policySetDefinitionName, parameters, managementGroupId).GetAwaiter().GetResult()); }