azure_mgmt_authorization 0.16.0 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-06-01/generated/azure_mgmt_authorization/authorization_management_client.rb +130 -0
  3. data/lib/2015-06-01/generated/azure_mgmt_authorization/classic_administrators.rb +228 -0
  4. data/lib/2015-06-01/generated/azure_mgmt_authorization/models/classic_administrator.rb +90 -0
  5. data/lib/2015-06-01/generated/azure_mgmt_authorization/models/classic_administrator_list_result.rb +98 -0
  6. data/lib/2015-06-01/generated/azure_mgmt_authorization/module_definition.rb +9 -0
  7. data/lib/2015-06-01/generated/azure_mgmt_authorization.rb +30 -0
  8. data/lib/2015-07-01/generated/azure_mgmt_authorization/authorization_management_client.rb +1 -1
  9. data/lib/2017-10-01-preview/generated/azure_mgmt_authorization/authorization_management_client.rb +130 -0
  10. data/lib/2017-10-01-preview/generated/azure_mgmt_authorization/models/role_assignment.rb +115 -0
  11. data/lib/2017-10-01-preview/generated/azure_mgmt_authorization/models/role_assignment_create_parameters.rb +71 -0
  12. data/lib/2017-10-01-preview/generated/azure_mgmt_authorization/models/role_assignment_filter.rb +57 -0
  13. data/lib/2017-10-01-preview/generated/azure_mgmt_authorization/models/role_assignment_list_result.rb +98 -0
  14. data/lib/2017-10-01-preview/generated/azure_mgmt_authorization/module_definition.rb +9 -0
  15. data/lib/2017-10-01-preview/generated/azure_mgmt_authorization/role_assignments.rb +1493 -0
  16. data/lib/2017-10-01-preview/generated/azure_mgmt_authorization.rb +32 -0
  17. data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/authorization_management_client.rb +143 -0
  18. data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/permission.rb +111 -0
  19. data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/permission_get_result.rb +98 -0
  20. data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/provider_operation.rb +101 -0
  21. data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/provider_operations_metadata.rb +119 -0
  22. data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/provider_operations_metadata_list_result.rb +98 -0
  23. data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/resource_type.rb +77 -0
  24. data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/role_assignment.rb +115 -0
  25. data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/role_assignment_create_parameters.rb +71 -0
  26. data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/role_assignment_filter.rb +57 -0
  27. data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/role_assignment_list_result.rb +98 -0
  28. data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/role_definition.rb +143 -0
  29. data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/role_definition_filter.rb +57 -0
  30. data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/role_definition_list_result.rb +98 -0
  31. data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/module_definition.rb +9 -0
  32. data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/permissions.rb +452 -0
  33. data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/provider_operations_metadata_operations.rb +316 -0
  34. data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/role_assignments.rb +1493 -0
  35. data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/role_definitions.rb +622 -0
  36. data/lib/2018-01-01-preview/generated/azure_mgmt_authorization.rb +44 -0
  37. data/lib/azure_mgmt_authorization.rb +3 -0
  38. data/lib/profiles/latest/modules/authorization_profile_module.rb +63 -71
  39. data/lib/version.rb +1 -1
  40. metadata +36 -2
@@ -0,0 +1,130 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Authorization::Mgmt::V2017_10_01_preview
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class AuthorizationManagementClient < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] The ID of the target subscription.
21
+ attr_accessor :subscription_id
22
+
23
+ # @return [String] The API version to use for this operation.
24
+ attr_reader :api_version
25
+
26
+ # @return [String] Gets or sets the preferred language for the response.
27
+ attr_accessor :accept_language
28
+
29
+ # @return [Integer] Gets or sets the retry timeout in seconds for Long
30
+ # Running Operations. Default value is 30.
31
+ attr_accessor :long_running_operation_retry_timeout
32
+
33
+ # @return [Boolean] When set to true a unique x-ms-client-request-id value
34
+ # is generated and included in each request. Default is true.
35
+ attr_accessor :generate_client_request_id
36
+
37
+ # @return [RoleAssignments] role_assignments
38
+ attr_reader :role_assignments
39
+
40
+ #
41
+ # Creates initializes a new instance of the AuthorizationManagementClient class.
42
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
43
+ # @param base_url [String] the base URI of the service.
44
+ # @param options [Array] filters to be applied to the HTTP requests.
45
+ #
46
+ def initialize(credentials = nil, base_url = nil, options = nil)
47
+ super(credentials, options)
48
+ @base_url = base_url || 'https://management.azure.com'
49
+
50
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
51
+ @credentials = credentials
52
+
53
+ @role_assignments = RoleAssignments.new(self)
54
+ @api_version = '2017-10-01-preview'
55
+ @accept_language = 'en-US'
56
+ @long_running_operation_retry_timeout = 30
57
+ @generate_client_request_id = true
58
+ add_telemetry
59
+ end
60
+
61
+ #
62
+ # Makes a request and returns the body of the response.
63
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
64
+ # @param path [String] the path, relative to {base_url}.
65
+ # @param options [Hash{String=>String}] specifying any request options like :body.
66
+ # @return [Hash{String=>String}] containing the body of the response.
67
+ # Example:
68
+ #
69
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
70
+ # path = "/path"
71
+ # options = {
72
+ # body: request_content,
73
+ # query_params: {'api-version' => '2016-02-01'}
74
+ # }
75
+ # result = @client.make_request(:put, path, options)
76
+ #
77
+ def make_request(method, path, options = {})
78
+ result = make_request_with_http_info(method, path, options)
79
+ result.body unless result.nil?
80
+ end
81
+
82
+ #
83
+ # Makes a request and returns the operation response.
84
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
85
+ # @param path [String] the path, relative to {base_url}.
86
+ # @param options [Hash{String=>String}] specifying any request options like :body.
87
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
88
+ #
89
+ def make_request_with_http_info(method, path, options = {})
90
+ result = make_request_async(method, path, options).value!
91
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
92
+ result
93
+ end
94
+
95
+ #
96
+ # Makes a request asynchronously.
97
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
98
+ # @param path [String] the path, relative to {base_url}.
99
+ # @param options [Hash{String=>String}] specifying any request options like :body.
100
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
101
+ #
102
+ def make_request_async(method, path, options = {})
103
+ fail ArgumentError, 'method is nil' if method.nil?
104
+ fail ArgumentError, 'path is nil' if path.nil?
105
+
106
+ request_url = options[:base_url] || @base_url
107
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
108
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
109
+ end
110
+
111
+ request_headers = @request_headers
112
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
113
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
114
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
115
+
116
+ super(request_url, method, path, options)
117
+ end
118
+
119
+
120
+ private
121
+ #
122
+ # Adds telemetry information.
123
+ #
124
+ def add_telemetry
125
+ sdk_information = 'azure_mgmt_authorization'
126
+ sdk_information = "#{sdk_information}/0.16.1"
127
+ add_user_agent_information(sdk_information)
128
+ end
129
+ end
130
+ end
@@ -0,0 +1,115 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Authorization::Mgmt::V2017_10_01_preview
7
+ module Models
8
+ #
9
+ # Role Assignments
10
+ #
11
+ class RoleAssignment
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] The role assignment ID.
16
+ attr_accessor :id
17
+
18
+ # @return [String] The role assignment name.
19
+ attr_accessor :name
20
+
21
+ # @return [String] The role assignment type.
22
+ attr_accessor :type
23
+
24
+ # @return [String] The role assignment scope.
25
+ attr_accessor :scope
26
+
27
+ # @return [String] The role definition ID.
28
+ attr_accessor :role_definition_id
29
+
30
+ # @return [String] The principal ID.
31
+ attr_accessor :principal_id
32
+
33
+ # @return [Boolean] The Delegation flag for the roleassignment
34
+ attr_accessor :can_delegate
35
+
36
+
37
+ #
38
+ # Mapper for RoleAssignment class as Ruby Hash.
39
+ # This will be used for serialization/deserialization.
40
+ #
41
+ def self.mapper()
42
+ {
43
+ client_side_validation: true,
44
+ required: false,
45
+ serialized_name: 'RoleAssignment',
46
+ type: {
47
+ name: 'Composite',
48
+ class_name: 'RoleAssignment',
49
+ model_properties: {
50
+ id: {
51
+ client_side_validation: true,
52
+ required: false,
53
+ read_only: true,
54
+ serialized_name: 'id',
55
+ type: {
56
+ name: 'String'
57
+ }
58
+ },
59
+ name: {
60
+ client_side_validation: true,
61
+ required: false,
62
+ read_only: true,
63
+ serialized_name: 'name',
64
+ type: {
65
+ name: 'String'
66
+ }
67
+ },
68
+ type: {
69
+ client_side_validation: true,
70
+ required: false,
71
+ read_only: true,
72
+ serialized_name: 'type',
73
+ type: {
74
+ name: 'String'
75
+ }
76
+ },
77
+ scope: {
78
+ client_side_validation: true,
79
+ required: false,
80
+ serialized_name: 'properties.scope',
81
+ type: {
82
+ name: 'String'
83
+ }
84
+ },
85
+ role_definition_id: {
86
+ client_side_validation: true,
87
+ required: false,
88
+ serialized_name: 'properties.roleDefinitionId',
89
+ type: {
90
+ name: 'String'
91
+ }
92
+ },
93
+ principal_id: {
94
+ client_side_validation: true,
95
+ required: false,
96
+ serialized_name: 'properties.principalId',
97
+ type: {
98
+ name: 'String'
99
+ }
100
+ },
101
+ can_delegate: {
102
+ client_side_validation: true,
103
+ required: false,
104
+ serialized_name: 'properties.canDelegate',
105
+ type: {
106
+ name: 'Boolean'
107
+ }
108
+ }
109
+ }
110
+ }
111
+ }
112
+ end
113
+ end
114
+ end
115
+ end
@@ -0,0 +1,71 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Authorization::Mgmt::V2017_10_01_preview
7
+ module Models
8
+ #
9
+ # Role assignment create parameters.
10
+ #
11
+ class RoleAssignmentCreateParameters
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] The role definition ID used in the role assignment.
16
+ attr_accessor :role_definition_id
17
+
18
+ # @return [String] The principal ID assigned to the role. This maps to
19
+ # the ID inside the Active Directory. It can point to a user, service
20
+ # principal, or security group.
21
+ attr_accessor :principal_id
22
+
23
+ # @return [Boolean] The delgation flag used for creating a role
24
+ # assignment
25
+ attr_accessor :can_delegate
26
+
27
+
28
+ #
29
+ # Mapper for RoleAssignmentCreateParameters class as Ruby Hash.
30
+ # This will be used for serialization/deserialization.
31
+ #
32
+ def self.mapper()
33
+ {
34
+ client_side_validation: true,
35
+ required: false,
36
+ serialized_name: 'RoleAssignmentCreateParameters',
37
+ type: {
38
+ name: 'Composite',
39
+ class_name: 'RoleAssignmentCreateParameters',
40
+ model_properties: {
41
+ role_definition_id: {
42
+ client_side_validation: true,
43
+ required: false,
44
+ serialized_name: 'properties.roleDefinitionId',
45
+ type: {
46
+ name: 'String'
47
+ }
48
+ },
49
+ principal_id: {
50
+ client_side_validation: true,
51
+ required: false,
52
+ serialized_name: 'properties.principalId',
53
+ type: {
54
+ name: 'String'
55
+ }
56
+ },
57
+ can_delegate: {
58
+ client_side_validation: true,
59
+ required: false,
60
+ serialized_name: 'properties.canDelegate',
61
+ type: {
62
+ name: 'Boolean'
63
+ }
64
+ }
65
+ }
66
+ }
67
+ }
68
+ end
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,57 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Authorization::Mgmt::V2017_10_01_preview
7
+ module Models
8
+ #
9
+ # Role Assignments filter
10
+ #
11
+ class RoleAssignmentFilter
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] Returns role assignment of the specific principal.
16
+ attr_accessor :principal_id
17
+
18
+ # @return [Boolean] The Delegation flag for the roleassignment
19
+ attr_accessor :can_delegate
20
+
21
+
22
+ #
23
+ # Mapper for RoleAssignmentFilter class as Ruby Hash.
24
+ # This will be used for serialization/deserialization.
25
+ #
26
+ def self.mapper()
27
+ {
28
+ client_side_validation: true,
29
+ required: false,
30
+ serialized_name: 'RoleAssignmentFilter',
31
+ type: {
32
+ name: 'Composite',
33
+ class_name: 'RoleAssignmentFilter',
34
+ model_properties: {
35
+ principal_id: {
36
+ client_side_validation: true,
37
+ required: false,
38
+ serialized_name: 'principalId',
39
+ type: {
40
+ name: 'String'
41
+ }
42
+ },
43
+ can_delegate: {
44
+ client_side_validation: true,
45
+ required: false,
46
+ serialized_name: 'canDelegate',
47
+ type: {
48
+ name: 'Boolean'
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,98 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Authorization::Mgmt::V2017_10_01_preview
7
+ module Models
8
+ #
9
+ # Role assignment list operation result.
10
+ #
11
+ class RoleAssignmentListResult
12
+
13
+ include MsRestAzure
14
+
15
+ include MsRest::JSONable
16
+ # @return [Array<RoleAssignment>] Role assignment list.
17
+ attr_accessor :value
18
+
19
+ # @return [String] The URL to use for getting the next set of results.
20
+ attr_accessor :next_link
21
+
22
+ # return [Proc] with next page method call.
23
+ attr_accessor :next_method
24
+
25
+ #
26
+ # Gets the rest of the items for the request, enabling auto-pagination.
27
+ #
28
+ # @return [Array<RoleAssignment>] operation results.
29
+ #
30
+ def get_all_items
31
+ items = @value
32
+ page = self
33
+ while page.next_link != nil do
34
+ page = page.get_next_page
35
+ items.concat(page.value)
36
+ end
37
+ items
38
+ end
39
+
40
+ #
41
+ # Gets the next page of results.
42
+ #
43
+ # @return [RoleAssignmentListResult] with next page content.
44
+ #
45
+ def get_next_page
46
+ response = @next_method.call(@next_link).value! unless @next_method.nil?
47
+ unless response.nil?
48
+ @next_link = response.body.next_link
49
+ @value = response.body.value
50
+ self
51
+ end
52
+ end
53
+
54
+ #
55
+ # Mapper for RoleAssignmentListResult class as Ruby Hash.
56
+ # This will be used for serialization/deserialization.
57
+ #
58
+ def self.mapper()
59
+ {
60
+ client_side_validation: true,
61
+ required: false,
62
+ serialized_name: 'RoleAssignmentListResult',
63
+ type: {
64
+ name: 'Composite',
65
+ class_name: 'RoleAssignmentListResult',
66
+ model_properties: {
67
+ value: {
68
+ client_side_validation: true,
69
+ required: false,
70
+ serialized_name: 'value',
71
+ type: {
72
+ name: 'Sequence',
73
+ element: {
74
+ client_side_validation: true,
75
+ required: false,
76
+ serialized_name: 'RoleAssignmentElementType',
77
+ type: {
78
+ name: 'Composite',
79
+ class_name: 'RoleAssignment'
80
+ }
81
+ }
82
+ }
83
+ },
84
+ next_link: {
85
+ client_side_validation: true,
86
+ required: false,
87
+ serialized_name: 'nextLink',
88
+ type: {
89
+ name: 'String'
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+ end
96
+ end
97
+ end
98
+ end
@@ -0,0 +1,9 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure end
7
+ module Azure::Authorization end
8
+ module Azure::Authorization::Mgmt end
9
+ module Azure::Authorization::Mgmt::V2017_10_01_preview end