azure_mgmt_resources 0.17.1 → 0.17.2

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 (23) hide show
  1. checksums.yaml +5 -5
  2. data/lib/2016-02-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  3. data/lib/2016-07-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  4. data/lib/2016-09-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  5. data/lib/2017-05-10/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  6. data/lib/2018-02-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  7. data/lib/2018-05-01/generated/azure_mgmt_resources.rb +28 -24
  8. data/lib/2018-05-01/generated/azure_mgmt_resources/models/deployment_extended.rb +2 -1
  9. data/lib/2018-05-01/generated/azure_mgmt_resources/models/operation.rb +58 -0
  10. data/lib/2018-05-01/generated/azure_mgmt_resources/models/operation_display.rb +80 -0
  11. data/lib/2018-05-01/generated/azure_mgmt_resources/models/operation_list_result.rb +100 -0
  12. data/lib/2018-05-01/generated/azure_mgmt_resources/models/resource.rb +1 -1
  13. data/lib/2018-05-01/generated/azure_mgmt_resources/models/resource_group.rb +1 -0
  14. data/lib/2018-05-01/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +1 -1
  15. data/lib/2018-05-01/generated/azure_mgmt_resources/operations.rb +215 -0
  16. data/lib/2018-05-01/generated/azure_mgmt_resources/resource_management_client.rb +5 -1
  17. data/lib/azure_mgmt_resources.rb +1 -0
  18. data/lib/profiles/latest/modules/resources_profile_module.rb +92 -78
  19. data/lib/profiles/v2018_03_01/modules/resources_profile_module.rb +271 -0
  20. data/lib/profiles/v2018_03_01/resources_module_definition.rb +8 -0
  21. data/lib/profiles/v2018_03_01/resources_v2018_03_01_profile_client.rb +40 -0
  22. data/lib/version.rb +1 -1
  23. metadata +10 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 26bebc782a20b5211b94097eb454dcc5179bad48684a2f0e0029cb70cc52e020
4
- data.tar.gz: 0743afadeb7a7806f7551482298ee617069e4655f540d772233f37d269faf0ab
2
+ SHA1:
3
+ metadata.gz: c79c2d37771f5e9fc1a8381276fbf09323240132
4
+ data.tar.gz: e80886fd9fa21df5de82013b27e27ccd00fbc3cc
5
5
  SHA512:
6
- metadata.gz: 8ce1ba8582253966e36183118057a730ffc67cb8433f9bb3684abe6b731c71c84dc5d39f4e024f28ed33e0ac18aed4a1f3bf3974940cfcb06da3352ed0c64910
7
- data.tar.gz: 0fed843f2818423117230ef7889e19e294d3ca460e4c3428c5110c58041cbf4cda594c1bd6261d3d97703718e40006f4163790c2ab7b544150fa32d19c936e7c
6
+ metadata.gz: 1db15a41e25f0d43f25cbe0a8107ccf4fe4feb2788572acc0d923f167a4c7b7899ca7d4ed6164d38fc103e6f9dbb6e7372c5a6096ede8fa1cc4ad34c2f4201a1
7
+ data.tar.gz: 4ef97a1795ccfad99691320af2e21cf1caefebe752c8a6e4afac1cc519718a11b9d42e1724ec7148ef93774e44d5a7335ff0094afa4f827273ae3bfe4101aeb7
@@ -144,7 +144,7 @@ module Azure::Resources::Mgmt::V2016_02_01
144
144
  #
145
145
  def add_telemetry
146
146
  sdk_information = 'azure_mgmt_resources'
147
- sdk_information = "#{sdk_information}/0.17.1"
147
+ sdk_information = "#{sdk_information}/0.17.2"
148
148
  add_user_agent_information(sdk_information)
149
149
  end
150
150
  end
@@ -146,7 +146,7 @@ module Azure::Resources::Mgmt::V2016_07_01
146
146
  #
147
147
  def add_telemetry
148
148
  sdk_information = 'azure_mgmt_resources'
149
- sdk_information = "#{sdk_information}/0.17.1"
149
+ sdk_information = "#{sdk_information}/0.17.2"
150
150
  add_user_agent_information(sdk_information)
151
151
  end
152
152
  end
@@ -144,7 +144,7 @@ module Azure::Resources::Mgmt::V2016_09_01
144
144
  #
145
145
  def add_telemetry
146
146
  sdk_information = 'azure_mgmt_resources'
147
- sdk_information = "#{sdk_information}/0.17.1"
147
+ sdk_information = "#{sdk_information}/0.17.2"
148
148
  add_user_agent_information(sdk_information)
149
149
  end
150
150
  end
@@ -144,7 +144,7 @@ module Azure::Resources::Mgmt::V2017_05_10
144
144
  #
145
145
  def add_telemetry
146
146
  sdk_information = 'azure_mgmt_resources'
147
- sdk_information = "#{sdk_information}/0.17.1"
147
+ sdk_information = "#{sdk_information}/0.17.2"
148
148
  add_user_agent_information(sdk_information)
149
149
  end
150
150
  end
@@ -144,7 +144,7 @@ module Azure::Resources::Mgmt::V2018_02_01
144
144
  #
145
145
  def add_telemetry
146
146
  sdk_information = 'azure_mgmt_resources'
147
- sdk_information = "#{sdk_information}/0.17.1"
147
+ sdk_information = "#{sdk_information}/0.17.2"
148
148
  add_user_agent_information(sdk_information)
149
149
  end
150
150
  end
@@ -20,6 +20,7 @@ require '2018-05-01/generated/azure_mgmt_resources/module_definition'
20
20
  require 'ms_rest_azure'
21
21
 
22
22
  module Azure::Resources::Mgmt::V2018_05_01
23
+ autoload :Operations, '2018-05-01/generated/azure_mgmt_resources/operations.rb'
23
24
  autoload :Deployments, '2018-05-01/generated/azure_mgmt_resources/deployments.rb'
24
25
  autoload :Providers, '2018-05-01/generated/azure_mgmt_resources/providers.rb'
25
26
  autoload :Resources, '2018-05-01/generated/azure_mgmt_resources/resources.rb'
@@ -29,53 +30,56 @@ module Azure::Resources::Mgmt::V2018_05_01
29
30
  autoload :ResourceManagementClient, '2018-05-01/generated/azure_mgmt_resources/resource_management_client.rb'
30
31
 
31
32
  module Models
32
- autoload :Sku, '2018-05-01/generated/azure_mgmt_resources/models/sku.rb'
33
- autoload :DeploymentExtendedFilter, '2018-05-01/generated/azure_mgmt_resources/models/deployment_extended_filter.rb'
34
33
  autoload :IdentityUserAssignedIdentitiesValue, '2018-05-01/generated/azure_mgmt_resources/models/identity_user_assigned_identities_value.rb'
35
- autoload :ResourceGroupFilter, '2018-05-01/generated/azure_mgmt_resources/models/resource_group_filter.rb'
36
34
  autoload :Identity, '2018-05-01/generated/azure_mgmt_resources/models/identity.rb'
35
+ autoload :GenericResourceFilter, '2018-05-01/generated/azure_mgmt_resources/models/generic_resource_filter.rb'
36
+ autoload :ResourceGroupFilter, '2018-05-01/generated/azure_mgmt_resources/models/resource_group_filter.rb'
37
37
  autoload :ParametersLink, '2018-05-01/generated/azure_mgmt_resources/models/parameters_link.rb'
38
- autoload :DebugSetting, '2018-05-01/generated/azure_mgmt_resources/models/debug_setting.rb'
39
- autoload :DeploymentProperties, '2018-05-01/generated/azure_mgmt_resources/models/deployment_properties.rb'
40
38
  autoload :ResourceListResult, '2018-05-01/generated/azure_mgmt_resources/models/resource_list_result.rb'
41
- autoload :DeploymentExportResult, '2018-05-01/generated/azure_mgmt_resources/models/deployment_export_result.rb'
39
+ autoload :OnErrorDeployment, '2018-05-01/generated/azure_mgmt_resources/models/on_error_deployment.rb'
42
40
  autoload :ResourceGroupProperties, '2018-05-01/generated/azure_mgmt_resources/models/resource_group_properties.rb'
43
- autoload :AliasPathType, '2018-05-01/generated/azure_mgmt_resources/models/alias_path_type.rb'
41
+ autoload :Deployment, '2018-05-01/generated/azure_mgmt_resources/models/deployment.rb'
44
42
  autoload :ResourceGroup, '2018-05-01/generated/azure_mgmt_resources/models/resource_group.rb'
45
- autoload :ProviderResourceType, '2018-05-01/generated/azure_mgmt_resources/models/provider_resource_type.rb'
43
+ autoload :ResourceManagementErrorWithDetails, '2018-05-01/generated/azure_mgmt_resources/models/resource_management_error_with_details.rb'
46
44
  autoload :ResourceGroupPatchable, '2018-05-01/generated/azure_mgmt_resources/models/resource_group_patchable.rb'
47
- autoload :BasicDependency, '2018-05-01/generated/azure_mgmt_resources/models/basic_dependency.rb'
45
+ autoload :AliasType, '2018-05-01/generated/azure_mgmt_resources/models/alias_type.rb'
48
46
  autoload :ResourceGroupListResult, '2018-05-01/generated/azure_mgmt_resources/models/resource_group_list_result.rb'
49
- autoload :OnErrorDeploymentExtended, '2018-05-01/generated/azure_mgmt_resources/models/on_error_deployment_extended.rb'
47
+ autoload :Provider, '2018-05-01/generated/azure_mgmt_resources/models/provider.rb'
50
48
  autoload :ResourcesMoveInfo, '2018-05-01/generated/azure_mgmt_resources/models/resources_move_info.rb'
51
- autoload :DeploymentValidateResult, '2018-05-01/generated/azure_mgmt_resources/models/deployment_validate_result.rb'
49
+ autoload :Dependency, '2018-05-01/generated/azure_mgmt_resources/models/dependency.rb'
52
50
  autoload :ExportTemplateRequest, '2018-05-01/generated/azure_mgmt_resources/models/export_template_request.rb'
53
- autoload :DeploymentListResult, '2018-05-01/generated/azure_mgmt_resources/models/deployment_list_result.rb'
51
+ autoload :DeploymentPropertiesExtended, '2018-05-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb'
54
52
  autoload :TagCount, '2018-05-01/generated/azure_mgmt_resources/models/tag_count.rb'
55
- autoload :Plan, '2018-05-01/generated/azure_mgmt_resources/models/plan.rb'
53
+ autoload :DeploymentExtended, '2018-05-01/generated/azure_mgmt_resources/models/deployment_extended.rb'
56
54
  autoload :TagValue, '2018-05-01/generated/azure_mgmt_resources/models/tag_value.rb'
57
- autoload :TemplateLink, '2018-05-01/generated/azure_mgmt_resources/models/template_link.rb'
55
+ autoload :ProviderListResult, '2018-05-01/generated/azure_mgmt_resources/models/provider_list_result.rb'
58
56
  autoload :TagDetails, '2018-05-01/generated/azure_mgmt_resources/models/tag_details.rb'
59
- autoload :Deployment, '2018-05-01/generated/azure_mgmt_resources/models/deployment.rb'
57
+ autoload :Sku, '2018-05-01/generated/azure_mgmt_resources/models/sku.rb'
60
58
  autoload :TagsListResult, '2018-05-01/generated/azure_mgmt_resources/models/tags_list_result.rb'
61
- autoload :AliasType, '2018-05-01/generated/azure_mgmt_resources/models/alias_type.rb'
59
+ autoload :TemplateLink, '2018-05-01/generated/azure_mgmt_resources/models/template_link.rb'
62
60
  autoload :TargetResource, '2018-05-01/generated/azure_mgmt_resources/models/target_resource.rb'
63
- autoload :Dependency, '2018-05-01/generated/azure_mgmt_resources/models/dependency.rb'
61
+ autoload :DeploymentProperties, '2018-05-01/generated/azure_mgmt_resources/models/deployment_properties.rb'
64
62
  autoload :HttpMessage, '2018-05-01/generated/azure_mgmt_resources/models/http_message.rb'
65
- autoload :DeploymentExtended, '2018-05-01/generated/azure_mgmt_resources/models/deployment_extended.rb'
63
+ autoload :AliasPathType, '2018-05-01/generated/azure_mgmt_resources/models/alias_path_type.rb'
66
64
  autoload :DeploymentOperationProperties, '2018-05-01/generated/azure_mgmt_resources/models/deployment_operation_properties.rb'
67
- autoload :GenericResourceFilter, '2018-05-01/generated/azure_mgmt_resources/models/generic_resource_filter.rb'
65
+ autoload :BasicDependency, '2018-05-01/generated/azure_mgmt_resources/models/basic_dependency.rb'
68
66
  autoload :DeploymentOperation, '2018-05-01/generated/azure_mgmt_resources/models/deployment_operation.rb'
69
- autoload :ResourceManagementErrorWithDetails, '2018-05-01/generated/azure_mgmt_resources/models/resource_management_error_with_details.rb'
67
+ autoload :DeploymentValidateResult, '2018-05-01/generated/azure_mgmt_resources/models/deployment_validate_result.rb'
70
68
  autoload :DeploymentOperationsListResult, '2018-05-01/generated/azure_mgmt_resources/models/deployment_operations_list_result.rb'
71
- autoload :DeploymentPropertiesExtended, '2018-05-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb'
69
+ autoload :Plan, '2018-05-01/generated/azure_mgmt_resources/models/plan.rb'
72
70
  autoload :ResourceProviderOperationDisplayProperties, '2018-05-01/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb'
73
- autoload :OnErrorDeployment, '2018-05-01/generated/azure_mgmt_resources/models/on_error_deployment.rb'
71
+ autoload :DebugSetting, '2018-05-01/generated/azure_mgmt_resources/models/debug_setting.rb'
74
72
  autoload :Resource, '2018-05-01/generated/azure_mgmt_resources/models/resource.rb'
75
- autoload :ProviderListResult, '2018-05-01/generated/azure_mgmt_resources/models/provider_list_result.rb'
73
+ autoload :ProviderResourceType, '2018-05-01/generated/azure_mgmt_resources/models/provider_resource_type.rb'
76
74
  autoload :SubResource, '2018-05-01/generated/azure_mgmt_resources/models/sub_resource.rb'
77
- autoload :Provider, '2018-05-01/generated/azure_mgmt_resources/models/provider.rb'
75
+ autoload :DeploymentListResult, '2018-05-01/generated/azure_mgmt_resources/models/deployment_list_result.rb'
78
76
  autoload :ResourceGroupExportResult, '2018-05-01/generated/azure_mgmt_resources/models/resource_group_export_result.rb'
77
+ autoload :DeploymentExportResult, '2018-05-01/generated/azure_mgmt_resources/models/deployment_export_result.rb'
78
+ autoload :OperationDisplay, '2018-05-01/generated/azure_mgmt_resources/models/operation_display.rb'
79
+ autoload :DeploymentExtendedFilter, '2018-05-01/generated/azure_mgmt_resources/models/deployment_extended_filter.rb'
80
+ autoload :Operation, '2018-05-01/generated/azure_mgmt_resources/models/operation.rb'
81
+ autoload :OnErrorDeploymentExtended, '2018-05-01/generated/azure_mgmt_resources/models/on_error_deployment_extended.rb'
82
+ autoload :OperationListResult, '2018-05-01/generated/azure_mgmt_resources/models/operation_list_result.rb'
79
83
  autoload :GenericResource, '2018-05-01/generated/azure_mgmt_resources/models/generic_resource.rb'
80
84
  autoload :DeploymentMode, '2018-05-01/generated/azure_mgmt_resources/models/deployment_mode.rb'
81
85
  autoload :OnErrorDeploymentType, '2018-05-01/generated/azure_mgmt_resources/models/on_error_deployment_type.rb'
@@ -49,7 +49,8 @@ module Azure::Resources::Mgmt::V2018_05_01
49
49
  },
50
50
  name: {
51
51
  client_side_validation: true,
52
- required: true,
52
+ required: false,
53
+ read_only: true,
53
54
  serialized_name: 'name',
54
55
  type: {
55
56
  name: 'String'
@@ -0,0 +1,58 @@
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::Resources::Mgmt::V2018_05_01
7
+ module Models
8
+ #
9
+ # Microsoft.Resources operation
10
+ #
11
+ class Operation
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] Operation name: {provider}/{resource}/{operation}
16
+ attr_accessor :name
17
+
18
+ # @return [OperationDisplay] The object that represents the operation.
19
+ attr_accessor :display
20
+
21
+
22
+ #
23
+ # Mapper for Operation 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: 'Operation',
31
+ type: {
32
+ name: 'Composite',
33
+ class_name: 'Operation',
34
+ model_properties: {
35
+ name: {
36
+ client_side_validation: true,
37
+ required: false,
38
+ serialized_name: 'name',
39
+ type: {
40
+ name: 'String'
41
+ }
42
+ },
43
+ display: {
44
+ client_side_validation: true,
45
+ required: false,
46
+ serialized_name: 'display',
47
+ type: {
48
+ name: 'Composite',
49
+ class_name: 'OperationDisplay'
50
+ }
51
+ }
52
+ }
53
+ }
54
+ }
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,80 @@
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::Resources::Mgmt::V2018_05_01
7
+ module Models
8
+ #
9
+ # The object that represents the operation.
10
+ #
11
+ class OperationDisplay
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] Service provider: Microsoft.Resources
16
+ attr_accessor :provider
17
+
18
+ # @return [String] Resource on which the operation is performed: Profile,
19
+ # endpoint, etc.
20
+ attr_accessor :resource
21
+
22
+ # @return [String] Operation type: Read, write, delete, etc.
23
+ attr_accessor :operation
24
+
25
+ # @return [String] Description of the operation.
26
+ attr_accessor :description
27
+
28
+
29
+ #
30
+ # Mapper for OperationDisplay class as Ruby Hash.
31
+ # This will be used for serialization/deserialization.
32
+ #
33
+ def self.mapper()
34
+ {
35
+ client_side_validation: true,
36
+ required: false,
37
+ serialized_name: 'Operation_display',
38
+ type: {
39
+ name: 'Composite',
40
+ class_name: 'OperationDisplay',
41
+ model_properties: {
42
+ provider: {
43
+ client_side_validation: true,
44
+ required: false,
45
+ serialized_name: 'provider',
46
+ type: {
47
+ name: 'String'
48
+ }
49
+ },
50
+ resource: {
51
+ client_side_validation: true,
52
+ required: false,
53
+ serialized_name: 'resource',
54
+ type: {
55
+ name: 'String'
56
+ }
57
+ },
58
+ operation: {
59
+ client_side_validation: true,
60
+ required: false,
61
+ serialized_name: 'operation',
62
+ type: {
63
+ name: 'String'
64
+ }
65
+ },
66
+ description: {
67
+ client_side_validation: true,
68
+ required: false,
69
+ serialized_name: 'description',
70
+ type: {
71
+ name: 'String'
72
+ }
73
+ }
74
+ }
75
+ }
76
+ }
77
+ end
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,100 @@
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::Resources::Mgmt::V2018_05_01
7
+ module Models
8
+ #
9
+ # Result of the request to list Microsoft.Resources operations. It contains
10
+ # a list of operations and a URL link to get the next set of results.
11
+ #
12
+ class OperationListResult
13
+
14
+ include MsRestAzure
15
+
16
+ include MsRest::JSONable
17
+ # @return [Array<Operation>] List of Microsoft.Resources operations.
18
+ attr_accessor :value
19
+
20
+ # @return [String] URL to get the next set of operation list results if
21
+ # there are any.
22
+ attr_accessor :next_link
23
+
24
+ # return [Proc] with next page method call.
25
+ attr_accessor :next_method
26
+
27
+ #
28
+ # Gets the rest of the items for the request, enabling auto-pagination.
29
+ #
30
+ # @return [Array<Operation>] operation results.
31
+ #
32
+ def get_all_items
33
+ items = @value
34
+ page = self
35
+ while page.next_link != nil do
36
+ page = page.get_next_page
37
+ items.concat(page.value)
38
+ end
39
+ items
40
+ end
41
+
42
+ #
43
+ # Gets the next page of results.
44
+ #
45
+ # @return [OperationListResult] with next page content.
46
+ #
47
+ def get_next_page
48
+ response = @next_method.call(@next_link).value! unless @next_method.nil?
49
+ unless response.nil?
50
+ @next_link = response.body.next_link
51
+ @value = response.body.value
52
+ self
53
+ end
54
+ end
55
+
56
+ #
57
+ # Mapper for OperationListResult class as Ruby Hash.
58
+ # This will be used for serialization/deserialization.
59
+ #
60
+ def self.mapper()
61
+ {
62
+ client_side_validation: true,
63
+ required: false,
64
+ serialized_name: 'OperationListResult',
65
+ type: {
66
+ name: 'Composite',
67
+ class_name: 'OperationListResult',
68
+ model_properties: {
69
+ value: {
70
+ client_side_validation: true,
71
+ required: false,
72
+ serialized_name: 'value',
73
+ type: {
74
+ name: 'Sequence',
75
+ element: {
76
+ client_side_validation: true,
77
+ required: false,
78
+ serialized_name: 'OperationElementType',
79
+ type: {
80
+ name: 'Composite',
81
+ class_name: 'Operation'
82
+ }
83
+ }
84
+ }
85
+ },
86
+ next_link: {
87
+ client_side_validation: true,
88
+ required: false,
89
+ serialized_name: 'nextLink',
90
+ type: {
91
+ name: 'String'
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }
97
+ end
98
+ end
99
+ end
100
+ end
@@ -6,7 +6,7 @@
6
6
  module Azure::Resources::Mgmt::V2018_05_01
7
7
  module Models
8
8
  #
9
- # Resource.
9
+ # Specified resource.
10
10
  #
11
11
  class Resource
12
12
 
@@ -60,6 +60,7 @@ module Azure::Resources::Mgmt::V2018_05_01
60
60
  name: {
61
61
  client_side_validation: true,
62
62
  required: false,
63
+ read_only: true,
63
64
  serialized_name: 'name',
64
65
  type: {
65
66
  name: 'String'
@@ -21,7 +21,7 @@ module Azure::Resources::Mgmt::V2018_05_01
21
21
  # @return [String] Operation resource.
22
22
  attr_accessor :resource
23
23
 
24
- # @return [String] Operation.
24
+ # @return [String] Resource provider operation.
25
25
  attr_accessor :operation
26
26
 
27
27
  # @return [String] Operation description.
@@ -0,0 +1,215 @@
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::Resources::Mgmt::V2018_05_01
7
+ #
8
+ # Provides operations for working with resources and resource groups.
9
+ #
10
+ class Operations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Operations class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ResourceManagementClient] reference to the ResourceManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Lists all of the available Microsoft.Resources REST API operations.
26
+ #
27
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
28
+ # will be added to the HTTP request.
29
+ #
30
+ # @return [Array<Operation>] operation results.
31
+ #
32
+ def list(custom_headers:nil)
33
+ first_page = list_as_lazy(custom_headers:custom_headers)
34
+ first_page.get_all_items
35
+ end
36
+
37
+ #
38
+ # Lists all of the available Microsoft.Resources REST API operations.
39
+ #
40
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
41
+ # will be added to the HTTP request.
42
+ #
43
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
44
+ #
45
+ def list_with_http_info(custom_headers:nil)
46
+ list_async(custom_headers:custom_headers).value!
47
+ end
48
+
49
+ #
50
+ # Lists all of the available Microsoft.Resources REST API operations.
51
+ #
52
+ # @param [Hash{String => String}] A hash of custom headers that will be added
53
+ # to the HTTP request.
54
+ #
55
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
56
+ #
57
+ def list_async(custom_headers:nil)
58
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
59
+
60
+
61
+ request_headers = {}
62
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
63
+
64
+ # Set Headers
65
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
66
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
67
+ path_template = 'providers/Microsoft.Resources/operations'
68
+
69
+ request_url = @base_url || @client.base_url
70
+
71
+ options = {
72
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
73
+ query_params: {'api-version' => @client.api_version},
74
+ headers: request_headers.merge(custom_headers || {}),
75
+ base_url: request_url
76
+ }
77
+ promise = @client.make_request_async(:get, path_template, options)
78
+
79
+ promise = promise.then do |result|
80
+ http_response = result.response
81
+ status_code = http_response.status
82
+ response_content = http_response.body
83
+ unless status_code == 200
84
+ error_model = JSON.load(response_content)
85
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
86
+ end
87
+
88
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
89
+ # Deserialize Response
90
+ if status_code == 200
91
+ begin
92
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
93
+ result_mapper = Azure::Resources::Mgmt::V2018_05_01::Models::OperationListResult.mapper()
94
+ result.body = @client.deserialize(result_mapper, parsed_response)
95
+ rescue Exception => e
96
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
97
+ end
98
+ end
99
+
100
+ result
101
+ end
102
+
103
+ promise.execute
104
+ end
105
+
106
+ #
107
+ # Lists all of the available Microsoft.Resources REST API operations.
108
+ #
109
+ # @param next_page_link [String] The NextLink from the previous successful call
110
+ # to List operation.
111
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
112
+ # will be added to the HTTP request.
113
+ #
114
+ # @return [OperationListResult] operation results.
115
+ #
116
+ def list_next(next_page_link, custom_headers:nil)
117
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
118
+ response.body unless response.nil?
119
+ end
120
+
121
+ #
122
+ # Lists all of the available Microsoft.Resources REST API operations.
123
+ #
124
+ # @param next_page_link [String] The NextLink from the previous successful call
125
+ # to List operation.
126
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
127
+ # will be added to the HTTP request.
128
+ #
129
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
130
+ #
131
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
132
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
133
+ end
134
+
135
+ #
136
+ # Lists all of the available Microsoft.Resources REST API operations.
137
+ #
138
+ # @param next_page_link [String] The NextLink from the previous successful call
139
+ # to List operation.
140
+ # @param [Hash{String => String}] A hash of custom headers that will be added
141
+ # to the HTTP request.
142
+ #
143
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
144
+ #
145
+ def list_next_async(next_page_link, custom_headers:nil)
146
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
147
+
148
+
149
+ request_headers = {}
150
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
151
+
152
+ # Set Headers
153
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
154
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
155
+ path_template = '{nextLink}'
156
+
157
+ request_url = @base_url || @client.base_url
158
+
159
+ options = {
160
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
161
+ skip_encoding_path_params: {'nextLink' => next_page_link},
162
+ headers: request_headers.merge(custom_headers || {}),
163
+ base_url: request_url
164
+ }
165
+ promise = @client.make_request_async(:get, path_template, options)
166
+
167
+ promise = promise.then do |result|
168
+ http_response = result.response
169
+ status_code = http_response.status
170
+ response_content = http_response.body
171
+ unless status_code == 200
172
+ error_model = JSON.load(response_content)
173
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
174
+ end
175
+
176
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
177
+ # Deserialize Response
178
+ if status_code == 200
179
+ begin
180
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
181
+ result_mapper = Azure::Resources::Mgmt::V2018_05_01::Models::OperationListResult.mapper()
182
+ result.body = @client.deserialize(result_mapper, parsed_response)
183
+ rescue Exception => e
184
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
185
+ end
186
+ end
187
+
188
+ result
189
+ end
190
+
191
+ promise.execute
192
+ end
193
+
194
+ #
195
+ # Lists all of the available Microsoft.Resources REST API operations.
196
+ #
197
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
198
+ # will be added to the HTTP request.
199
+ #
200
+ # @return [OperationListResult] which provide lazy access to pages of the
201
+ # response.
202
+ #
203
+ def list_as_lazy(custom_headers:nil)
204
+ response = list_async(custom_headers:custom_headers).value!
205
+ unless response.nil?
206
+ page = response.body
207
+ page.next_method = Proc.new do |next_page_link|
208
+ list_next_async(next_page_link, custom_headers:custom_headers)
209
+ end
210
+ page
211
+ end
212
+ end
213
+
214
+ end
215
+ end