azure_mgmt_vmware_cloudsimple 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple.rb +82 -0
  4. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/dedicated_cloud_nodes.rb +945 -0
  5. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/dedicated_cloud_services.rb +932 -0
  6. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/aggregation_type.rb +16 -0
  7. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/available_operation.rb +99 -0
  8. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/available_operation_display.rb +79 -0
  9. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/available_operation_display_property_service_specification_metrics_item.rb +94 -0
  10. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/available_operation_display_property_service_specification_metrics_list.rb +60 -0
  11. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/available_operations_list_response.rb +99 -0
  12. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/csrperror.rb +47 -0
  13. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/csrperror_body.rb +91 -0
  14. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/dedicated_cloud_node.rb +293 -0
  15. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/dedicated_cloud_node_list_response.rb +99 -0
  16. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/dedicated_cloud_service.rb +154 -0
  17. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/dedicated_cloud_service_list_response.rb +99 -0
  18. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/disk_independence_mode.rb +17 -0
  19. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/guest_ostype.rb +17 -0
  20. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/nictype.rb +20 -0
  21. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/node_status.rb +16 -0
  22. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/onboarding_status.rb +18 -0
  23. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/operation_error.rb +57 -0
  24. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/operation_origin.rb +17 -0
  25. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/operation_resource.rb +107 -0
  26. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/patch_payload.rb +54 -0
  27. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/private_cloud.rb +382 -0
  28. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/private_cloud_list.rb +98 -0
  29. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/private_cloud_resource_type.rb +15 -0
  30. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/resource_pool.rb +106 -0
  31. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/resource_pools_list_response.rb +98 -0
  32. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/sku.rb +93 -0
  33. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/sku_availability.rb +124 -0
  34. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/sku_availability_list_response.rb +99 -0
  35. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/stop_mode.rb +18 -0
  36. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/usage.rb +87 -0
  37. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/usage_count.rb +20 -0
  38. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/usage_list_response.rb +99 -0
  39. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/usage_name.rb +58 -0
  40. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_disk.rb +94 -0
  41. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_disk_controller.rb +84 -0
  42. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_machine.rb +388 -0
  43. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_machine_list_response.rb +98 -0
  44. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_machine_status.rb +20 -0
  45. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_machine_stop_mode.rb +49 -0
  46. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_machine_template.rb +283 -0
  47. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_machine_template_list_response.rb +98 -0
  48. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_network.rb +106 -0
  49. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_network_list_response.rb +98 -0
  50. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_nic.rb +124 -0
  51. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/module_definition.rb +9 -0
  52. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/operations.rb +335 -0
  53. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/private_clouds.rb +340 -0
  54. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/resource_pools.rb +349 -0
  55. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/skus_availability.rb +248 -0
  56. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/usages.rb +248 -0
  57. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/virtual_machine_templates.rb +361 -0
  58. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/virtual_machines.rb +1326 -0
  59. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/virtual_networks.rb +358 -0
  60. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/vmware_cloud_simple_client.rb +170 -0
  61. data/lib/azure_mgmt_vmware_cloudsimple.rb +6 -0
  62. data/lib/module_definition.rb +7 -0
  63. data/lib/profiles/latest/modules/vmwarecloudsimple_profile_module.rb +259 -0
  64. data/lib/profiles/latest/vmwarecloudsimple_latest_profile_client.rb +40 -0
  65. data/lib/profiles/latest/vmwarecloudsimple_module_definition.rb +8 -0
  66. data/lib/version.rb +7 -0
  67. metadata +182 -0
@@ -0,0 +1,106 @@
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::VMwareCloudSimple::Mgmt::V2019_04_01
7
+ module Models
8
+ #
9
+ # Virtual network model
10
+ #
11
+ class VirtualNetwork
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Boolean] can be used in vm creation/deletion
16
+ attr_accessor :assignable
17
+
18
+ # @return [String] virtual network id (privateCloudId:vsphereId)
19
+ attr_accessor :id
20
+
21
+ # @return [String] Azure region
22
+ attr_accessor :location
23
+
24
+ # @return [String] {VirtualNetworkName}
25
+ attr_accessor :name
26
+
27
+ # @return [String] The Private Cloud id
28
+ attr_accessor :private_cloud_id
29
+
30
+ # @return [String] {resourceProviderNamespace}/{resourceType}
31
+ attr_accessor :type
32
+
33
+
34
+ #
35
+ # Mapper for VirtualNetwork class as Ruby Hash.
36
+ # This will be used for serialization/deserialization.
37
+ #
38
+ def self.mapper()
39
+ {
40
+ client_side_validation: true,
41
+ required: false,
42
+ serialized_name: 'VirtualNetwork',
43
+ type: {
44
+ name: 'Composite',
45
+ class_name: 'VirtualNetwork',
46
+ model_properties: {
47
+ assignable: {
48
+ client_side_validation: true,
49
+ required: false,
50
+ read_only: true,
51
+ serialized_name: 'assignable',
52
+ type: {
53
+ name: 'Boolean'
54
+ }
55
+ },
56
+ id: {
57
+ client_side_validation: true,
58
+ required: true,
59
+ serialized_name: 'id',
60
+ type: {
61
+ name: 'String'
62
+ }
63
+ },
64
+ location: {
65
+ client_side_validation: true,
66
+ required: false,
67
+ read_only: true,
68
+ serialized_name: 'location',
69
+ type: {
70
+ name: 'String'
71
+ }
72
+ },
73
+ name: {
74
+ client_side_validation: true,
75
+ required: false,
76
+ read_only: true,
77
+ serialized_name: 'name',
78
+ type: {
79
+ name: 'String'
80
+ }
81
+ },
82
+ private_cloud_id: {
83
+ client_side_validation: true,
84
+ required: false,
85
+ read_only: true,
86
+ serialized_name: 'properties.privateCloudId',
87
+ type: {
88
+ name: 'String'
89
+ }
90
+ },
91
+ type: {
92
+ client_side_validation: true,
93
+ required: false,
94
+ read_only: true,
95
+ serialized_name: 'type',
96
+ type: {
97
+ name: 'String'
98
+ }
99
+ }
100
+ }
101
+ }
102
+ }
103
+ end
104
+ end
105
+ end
106
+ 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::VMwareCloudSimple::Mgmt::V2019_04_01
7
+ module Models
8
+ #
9
+ # List of virtual networks
10
+ #
11
+ class VirtualNetworkListResponse
12
+
13
+ include MsRestAzure
14
+
15
+ include MsRest::JSONable
16
+ # @return [String] Link for next list of VirtualNetwork
17
+ attr_accessor :next_link
18
+
19
+ # @return [Array<VirtualNetwork>] Results of the VirtualNetwork list
20
+ attr_accessor :value
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<VirtualNetwork>] operation results.
29
+ #
30
+ def get_all_items
31
+ items = @value
32
+ page = self
33
+ while page.next_link != nil && !page.next_link.strip.empty? 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 [VirtualNetworkListResponse] 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 VirtualNetworkListResponse 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: 'VirtualNetworkListResponse',
63
+ type: {
64
+ name: 'Composite',
65
+ class_name: 'VirtualNetworkListResponse',
66
+ model_properties: {
67
+ next_link: {
68
+ client_side_validation: true,
69
+ required: false,
70
+ serialized_name: 'nextLink',
71
+ type: {
72
+ name: 'String'
73
+ }
74
+ },
75
+ value: {
76
+ client_side_validation: true,
77
+ required: false,
78
+ serialized_name: 'value',
79
+ type: {
80
+ name: 'Sequence',
81
+ element: {
82
+ client_side_validation: true,
83
+ required: false,
84
+ serialized_name: 'VirtualNetworkElementType',
85
+ type: {
86
+ name: 'Composite',
87
+ class_name: 'VirtualNetwork'
88
+ }
89
+ }
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+ end
96
+ end
97
+ end
98
+ end
@@ -0,0 +1,124 @@
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::VMwareCloudSimple::Mgmt::V2019_04_01
7
+ module Models
8
+ #
9
+ # Virtual NIC model
10
+ #
11
+ class VirtualNic
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Array<String>] NIC ip address
16
+ attr_accessor :ip_addresses
17
+
18
+ # @return [String] NIC MAC address
19
+ attr_accessor :mac_address
20
+
21
+ # @return [VirtualNetwork] Virtual Network
22
+ attr_accessor :network
23
+
24
+ # @return [NICType] NIC type. Possible values include: 'E1000', 'E1000E',
25
+ # 'PCNET32', 'VMXNET', 'VMXNET2', 'VMXNET3'
26
+ attr_accessor :nic_type
27
+
28
+ # @return [Boolean] Is NIC powered on/off on boot
29
+ attr_accessor :power_on_boot
30
+
31
+ # @return [String] NIC id
32
+ attr_accessor :virtual_nic_id
33
+
34
+ # @return [String] NIC name
35
+ attr_accessor :virtual_nic_name
36
+
37
+
38
+ #
39
+ # Mapper for VirtualNic class as Ruby Hash.
40
+ # This will be used for serialization/deserialization.
41
+ #
42
+ def self.mapper()
43
+ {
44
+ client_side_validation: true,
45
+ required: false,
46
+ serialized_name: 'VirtualNic',
47
+ type: {
48
+ name: 'Composite',
49
+ class_name: 'VirtualNic',
50
+ model_properties: {
51
+ ip_addresses: {
52
+ client_side_validation: true,
53
+ required: false,
54
+ serialized_name: 'ipAddresses',
55
+ type: {
56
+ name: 'Sequence',
57
+ element: {
58
+ client_side_validation: true,
59
+ required: false,
60
+ serialized_name: 'StringElementType',
61
+ type: {
62
+ name: 'String'
63
+ }
64
+ }
65
+ }
66
+ },
67
+ mac_address: {
68
+ client_side_validation: true,
69
+ required: false,
70
+ serialized_name: 'macAddress',
71
+ type: {
72
+ name: 'String'
73
+ }
74
+ },
75
+ network: {
76
+ client_side_validation: true,
77
+ required: true,
78
+ serialized_name: 'network',
79
+ type: {
80
+ name: 'Composite',
81
+ class_name: 'VirtualNetwork'
82
+ }
83
+ },
84
+ nic_type: {
85
+ client_side_validation: true,
86
+ required: true,
87
+ serialized_name: 'nicType',
88
+ type: {
89
+ name: 'Enum',
90
+ module: 'NICType'
91
+ }
92
+ },
93
+ power_on_boot: {
94
+ client_side_validation: true,
95
+ required: false,
96
+ serialized_name: 'powerOnBoot',
97
+ type: {
98
+ name: 'Boolean'
99
+ }
100
+ },
101
+ virtual_nic_id: {
102
+ client_side_validation: true,
103
+ required: false,
104
+ serialized_name: 'virtualNicId',
105
+ type: {
106
+ name: 'String'
107
+ }
108
+ },
109
+ virtual_nic_name: {
110
+ client_side_validation: true,
111
+ required: false,
112
+ read_only: true,
113
+ serialized_name: 'virtualNicName',
114
+ type: {
115
+ name: 'String'
116
+ }
117
+ }
118
+ }
119
+ }
120
+ }
121
+ end
122
+ end
123
+ end
124
+ 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::VMwareCloudSimple end
8
+ module Azure::VMwareCloudSimple::Mgmt end
9
+ module Azure::VMwareCloudSimple::Mgmt::V2019_04_01 end
@@ -0,0 +1,335 @@
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::VMwareCloudSimple::Mgmt::V2019_04_01
7
+ #
8
+ # Description of the new service
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 [VMwareCloudSimpleClient] reference to the VMwareCloudSimpleClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Implements list of available operations
26
+ #
27
+ # Return list of operations
28
+ #
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [Array<AvailableOperation>] operation results.
33
+ #
34
+ def list(custom_headers:nil)
35
+ first_page = list_as_lazy(custom_headers:custom_headers)
36
+ first_page.get_all_items
37
+ end
38
+
39
+ #
40
+ # Implements list of available operations
41
+ #
42
+ # Return list of operations
43
+ #
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
48
+ #
49
+ def list_with_http_info(custom_headers:nil)
50
+ list_async(custom_headers:custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # Implements list of available operations
55
+ #
56
+ # Return list of operations
57
+ #
58
+ # @param [Hash{String => String}] A hash of custom headers that will be added
59
+ # to the HTTP request.
60
+ #
61
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
62
+ #
63
+ def list_async(custom_headers:nil)
64
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
65
+
66
+
67
+ request_headers = {}
68
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
69
+
70
+ # Set Headers
71
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
72
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
73
+ path_template = 'providers/Microsoft.VMwareCloudSimple/operations'
74
+
75
+ request_url = @base_url || @client.base_url
76
+
77
+ options = {
78
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
79
+ query_params: {'api-version' => @client.api_version},
80
+ headers: request_headers.merge(custom_headers || {}),
81
+ base_url: request_url
82
+ }
83
+ promise = @client.make_request_async(:get, path_template, options)
84
+
85
+ promise = promise.then do |result|
86
+ http_response = result.response
87
+ status_code = http_response.status
88
+ response_content = http_response.body
89
+ unless status_code == 200
90
+ error_model = JSON.load(response_content)
91
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
92
+ end
93
+
94
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
95
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
96
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
97
+ # Deserialize Response
98
+ if status_code == 200
99
+ begin
100
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
101
+ result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::AvailableOperationsListResponse.mapper()
102
+ result.body = @client.deserialize(result_mapper, parsed_response)
103
+ rescue Exception => e
104
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
105
+ end
106
+ end
107
+
108
+ result
109
+ end
110
+
111
+ promise.execute
112
+ end
113
+
114
+ #
115
+ # Implements get of async operation
116
+ #
117
+ # Return an async operation
118
+ #
119
+ # @param region_id [String] The region Id (westus, eastus)
120
+ # @param operation_id [String] operation id
121
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
122
+ # will be added to the HTTP request.
123
+ #
124
+ # @return [OperationResource] operation results.
125
+ #
126
+ def get(region_id, operation_id, custom_headers:nil)
127
+ response = get_async(region_id, operation_id, custom_headers:custom_headers).value!
128
+ response.body unless response.nil?
129
+ end
130
+
131
+ #
132
+ # Implements get of async operation
133
+ #
134
+ # Return an async operation
135
+ #
136
+ # @param region_id [String] The region Id (westus, eastus)
137
+ # @param operation_id [String] operation id
138
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
139
+ # will be added to the HTTP request.
140
+ #
141
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
142
+ #
143
+ def get_with_http_info(region_id, operation_id, custom_headers:nil)
144
+ get_async(region_id, operation_id, custom_headers:custom_headers).value!
145
+ end
146
+
147
+ #
148
+ # Implements get of async operation
149
+ #
150
+ # Return an async operation
151
+ #
152
+ # @param region_id [String] The region Id (westus, eastus)
153
+ # @param operation_id [String] operation id
154
+ # @param [Hash{String => String}] A hash of custom headers that will be added
155
+ # to the HTTP request.
156
+ #
157
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
158
+ #
159
+ def get_async(region_id, operation_id, custom_headers:nil)
160
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
161
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
162
+ fail ArgumentError, 'region_id is nil' if region_id.nil?
163
+ fail ArgumentError, '@client.referer is nil' if @client.referer.nil?
164
+ fail ArgumentError, 'operation_id is nil' if operation_id.nil?
165
+
166
+
167
+ request_headers = {}
168
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
169
+
170
+ # Set Headers
171
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
172
+ request_headers['Referer'] = @client.referer unless @client.referer.nil?
173
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
174
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/operationResults/{operationId}'
175
+
176
+ request_url = @base_url || @client.base_url
177
+
178
+ options = {
179
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
180
+ path_params: {'subscriptionId' => @client.subscription_id,'regionId' => region_id,'operationId' => operation_id},
181
+ query_params: {'api-version' => @client.api_version},
182
+ headers: request_headers.merge(custom_headers || {}),
183
+ base_url: request_url
184
+ }
185
+ promise = @client.make_request_async(:get, path_template, options)
186
+
187
+ promise = promise.then do |result|
188
+ http_response = result.response
189
+ status_code = http_response.status
190
+ response_content = http_response.body
191
+ unless status_code == 200 || status_code == 202 || status_code == 204
192
+ error_model = JSON.load(response_content)
193
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
194
+ end
195
+
196
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
197
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
198
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
199
+ # Deserialize Response
200
+ if status_code == 200
201
+ begin
202
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
203
+ result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::OperationResource.mapper()
204
+ result.body = @client.deserialize(result_mapper, parsed_response)
205
+ rescue Exception => e
206
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
207
+ end
208
+ end
209
+
210
+ result
211
+ end
212
+
213
+ promise.execute
214
+ end
215
+
216
+ #
217
+ # Implements list of available operations
218
+ #
219
+ # Return list of operations
220
+ #
221
+ # @param next_page_link [String] The NextLink from the previous successful call
222
+ # to List operation.
223
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
224
+ # will be added to the HTTP request.
225
+ #
226
+ # @return [AvailableOperationsListResponse] operation results.
227
+ #
228
+ def list_next(next_page_link, custom_headers:nil)
229
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
230
+ response.body unless response.nil?
231
+ end
232
+
233
+ #
234
+ # Implements list of available operations
235
+ #
236
+ # Return list of operations
237
+ #
238
+ # @param next_page_link [String] The NextLink from the previous successful call
239
+ # to List operation.
240
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
241
+ # will be added to the HTTP request.
242
+ #
243
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
244
+ #
245
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
246
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
247
+ end
248
+
249
+ #
250
+ # Implements list of available operations
251
+ #
252
+ # Return list of operations
253
+ #
254
+ # @param next_page_link [String] The NextLink from the previous successful call
255
+ # to List operation.
256
+ # @param [Hash{String => String}] A hash of custom headers that will be added
257
+ # to the HTTP request.
258
+ #
259
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
260
+ #
261
+ def list_next_async(next_page_link, custom_headers:nil)
262
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
263
+
264
+
265
+ request_headers = {}
266
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
267
+
268
+ # Set Headers
269
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
270
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
271
+ path_template = '{nextLink}'
272
+
273
+ request_url = @base_url || @client.base_url
274
+
275
+ options = {
276
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
277
+ skip_encoding_path_params: {'nextLink' => next_page_link},
278
+ headers: request_headers.merge(custom_headers || {}),
279
+ base_url: request_url
280
+ }
281
+ promise = @client.make_request_async(:get, path_template, options)
282
+
283
+ promise = promise.then do |result|
284
+ http_response = result.response
285
+ status_code = http_response.status
286
+ response_content = http_response.body
287
+ unless status_code == 200
288
+ error_model = JSON.load(response_content)
289
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
290
+ end
291
+
292
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
293
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
294
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
295
+ # Deserialize Response
296
+ if status_code == 200
297
+ begin
298
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
299
+ result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::AvailableOperationsListResponse.mapper()
300
+ result.body = @client.deserialize(result_mapper, parsed_response)
301
+ rescue Exception => e
302
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
303
+ end
304
+ end
305
+
306
+ result
307
+ end
308
+
309
+ promise.execute
310
+ end
311
+
312
+ #
313
+ # Implements list of available operations
314
+ #
315
+ # Return list of operations
316
+ #
317
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
318
+ # will be added to the HTTP request.
319
+ #
320
+ # @return [AvailableOperationsListResponse] which provide lazy access to pages
321
+ # of the response.
322
+ #
323
+ def list_as_lazy(custom_headers:nil)
324
+ response = list_async(custom_headers:custom_headers).value!
325
+ unless response.nil?
326
+ page = response.body
327
+ page.next_method = Proc.new do |next_page_link|
328
+ list_next_async(next_page_link, custom_headers:custom_headers)
329
+ end
330
+ page
331
+ end
332
+ end
333
+
334
+ end
335
+ end