Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
require 'ms_rest_azure'

module Azure::ARM::Policy
autoload :PolicyAssignments, 'generated/azure_mgmt_policy/policy_assignments.rb'
autoload :PolicyDefinitions, 'generated/azure_mgmt_policy/policy_definitions.rb'
autoload :PolicyAssignments, 'generated/azure_mgmt_policy/policy_assignments.rb'
autoload :PolicyClient, 'generated/azure_mgmt_policy/policy_client.rb'

module Models
Expand All @@ -30,5 +30,6 @@ module Models
autoload :PolicyAssignmentListResult, 'generated/azure_mgmt_policy/models/policy_assignment_list_result.rb'
autoload :PolicyDefinitionListResult, 'generated/azure_mgmt_policy/models/policy_definition_list_result.rb'
autoload :PolicyType, 'generated/azure_mgmt_policy/models/policy_type.rb'
autoload :PolicyMode, 'generated/azure_mgmt_policy/models/policy_mode.rb'
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
module Azure::ARM::Policy
module Models
#
# The policy definition.
# The policy assignment.
#
class PolicyAssignment

Expand Down Expand Up @@ -88,6 +88,7 @@ def self.mapper()
},
id: {
required: false,
read_only: true,
serialized_name: 'id',
type: {
name: 'String'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ class PolicyDefinition
# 'NotSpecified', 'BuiltIn', 'Custom'
attr_accessor :policy_type

# @return [PolicyMode] The policy definition mode. Possible values are
# NotSpecified, Indexed, and All. Possible values include:
# 'NotSpecified', 'Indexed', 'All'
attr_accessor :mode

# @return [String] The display name of the policy definition.
attr_accessor :display_name

Expand All @@ -27,15 +32,16 @@ class PolicyDefinition
# @return The policy rule.
attr_accessor :policy_rule

# @return The policy definition metadata.
attr_accessor :metadata

# @return Required if a parameter is used in policy rule.
attr_accessor :parameters

# @return [String] The ID of the policy definition.
attr_accessor :id

# @return [String] The name of the policy definition. If you do not
# specify a value for name, the value is inferred from the name value in
# the request URI.
# @return [String] The name of the policy definition.
attr_accessor :name


Expand All @@ -58,6 +64,13 @@ def self.mapper()
name: 'String'
}
},
mode: {
required: false,
serialized_name: 'properties.mode',
type: {
name: 'String'
}
},
display_name: {
required: false,
serialized_name: 'properties.displayName',
Expand All @@ -79,6 +92,13 @@ def self.mapper()
name: 'Object'
}
},
metadata: {
required: false,
serialized_name: 'properties.metadata',
type: {
name: 'Object'
}
},
parameters: {
required: false,
serialized_name: 'properties.parameters',
Expand All @@ -88,13 +108,15 @@ def self.mapper()
},
id: {
required: false,
read_only: true,
serialized_name: 'id',
type: {
name: 'String'
}
},
name: {
required: false,
read_only: true,
serialized_name: 'name',
type: {
name: 'String'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.

module Azure::ARM::Policy
module Models
#
# Defines values for PolicyMode
#
module PolicyMode
NotSpecified = "NotSpecified"
Indexed = "Indexed"
All = "All"
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def delete_async(scope, policy_assignment_name, custom_headers = nil)
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = '{scope}/providers/Microsoft.Authorization/policyassignments/{policyAssignmentName}'
path_template = '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'

request_url = @base_url || @client.base_url

Expand Down Expand Up @@ -190,7 +190,7 @@ def create_async(scope, policy_assignment_name, parameters, custom_headers = nil
request_content = @client.serialize(request_mapper, parameters)
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

path_template = '{scope}/providers/Microsoft.Authorization/policyassignments/{policyAssignmentName}'
path_template = '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'

request_url = @base_url || @client.base_url

Expand Down Expand Up @@ -285,7 +285,7 @@ def get_async(scope, policy_assignment_name, custom_headers = nil)
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = '{scope}/providers/Microsoft.Authorization/policyassignments/{policyAssignmentName}'
path_template = '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'

request_url = @base_url || @client.base_url

Expand Down Expand Up @@ -495,7 +495,7 @@ def list_for_resource_async(resource_group_name, resource_provider_namespace, pa
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyassignments'
path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyAssignments'

request_url = @base_url || @client.base_url

Expand Down Expand Up @@ -582,7 +582,7 @@ def list_async(filter = nil, custom_headers = nil)
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyassignments'
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyAssignments'

request_url = @base_url || @client.base_url

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ class PolicyClient < MsRestAzure::AzureServiceClient
# is generated and included in each request. Default is true.
attr_accessor :generate_client_request_id

# @return [PolicyAssignments] policy_assignments
attr_reader :policy_assignments

# @return [PolicyDefinitions] policy_definitions
attr_reader :policy_definitions

# @return [PolicyAssignments] policy_assignments
attr_reader :policy_assignments

#
# Creates initializes a new instance of the PolicyClient class.
# @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
Expand All @@ -53,8 +53,8 @@ def initialize(credentials = nil, base_url = nil, options = nil)
fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
@credentials = credentials

@policy_assignments = PolicyAssignments.new(self)
@policy_definitions = PolicyDefinitions.new(self)
@policy_assignments = PolicyAssignments.new(self)
@api_version = '2016-12-01'
@accept_language = 'en-US'
@long_running_operation_retry_timeout = 30
Expand Down