azure_mgmt_operations_management 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management.rb +48 -0
  4. data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/management_associations.rb +447 -0
  5. data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/management_configurations.rb +447 -0
  6. data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/arm_template_parameter.rb +57 -0
  7. data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/code_message_error.rb +47 -0
  8. data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/code_message_error_error.rb +57 -0
  9. data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/management_association.rb +96 -0
  10. data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/management_association_properties.rb +48 -0
  11. data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/management_association_properties_list.rb +56 -0
  12. data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/management_configuration.rb +96 -0
  13. data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/management_configuration_properties.rb +104 -0
  14. data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/management_configuration_properties_list.rb +56 -0
  15. data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/operation.rb +59 -0
  16. data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/operation_display.rb +68 -0
  17. data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/operation_list_result.rb +56 -0
  18. data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/solution.rb +127 -0
  19. data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/solution_patch.rb +54 -0
  20. data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/solution_plan.rb +86 -0
  21. data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/solution_properties.rb +102 -0
  22. data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/solution_properties_list.rb +56 -0
  23. data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/module_definition.rb +9 -0
  24. data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/operations.rb +109 -0
  25. data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/operations_management_client.rb +154 -0
  26. data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/solutions.rb +803 -0
  27. data/lib/azure_mgmt_operations_management.rb +6 -0
  28. data/lib/module_definition.rb +7 -0
  29. data/lib/profiles/latest/modules/operationsmanagement_profile_module.rb +135 -0
  30. data/lib/profiles/latest/operationsmanagement_latest_profile_client.rb +40 -0
  31. data/lib/profiles/latest/operationsmanagement_module_definition.rb +8 -0
  32. data/lib/version.rb +7 -0
  33. metadata +148 -0
@@ -0,0 +1,102 @@
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::OperationsManagement::Mgmt::V2015_11_01_preview
7
+ module Models
8
+ #
9
+ # Solution properties supported by the OperationsManagement resource
10
+ # provider.
11
+ #
12
+ class SolutionProperties
13
+
14
+ include MsRestAzure
15
+
16
+ # @return [String] The azure resourceId for the workspace where the
17
+ # solution will be deployed/enabled.
18
+ attr_accessor :workspace_resource_id
19
+
20
+ # @return [String] The provisioning state for the solution.
21
+ attr_accessor :provisioning_state
22
+
23
+ # @return [Array<String>] The azure resources that will be contained
24
+ # within the solutions. They will be locked and gets deleted
25
+ # automatically when the solution is deleted.
26
+ attr_accessor :contained_resources
27
+
28
+ # @return [Array<String>] The resources that will be referenced from this
29
+ # solution. Deleting any of those solution out of band will break the
30
+ # solution.
31
+ attr_accessor :referenced_resources
32
+
33
+
34
+ #
35
+ # Mapper for SolutionProperties 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: 'SolutionProperties',
43
+ type: {
44
+ name: 'Composite',
45
+ class_name: 'SolutionProperties',
46
+ model_properties: {
47
+ workspace_resource_id: {
48
+ client_side_validation: true,
49
+ required: true,
50
+ serialized_name: 'workspaceResourceId',
51
+ type: {
52
+ name: 'String'
53
+ }
54
+ },
55
+ provisioning_state: {
56
+ client_side_validation: true,
57
+ required: false,
58
+ read_only: true,
59
+ serialized_name: 'provisioningState',
60
+ type: {
61
+ name: 'String'
62
+ }
63
+ },
64
+ contained_resources: {
65
+ client_side_validation: true,
66
+ required: false,
67
+ serialized_name: 'containedResources',
68
+ type: {
69
+ name: 'Sequence',
70
+ element: {
71
+ client_side_validation: true,
72
+ required: false,
73
+ serialized_name: 'StringElementType',
74
+ type: {
75
+ name: 'String'
76
+ }
77
+ }
78
+ }
79
+ },
80
+ referenced_resources: {
81
+ client_side_validation: true,
82
+ required: false,
83
+ serialized_name: 'referencedResources',
84
+ type: {
85
+ name: 'Sequence',
86
+ element: {
87
+ client_side_validation: true,
88
+ required: false,
89
+ serialized_name: 'StringElementType',
90
+ type: {
91
+ name: 'String'
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }
97
+ }
98
+ }
99
+ end
100
+ end
101
+ end
102
+ end
@@ -0,0 +1,56 @@
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::OperationsManagement::Mgmt::V2015_11_01_preview
7
+ module Models
8
+ #
9
+ # the list of solution response
10
+ #
11
+ class SolutionPropertiesList
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Array<Solution>] List of solution properties within the
16
+ # subscription.
17
+ attr_accessor :value
18
+
19
+
20
+ #
21
+ # Mapper for SolutionPropertiesList class as Ruby Hash.
22
+ # This will be used for serialization/deserialization.
23
+ #
24
+ def self.mapper()
25
+ {
26
+ client_side_validation: true,
27
+ required: false,
28
+ serialized_name: 'SolutionPropertiesList',
29
+ type: {
30
+ name: 'Composite',
31
+ class_name: 'SolutionPropertiesList',
32
+ model_properties: {
33
+ value: {
34
+ client_side_validation: true,
35
+ required: false,
36
+ serialized_name: 'value',
37
+ type: {
38
+ name: 'Sequence',
39
+ element: {
40
+ client_side_validation: true,
41
+ required: false,
42
+ serialized_name: 'SolutionElementType',
43
+ type: {
44
+ name: 'Composite',
45
+ class_name: 'Solution'
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ end
54
+ end
55
+ end
56
+ 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::OperationsManagement end
8
+ module Azure::OperationsManagement::Mgmt end
9
+ module Azure::OperationsManagement::Mgmt::V2015_11_01_preview end
@@ -0,0 +1,109 @@
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::OperationsManagement::Mgmt::V2015_11_01_preview
7
+ #
8
+ # Operations Management Client
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 [OperationsManagementClient] reference to the OperationsManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Lists all of the available OperationsManagement 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 [OperationListResult] operation results.
31
+ #
32
+ def list(custom_headers:nil)
33
+ response = list_async(custom_headers:custom_headers).value!
34
+ response.body unless response.nil?
35
+ end
36
+
37
+ #
38
+ # Lists all of the available OperationsManagement 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 OperationsManagement 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.OperationsManagement/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
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
90
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
91
+ # Deserialize Response
92
+ if status_code == 200
93
+ begin
94
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
95
+ result_mapper = Azure::OperationsManagement::Mgmt::V2015_11_01_preview::Models::OperationListResult.mapper()
96
+ result.body = @client.deserialize(result_mapper, parsed_response)
97
+ rescue Exception => e
98
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
99
+ end
100
+ end
101
+
102
+ result
103
+ end
104
+
105
+ promise.execute
106
+ end
107
+
108
+ end
109
+ end
@@ -0,0 +1,154 @@
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::OperationsManagement::Mgmt::V2015_11_01_preview
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class OperationsManagementClient < 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] Gets subscription credentials which uniquely identify
21
+ # Microsoft Azure subscription. The subscription ID forms part of the URI
22
+ # for every service call.
23
+ attr_accessor :subscription_id
24
+
25
+ # @return [String] Client Api Version.
26
+ attr_reader :api_version
27
+
28
+ # @return [String] Provider name for the parent resource.
29
+ attr_accessor :provider_name
30
+
31
+ # @return [String] Resource type for the parent resource
32
+ attr_accessor :resource_type
33
+
34
+ # @return [String] Parent resource name.
35
+ attr_accessor :resource_name
36
+
37
+ # @return [String] The preferred language for the response.
38
+ attr_accessor :accept_language
39
+
40
+ # @return [Integer] The retry timeout in seconds for Long Running
41
+ # Operations. Default value is 30.
42
+ attr_accessor :long_running_operation_retry_timeout
43
+
44
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
45
+ # generated. When set to true a unique x-ms-client-request-id value is
46
+ # generated and included in each request. Default is true.
47
+ attr_accessor :generate_client_request_id
48
+
49
+ # @return [Solutions] solutions
50
+ attr_reader :solutions
51
+
52
+ # @return [ManagementAssociations] management_associations
53
+ attr_reader :management_associations
54
+
55
+ # @return [ManagementConfigurations] management_configurations
56
+ attr_reader :management_configurations
57
+
58
+ # @return [Operations] operations
59
+ attr_reader :operations
60
+
61
+ #
62
+ # Creates initializes a new instance of the OperationsManagementClient class.
63
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
64
+ # @param base_url [String] the base URI of the service.
65
+ # @param options [Array] filters to be applied to the HTTP requests.
66
+ #
67
+ def initialize(credentials = nil, base_url = nil, options = nil)
68
+ super(credentials, options)
69
+ @base_url = base_url || 'https://management.azure.com'
70
+
71
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
72
+ @credentials = credentials
73
+
74
+ @solutions = Solutions.new(self)
75
+ @management_associations = ManagementAssociations.new(self)
76
+ @management_configurations = ManagementConfigurations.new(self)
77
+ @operations = Operations.new(self)
78
+ @api_version = '2015-11-01-preview'
79
+ @accept_language = 'en-US'
80
+ @long_running_operation_retry_timeout = 30
81
+ @generate_client_request_id = true
82
+ add_telemetry
83
+ end
84
+
85
+ #
86
+ # Makes a request and returns the body of the response.
87
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
88
+ # @param path [String] the path, relative to {base_url}.
89
+ # @param options [Hash{String=>String}] specifying any request options like :body.
90
+ # @return [Hash{String=>String}] containing the body of the response.
91
+ # Example:
92
+ #
93
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
94
+ # path = "/path"
95
+ # options = {
96
+ # body: request_content,
97
+ # query_params: {'api-version' => '2016-02-01'}
98
+ # }
99
+ # result = @client.make_request(:put, path, options)
100
+ #
101
+ def make_request(method, path, options = {})
102
+ result = make_request_with_http_info(method, path, options)
103
+ result.body unless result.nil?
104
+ end
105
+
106
+ #
107
+ # Makes a request and returns the operation response.
108
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
109
+ # @param path [String] the path, relative to {base_url}.
110
+ # @param options [Hash{String=>String}] specifying any request options like :body.
111
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
112
+ #
113
+ def make_request_with_http_info(method, path, options = {})
114
+ result = make_request_async(method, path, options).value!
115
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
116
+ result
117
+ end
118
+
119
+ #
120
+ # Makes a request asynchronously.
121
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
122
+ # @param path [String] the path, relative to {base_url}.
123
+ # @param options [Hash{String=>String}] specifying any request options like :body.
124
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
125
+ #
126
+ def make_request_async(method, path, options = {})
127
+ fail ArgumentError, 'method is nil' if method.nil?
128
+ fail ArgumentError, 'path is nil' if path.nil?
129
+
130
+ request_url = options[:base_url] || @base_url
131
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
132
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
133
+ end
134
+
135
+ request_headers = @request_headers
136
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
137
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
138
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
139
+
140
+ super(request_url, method, path, options)
141
+ end
142
+
143
+
144
+ private
145
+ #
146
+ # Adds telemetry information.
147
+ #
148
+ def add_telemetry
149
+ sdk_information = 'azure_mgmt_operations_management'
150
+ sdk_information = "#{sdk_information}/0.17.0"
151
+ add_user_agent_information(sdk_information)
152
+ end
153
+ end
154
+ end
@@ -0,0 +1,803 @@
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::OperationsManagement::Mgmt::V2015_11_01_preview
7
+ #
8
+ # Operations Management Client
9
+ #
10
+ class Solutions
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Solutions class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [OperationsManagementClient] reference to the OperationsManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Create/Update Solution.
26
+ #
27
+ # Creates or updates the Solution.
28
+ #
29
+ # @param resource_group_name [String] The name of the resource group to get.
30
+ # The name is case insensitive.
31
+ # @param solution_name [String] User Solution Name.
32
+ # @param parameters [Solution] The parameters required to create OMS Solution.
33
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
34
+ # will be added to the HTTP request.
35
+ #
36
+ # @return [Solution] operation results.
37
+ #
38
+ def create_or_update(resource_group_name, solution_name, parameters, custom_headers:nil)
39
+ response = create_or_update_async(resource_group_name, solution_name, parameters, custom_headers:custom_headers).value!
40
+ response.body unless response.nil?
41
+ end
42
+
43
+ #
44
+ # @param resource_group_name [String] The name of the resource group to get.
45
+ # The name is case insensitive.
46
+ # @param solution_name [String] User Solution Name.
47
+ # @param parameters [Solution] The parameters required to create OMS Solution.
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [Concurrent::Promise] promise which provides async access to http
52
+ # response.
53
+ #
54
+ def create_or_update_async(resource_group_name, solution_name, parameters, custom_headers:nil)
55
+ # Send request
56
+ promise = begin_create_or_update_async(resource_group_name, solution_name, parameters, custom_headers:custom_headers)
57
+
58
+ promise = promise.then do |response|
59
+ # Defining deserialization method.
60
+ deserialize_method = lambda do |parsed_response|
61
+ result_mapper = Azure::OperationsManagement::Mgmt::V2015_11_01_preview::Models::Solution.mapper()
62
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
63
+ end
64
+
65
+ # Waiting for response.
66
+ @client.get_long_running_operation_result(response, deserialize_method)
67
+ end
68
+
69
+ promise
70
+ end
71
+
72
+ #
73
+ # Patch a Solution.
74
+ #
75
+ # Patch a Solution. Only updating tags supported.
76
+ #
77
+ # @param resource_group_name [String] The name of the resource group to get.
78
+ # The name is case insensitive.
79
+ # @param solution_name [String] User Solution Name.
80
+ # @param parameters [SolutionPatch] The parameters required to patch a
81
+ # Solution.
82
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
83
+ # will be added to the HTTP request.
84
+ #
85
+ # @return [Solution] operation results.
86
+ #
87
+ def update(resource_group_name, solution_name, parameters, custom_headers:nil)
88
+ response = update_async(resource_group_name, solution_name, parameters, custom_headers:custom_headers).value!
89
+ response.body unless response.nil?
90
+ end
91
+
92
+ #
93
+ # @param resource_group_name [String] The name of the resource group to get.
94
+ # The name is case insensitive.
95
+ # @param solution_name [String] User Solution Name.
96
+ # @param parameters [SolutionPatch] The parameters required to patch a
97
+ # Solution.
98
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
99
+ # will be added to the HTTP request.
100
+ #
101
+ # @return [Concurrent::Promise] promise which provides async access to http
102
+ # response.
103
+ #
104
+ def update_async(resource_group_name, solution_name, parameters, custom_headers:nil)
105
+ # Send request
106
+ promise = begin_update_async(resource_group_name, solution_name, parameters, custom_headers:custom_headers)
107
+
108
+ promise = promise.then do |response|
109
+ # Defining deserialization method.
110
+ deserialize_method = lambda do |parsed_response|
111
+ result_mapper = Azure::OperationsManagement::Mgmt::V2015_11_01_preview::Models::Solution.mapper()
112
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
113
+ end
114
+
115
+ # Waiting for response.
116
+ @client.get_long_running_operation_result(response, deserialize_method)
117
+ end
118
+
119
+ promise
120
+ end
121
+
122
+ #
123
+ # Deletes the solution
124
+ #
125
+ # Deletes the solution in the subscription.
126
+ #
127
+ # @param resource_group_name [String] The name of the resource group to get.
128
+ # The name is case insensitive.
129
+ # @param solution_name [String] User Solution Name.
130
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
131
+ # will be added to the HTTP request.
132
+ #
133
+ def delete(resource_group_name, solution_name, custom_headers:nil)
134
+ response = delete_async(resource_group_name, solution_name, custom_headers:custom_headers).value!
135
+ nil
136
+ end
137
+
138
+ #
139
+ # @param resource_group_name [String] The name of the resource group to get.
140
+ # The name is case insensitive.
141
+ # @param solution_name [String] User Solution Name.
142
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
143
+ # will be added to the HTTP request.
144
+ #
145
+ # @return [Concurrent::Promise] promise which provides async access to http
146
+ # response.
147
+ #
148
+ def delete_async(resource_group_name, solution_name, custom_headers:nil)
149
+ # Send request
150
+ promise = begin_delete_async(resource_group_name, solution_name, custom_headers:custom_headers)
151
+
152
+ promise = promise.then do |response|
153
+ # Defining deserialization method.
154
+ deserialize_method = lambda do |parsed_response|
155
+ end
156
+
157
+ # Waiting for response.
158
+ @client.get_long_running_operation_result(response, deserialize_method)
159
+ end
160
+
161
+ promise
162
+ end
163
+
164
+ #
165
+ # Retrieve solution.
166
+ #
167
+ # Retrieves the user solution.
168
+ #
169
+ # @param resource_group_name [String] The name of the resource group to get.
170
+ # The name is case insensitive.
171
+ # @param solution_name [String] User Solution Name.
172
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
173
+ # will be added to the HTTP request.
174
+ #
175
+ # @return [Solution] operation results.
176
+ #
177
+ def get(resource_group_name, solution_name, custom_headers:nil)
178
+ response = get_async(resource_group_name, solution_name, custom_headers:custom_headers).value!
179
+ response.body unless response.nil?
180
+ end
181
+
182
+ #
183
+ # Retrieve solution.
184
+ #
185
+ # Retrieves the user solution.
186
+ #
187
+ # @param resource_group_name [String] The name of the resource group to get.
188
+ # The name is case insensitive.
189
+ # @param solution_name [String] User Solution Name.
190
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
191
+ # will be added to the HTTP request.
192
+ #
193
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
194
+ #
195
+ def get_with_http_info(resource_group_name, solution_name, custom_headers:nil)
196
+ get_async(resource_group_name, solution_name, custom_headers:custom_headers).value!
197
+ end
198
+
199
+ #
200
+ # Retrieve solution.
201
+ #
202
+ # Retrieves the user solution.
203
+ #
204
+ # @param resource_group_name [String] The name of the resource group to get.
205
+ # The name is case insensitive.
206
+ # @param solution_name [String] User Solution Name.
207
+ # @param [Hash{String => String}] A hash of custom headers that will be added
208
+ # to the HTTP request.
209
+ #
210
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
211
+ #
212
+ def get_async(resource_group_name, solution_name, custom_headers:nil)
213
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
214
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
215
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
216
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
217
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
218
+ fail ArgumentError, 'solution_name is nil' if solution_name.nil?
219
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
220
+
221
+
222
+ request_headers = {}
223
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
224
+
225
+ # Set Headers
226
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
227
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
228
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}'
229
+
230
+ request_url = @base_url || @client.base_url
231
+
232
+ options = {
233
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
234
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'solutionName' => solution_name},
235
+ query_params: {'api-version' => @client.api_version},
236
+ headers: request_headers.merge(custom_headers || {}),
237
+ base_url: request_url
238
+ }
239
+ promise = @client.make_request_async(:get, path_template, options)
240
+
241
+ promise = promise.then do |result|
242
+ http_response = result.response
243
+ status_code = http_response.status
244
+ response_content = http_response.body
245
+ unless status_code == 200
246
+ error_model = JSON.load(response_content)
247
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
248
+ end
249
+
250
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
251
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
252
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
253
+ # Deserialize Response
254
+ if status_code == 200
255
+ begin
256
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
257
+ result_mapper = Azure::OperationsManagement::Mgmt::V2015_11_01_preview::Models::Solution.mapper()
258
+ result.body = @client.deserialize(result_mapper, parsed_response)
259
+ rescue Exception => e
260
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
261
+ end
262
+ end
263
+
264
+ result
265
+ end
266
+
267
+ promise.execute
268
+ end
269
+
270
+ #
271
+ # Retrieves the solution list for the subscription
272
+ #
273
+ # Retrieves the solution list. It will retrieve both first party and third
274
+ # party solutions
275
+ #
276
+ # @param resource_group_name [String] The name of the resource group to get.
277
+ # The name is case insensitive.
278
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
279
+ # will be added to the HTTP request.
280
+ #
281
+ # @return [SolutionPropertiesList] operation results.
282
+ #
283
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
284
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
285
+ response.body unless response.nil?
286
+ end
287
+
288
+ #
289
+ # Retrieves the solution list for the subscription
290
+ #
291
+ # Retrieves the solution list. It will retrieve both first party and third
292
+ # party solutions
293
+ #
294
+ # @param resource_group_name [String] The name of the resource group to get.
295
+ # The name is case insensitive.
296
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
297
+ # will be added to the HTTP request.
298
+ #
299
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
300
+ #
301
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
302
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
303
+ end
304
+
305
+ #
306
+ # Retrieves the solution list for the subscription
307
+ #
308
+ # Retrieves the solution list. It will retrieve both first party and third
309
+ # party solutions
310
+ #
311
+ # @param resource_group_name [String] The name of the resource group to get.
312
+ # The name is case insensitive.
313
+ # @param [Hash{String => String}] A hash of custom headers that will be added
314
+ # to the HTTP request.
315
+ #
316
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
317
+ #
318
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
319
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
320
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
321
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
322
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
323
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
324
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
325
+
326
+
327
+ request_headers = {}
328
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
329
+
330
+ # Set Headers
331
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
332
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
333
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions'
334
+
335
+ request_url = @base_url || @client.base_url
336
+
337
+ options = {
338
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
339
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
340
+ query_params: {'api-version' => @client.api_version},
341
+ headers: request_headers.merge(custom_headers || {}),
342
+ base_url: request_url
343
+ }
344
+ promise = @client.make_request_async(:get, path_template, options)
345
+
346
+ promise = promise.then do |result|
347
+ http_response = result.response
348
+ status_code = http_response.status
349
+ response_content = http_response.body
350
+ unless status_code == 200
351
+ error_model = JSON.load(response_content)
352
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
353
+ end
354
+
355
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
356
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
357
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
358
+ # Deserialize Response
359
+ if status_code == 200
360
+ begin
361
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
362
+ result_mapper = Azure::OperationsManagement::Mgmt::V2015_11_01_preview::Models::SolutionPropertiesList.mapper()
363
+ result.body = @client.deserialize(result_mapper, parsed_response)
364
+ rescue Exception => e
365
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
366
+ end
367
+ end
368
+
369
+ result
370
+ end
371
+
372
+ promise.execute
373
+ end
374
+
375
+ #
376
+ # Retrieves the solution list for the subscription
377
+ #
378
+ # Retrieves the solution list. It will retrieve both first party and third
379
+ # party solutions
380
+ #
381
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
382
+ # will be added to the HTTP request.
383
+ #
384
+ # @return [SolutionPropertiesList] operation results.
385
+ #
386
+ def list_by_subscription(custom_headers:nil)
387
+ response = list_by_subscription_async(custom_headers:custom_headers).value!
388
+ response.body unless response.nil?
389
+ end
390
+
391
+ #
392
+ # Retrieves the solution list for the subscription
393
+ #
394
+ # Retrieves the solution list. It will retrieve both first party and third
395
+ # party solutions
396
+ #
397
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
398
+ # will be added to the HTTP request.
399
+ #
400
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
401
+ #
402
+ def list_by_subscription_with_http_info(custom_headers:nil)
403
+ list_by_subscription_async(custom_headers:custom_headers).value!
404
+ end
405
+
406
+ #
407
+ # Retrieves the solution list for the subscription
408
+ #
409
+ # Retrieves the solution list. It will retrieve both first party and third
410
+ # party solutions
411
+ #
412
+ # @param [Hash{String => String}] A hash of custom headers that will be added
413
+ # to the HTTP request.
414
+ #
415
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
416
+ #
417
+ def list_by_subscription_async(custom_headers:nil)
418
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
419
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
420
+
421
+
422
+ request_headers = {}
423
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
424
+
425
+ # Set Headers
426
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
427
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
428
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.OperationsManagement/solutions'
429
+
430
+ request_url = @base_url || @client.base_url
431
+
432
+ options = {
433
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
434
+ path_params: {'subscriptionId' => @client.subscription_id},
435
+ query_params: {'api-version' => @client.api_version},
436
+ headers: request_headers.merge(custom_headers || {}),
437
+ base_url: request_url
438
+ }
439
+ promise = @client.make_request_async(:get, path_template, options)
440
+
441
+ promise = promise.then do |result|
442
+ http_response = result.response
443
+ status_code = http_response.status
444
+ response_content = http_response.body
445
+ unless status_code == 200
446
+ error_model = JSON.load(response_content)
447
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
448
+ end
449
+
450
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
451
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
452
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
453
+ # Deserialize Response
454
+ if status_code == 200
455
+ begin
456
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
457
+ result_mapper = Azure::OperationsManagement::Mgmt::V2015_11_01_preview::Models::SolutionPropertiesList.mapper()
458
+ result.body = @client.deserialize(result_mapper, parsed_response)
459
+ rescue Exception => e
460
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
461
+ end
462
+ end
463
+
464
+ result
465
+ end
466
+
467
+ promise.execute
468
+ end
469
+
470
+ #
471
+ # Create/Update Solution.
472
+ #
473
+ # Creates or updates the Solution.
474
+ #
475
+ # @param resource_group_name [String] The name of the resource group to get.
476
+ # The name is case insensitive.
477
+ # @param solution_name [String] User Solution Name.
478
+ # @param parameters [Solution] The parameters required to create OMS Solution.
479
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
480
+ # will be added to the HTTP request.
481
+ #
482
+ # @return [Solution] operation results.
483
+ #
484
+ def begin_create_or_update(resource_group_name, solution_name, parameters, custom_headers:nil)
485
+ response = begin_create_or_update_async(resource_group_name, solution_name, parameters, custom_headers:custom_headers).value!
486
+ response.body unless response.nil?
487
+ end
488
+
489
+ #
490
+ # Create/Update Solution.
491
+ #
492
+ # Creates or updates the Solution.
493
+ #
494
+ # @param resource_group_name [String] The name of the resource group to get.
495
+ # The name is case insensitive.
496
+ # @param solution_name [String] User Solution Name.
497
+ # @param parameters [Solution] The parameters required to create OMS Solution.
498
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
499
+ # will be added to the HTTP request.
500
+ #
501
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
502
+ #
503
+ def begin_create_or_update_with_http_info(resource_group_name, solution_name, parameters, custom_headers:nil)
504
+ begin_create_or_update_async(resource_group_name, solution_name, parameters, custom_headers:custom_headers).value!
505
+ end
506
+
507
+ #
508
+ # Create/Update Solution.
509
+ #
510
+ # Creates or updates the Solution.
511
+ #
512
+ # @param resource_group_name [String] The name of the resource group to get.
513
+ # The name is case insensitive.
514
+ # @param solution_name [String] User Solution Name.
515
+ # @param parameters [Solution] The parameters required to create OMS Solution.
516
+ # @param [Hash{String => String}] A hash of custom headers that will be added
517
+ # to the HTTP request.
518
+ #
519
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
520
+ #
521
+ def begin_create_or_update_async(resource_group_name, solution_name, parameters, custom_headers:nil)
522
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
523
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
524
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
525
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
526
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
527
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
528
+ fail ArgumentError, 'solution_name is nil' if solution_name.nil?
529
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
530
+
531
+
532
+ request_headers = {}
533
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
534
+
535
+ # Set Headers
536
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
537
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
538
+
539
+ # Serialize Request
540
+ request_mapper = Azure::OperationsManagement::Mgmt::V2015_11_01_preview::Models::Solution.mapper()
541
+ request_content = @client.serialize(request_mapper, parameters)
542
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
543
+
544
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}'
545
+
546
+ request_url = @base_url || @client.base_url
547
+
548
+ options = {
549
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
550
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'solutionName' => solution_name},
551
+ query_params: {'api-version' => @client.api_version},
552
+ body: request_content,
553
+ headers: request_headers.merge(custom_headers || {}),
554
+ base_url: request_url
555
+ }
556
+ promise = @client.make_request_async(:put, path_template, options)
557
+
558
+ promise = promise.then do |result|
559
+ http_response = result.response
560
+ status_code = http_response.status
561
+ response_content = http_response.body
562
+ unless status_code == 201
563
+ error_model = JSON.load(response_content)
564
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
565
+ end
566
+
567
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
568
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
569
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
570
+ # Deserialize Response
571
+ if status_code == 201
572
+ begin
573
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
574
+ result_mapper = Azure::OperationsManagement::Mgmt::V2015_11_01_preview::Models::Solution.mapper()
575
+ result.body = @client.deserialize(result_mapper, parsed_response)
576
+ rescue Exception => e
577
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
578
+ end
579
+ end
580
+
581
+ result
582
+ end
583
+
584
+ promise.execute
585
+ end
586
+
587
+ #
588
+ # Patch a Solution.
589
+ #
590
+ # Patch a Solution. Only updating tags supported.
591
+ #
592
+ # @param resource_group_name [String] The name of the resource group to get.
593
+ # The name is case insensitive.
594
+ # @param solution_name [String] User Solution Name.
595
+ # @param parameters [SolutionPatch] The parameters required to patch a
596
+ # Solution.
597
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
598
+ # will be added to the HTTP request.
599
+ #
600
+ # @return [Solution] operation results.
601
+ #
602
+ def begin_update(resource_group_name, solution_name, parameters, custom_headers:nil)
603
+ response = begin_update_async(resource_group_name, solution_name, parameters, custom_headers:custom_headers).value!
604
+ response.body unless response.nil?
605
+ end
606
+
607
+ #
608
+ # Patch a Solution.
609
+ #
610
+ # Patch a Solution. Only updating tags supported.
611
+ #
612
+ # @param resource_group_name [String] The name of the resource group to get.
613
+ # The name is case insensitive.
614
+ # @param solution_name [String] User Solution Name.
615
+ # @param parameters [SolutionPatch] The parameters required to patch a
616
+ # Solution.
617
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
618
+ # will be added to the HTTP request.
619
+ #
620
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
621
+ #
622
+ def begin_update_with_http_info(resource_group_name, solution_name, parameters, custom_headers:nil)
623
+ begin_update_async(resource_group_name, solution_name, parameters, custom_headers:custom_headers).value!
624
+ end
625
+
626
+ #
627
+ # Patch a Solution.
628
+ #
629
+ # Patch a Solution. Only updating tags supported.
630
+ #
631
+ # @param resource_group_name [String] The name of the resource group to get.
632
+ # The name is case insensitive.
633
+ # @param solution_name [String] User Solution Name.
634
+ # @param parameters [SolutionPatch] The parameters required to patch a
635
+ # Solution.
636
+ # @param [Hash{String => String}] A hash of custom headers that will be added
637
+ # to the HTTP request.
638
+ #
639
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
640
+ #
641
+ def begin_update_async(resource_group_name, solution_name, parameters, custom_headers:nil)
642
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
643
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
644
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
645
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
646
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
647
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
648
+ fail ArgumentError, 'solution_name is nil' if solution_name.nil?
649
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
650
+
651
+
652
+ request_headers = {}
653
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
654
+
655
+ # Set Headers
656
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
657
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
658
+
659
+ # Serialize Request
660
+ request_mapper = Azure::OperationsManagement::Mgmt::V2015_11_01_preview::Models::SolutionPatch.mapper()
661
+ request_content = @client.serialize(request_mapper, parameters)
662
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
663
+
664
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}'
665
+
666
+ request_url = @base_url || @client.base_url
667
+
668
+ options = {
669
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
670
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'solutionName' => solution_name},
671
+ query_params: {'api-version' => @client.api_version},
672
+ body: request_content,
673
+ headers: request_headers.merge(custom_headers || {}),
674
+ base_url: request_url
675
+ }
676
+ promise = @client.make_request_async(:patch, path_template, options)
677
+
678
+ promise = promise.then do |result|
679
+ http_response = result.response
680
+ status_code = http_response.status
681
+ response_content = http_response.body
682
+ unless status_code == 200
683
+ error_model = JSON.load(response_content)
684
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
685
+ end
686
+
687
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
688
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
689
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
690
+ # Deserialize Response
691
+ if status_code == 200
692
+ begin
693
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
694
+ result_mapper = Azure::OperationsManagement::Mgmt::V2015_11_01_preview::Models::Solution.mapper()
695
+ result.body = @client.deserialize(result_mapper, parsed_response)
696
+ rescue Exception => e
697
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
698
+ end
699
+ end
700
+
701
+ result
702
+ end
703
+
704
+ promise.execute
705
+ end
706
+
707
+ #
708
+ # Deletes the solution
709
+ #
710
+ # Deletes the solution in the subscription.
711
+ #
712
+ # @param resource_group_name [String] The name of the resource group to get.
713
+ # The name is case insensitive.
714
+ # @param solution_name [String] User Solution Name.
715
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
716
+ # will be added to the HTTP request.
717
+ #
718
+ #
719
+ def begin_delete(resource_group_name, solution_name, custom_headers:nil)
720
+ response = begin_delete_async(resource_group_name, solution_name, custom_headers:custom_headers).value!
721
+ nil
722
+ end
723
+
724
+ #
725
+ # Deletes the solution
726
+ #
727
+ # Deletes the solution in the subscription.
728
+ #
729
+ # @param resource_group_name [String] The name of the resource group to get.
730
+ # The name is case insensitive.
731
+ # @param solution_name [String] User Solution Name.
732
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
733
+ # will be added to the HTTP request.
734
+ #
735
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
736
+ #
737
+ def begin_delete_with_http_info(resource_group_name, solution_name, custom_headers:nil)
738
+ begin_delete_async(resource_group_name, solution_name, custom_headers:custom_headers).value!
739
+ end
740
+
741
+ #
742
+ # Deletes the solution
743
+ #
744
+ # Deletes the solution in the subscription.
745
+ #
746
+ # @param resource_group_name [String] The name of the resource group to get.
747
+ # The name is case insensitive.
748
+ # @param solution_name [String] User Solution Name.
749
+ # @param [Hash{String => String}] A hash of custom headers that will be added
750
+ # to the HTTP request.
751
+ #
752
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
753
+ #
754
+ def begin_delete_async(resource_group_name, solution_name, custom_headers:nil)
755
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
756
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
757
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
758
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
759
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
760
+ fail ArgumentError, 'solution_name is nil' if solution_name.nil?
761
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
762
+
763
+
764
+ request_headers = {}
765
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
766
+
767
+ # Set Headers
768
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
769
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
770
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}'
771
+
772
+ request_url = @base_url || @client.base_url
773
+
774
+ options = {
775
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
776
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'solutionName' => solution_name},
777
+ query_params: {'api-version' => @client.api_version},
778
+ headers: request_headers.merge(custom_headers || {}),
779
+ base_url: request_url
780
+ }
781
+ promise = @client.make_request_async(:delete, path_template, options)
782
+
783
+ promise = promise.then do |result|
784
+ http_response = result.response
785
+ status_code = http_response.status
786
+ response_content = http_response.body
787
+ unless status_code == 200
788
+ error_model = JSON.load(response_content)
789
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
790
+ end
791
+
792
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
793
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
794
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
795
+
796
+ result
797
+ end
798
+
799
+ promise.execute
800
+ end
801
+
802
+ end
803
+ end